@maiar-ai/core / Runtime
Class: Runtime
Defined in: packages/core/src/runtime/index.ts:31
Runtime class that manages the execution of plugins and agent state
Accessors​
logger​
Get Signature​
get logger():
Logger
Defined in: packages/core/src/runtime/index.ts:50
Returns the logger instance for the runtime scoped to the runtime
Returns​
Logger
memory​
Get Signature​
get memory():
MemoryManager
Defined in: packages/core/src/runtime/index.ts:326
Access to the memory manager for plugins
Returns​
server​
Get Signature​
get server():
Server
Defined in: packages/core/src/runtime/index.ts:333
Access to the server manager for plugins
Returns​
Server
templates​
Get Signature​
get templates():
PromptRegistry
Defined in: packages/core/src/runtime/index.ts:340
Access to the prompt registry for plugins
Returns​
Methods​
init()​
staticinit(__namedParameters):Promise<Runtime>
Defined in: packages/core/src/runtime/index.ts:93
Parameters​
__namedParameters​
modelProviders​
memoryProvider​
plugins​
Plugin[]
capabilityAliases​
CapabilityAliasGroup[] = []
options​
{ logger: LoggerOptions; server: { port: number; cors: CorsOptions; }; concurrency: { maxTasks: number; }; }
options.logger​
LoggerOptions
options.server​
{ port: number; cors: CorsOptions; }
options.server.port​
number
options.server.cors​
CorsOptions
options.concurrency​
{ maxTasks: number; }
options.concurrency.maxTasks​
number
Returns​
Promise<Runtime>
start()​
start():
Promise<void>
Defined in: packages/core/src/runtime/index.ts:347
Start the runtime
Returns​
Promise<void>
stop()​
stop():
Promise<void>
Defined in: packages/core/src/runtime/index.ts:400
Stop the runtime
Returns​
Promise<void>
createEvent()​
createEvent(
trigger,space):Promise<void>
Defined in: packages/core/src/runtime/index.ts:511
Create an event that will be processed by the pipeline processor
Parameters​
trigger​
space​
Returns​
Promise<void>
executeCapability()​
executeCapability<
K>(capabilityId,input,config?):Promise<ICapabilities[K]["output"]>
Defined in: packages/core/src/runtime/index.ts:534
Execute a capability through the model-manager.
Type Parameters​
• K extends "text-generation"
– Capability identifier literal (key of the ICapabilities interface).
Parameters​
capabilityId​
K
– The capability ID or alias.
input​
ICapabilities[K]["input"]
– Data validated against the capability's input Zod schema.
config?​
ICapabilities[K] extends object ? C : unknown
– Optional configuration object.
The type of config is computed with the conditional type
ICapabilities[K] extends { config: infer C } ? C : unknown:
• If a given capability defines a config schema, the parameter is
strongly typed as that schema (C).
• Otherwise the parameter collapses to unknown, making it truly
optional and preventing "config" from being accessed on capabilities
that don't declare one.
Returns​
Promise<ICapabilities[K]["output"]>
getObject()​
getObject<
T>(schema,prompt,config?):Promise<TypeOf<T>>
Defined in: packages/core/src/runtime/index.ts:549
Prompt the LLM to generate a JSON object from a prompt
Type Parameters​
• T extends ZodType
Parameters​
schema​
T
The schema of the object to generate in zod format
prompt​
string
The prompt to generate the object from
config?​
The configuration for the model request
Returns​
Promise<TypeOf<T>>
The generated object