Generates a single reply without maintaining session history.
User prompt text.
Optional opts: Partial<GenerateTextOptions>Optional overrides merged on top of the agent's base options.
The complete generation result.
Streams a single reply without maintaining session history.
User prompt text.
Optional opts: Partial<GenerateTextOptions>Optional overrides merged on top of the agent's base options.
Returns (or creates) a named AgentSession with its own conversation history.
Optional id: stringOptional session ID. A unique ID is generated when omitted.
The session object for this ID.
Returns persisted usage totals for the whole agent or a single session.
Optional sessionId: stringExports the agent's configuration as a portable object.
Optional metadata: { Optional human-readable metadata to attach.
Optional name?: stringOptional description?: stringOptional author?: stringOptional tags?: string[]A portable AgentExportConfig object.
Exports the agent's configuration as a pretty-printed JSON string.
Optional metadata: { Optional human-readable metadata to attach.
Optional name?: stringOptional description?: stringOptional author?: stringOptional tags?: string[]JSON string.
A stateful agent instance returned by agent.