@maiar-ai/core / ModelManager
Class: ModelManager
Defined in: packages/core/src/runtime/managers/model/index.ts:13
ModelManager is responsible for managing model instances and their capabilities
Constructors​
new ModelManager()​
new ModelManager():
ModelManager
Defined in: packages/core/src/runtime/managers/model/index.ts:34
Returns​
Accessors​
logger​
Get Signature​
get logger():
Logger
Defined in: packages/core/src/runtime/managers/model/index.ts:26
Returns​
Logger
modelProviders​
Get Signature​
get modelProviders():
ModelProvider[]
Defined in: packages/core/src/runtime/managers/model/index.ts:30
Returns​
Methods​
registerModel()​
registerModel(
modelProvider):Promise<void>
Defined in: packages/core/src/runtime/managers/model/index.ts:44
Register a model
Parameters​
modelProvider​
Returns​
Promise<void>
unregisterModel()​
unregisterModel(
modelProvider):Promise<void>
Defined in: packages/core/src/runtime/managers/model/index.ts:134
Parameters​
modelProvider​
Returns​
Promise<void>
registerCapabilityAlias()​
registerCapabilityAlias(
alias,canonicalId,transforms):void
Defined in: packages/core/src/runtime/managers/model/index.ts:168
Register a capability alias
Parameters​
alias​
string
canonicalId​
string
transforms​
CapabilityTransformEntry[] = []
Returns​
void
executeCapability()​
executeCapability<
K>(capabilityId,input,config?,modelId?):Promise<ICapabilities[K]["output"]>
Defined in: packages/core/src/runtime/managers/model/index.ts:197
Execute a capability with the given input
Type Parameters​
• K extends "text-generation"
Parameters​
capabilityId​
K
input​
ICapabilities[K]["input"]
config?​
unknown
modelId?​
string
Returns​
Promise<ICapabilities[K]["output"]>
getAvailableCapabilities()​
getAvailableCapabilities():
string[]
Defined in: packages/core/src/runtime/managers/model/index.ts:362
Get all available capabilities
Returns​
string[]
getModelsWithCapability()​
getModelsWithCapability(
capabilityId):string[]
Defined in: packages/core/src/runtime/managers/model/index.ts:369
Get all models that support a capability
Parameters​
capabilityId​
string
Returns​
string[]
setDefaultModelForCapability()​
setDefaultModelForCapability(
capabilityId,modelId):void
Defined in: packages/core/src/runtime/managers/model/index.ts:377
Set the default model for a capability
Parameters​
capabilityId​
string
modelId​
string
Returns​
void
hasCapability()​
hasCapability(
capabilityId):boolean
Defined in: packages/core/src/runtime/managers/model/index.ts:388
Check if any model supports a capability
Parameters​
capabilityId​
string
Returns​
boolean