Runtime
Delegate an Agent turn to a registered runtime.
runtime hands the whole turn to a registered runtime instead of running the local chat loop.
Quick Start
- Use the builtin runtime
typescript import { Agent } from 'praisonai'; const agent = new Agent({ instructions: 'Delegated', runtime: true }); await agent.chat('Do the work');runtime: trueselectsDEFAULT_RUNTIME_ID('praisonai'). - Name a runtime and require capabilities
typescript import { Agent } from 'praisonai'; const agent = new Agent({ instructions: 'Streamed', runtime: { runtime: 'praisonai', requiredCapabilities: ['streaming'] }, });
AgentRuntimeConfig
| Field | Type | Notes |
|---|---|---|
runtime | string | Runtime id. Defaults to DEFAULT_RUNTIME_ID ('praisonai'). |
requiredCapabilities | string[] | Checked before the agent is built; a missing capability throws. |
configOverrides | Record<string, unknown> | Runtime-specific options forwarded on every turn. |
metadata | Record<string, unknown> | Free-form metadata. |
runtime accepts true, a string id, an AgentRuntimeConfig object (snake_case keys accepted), or an object that already satisfies AgentRuntimeProtocol.
When it throws
runtime and backend / runOn answer the same question — where the loop runs — so naming both is rejected as a contradiction.
Reading the resolved runtime
import { Agent } from 'praisonai';
const agent = new Agent({ instructions: 'x', runtime: true });
console.log(agent.getRuntime()); // the resolved runtime, or undefined