Defined in: packages/components/src/agents/types.ts:113
Contract that a model component must meet to drive an agent.
Any object with chatCompletion() works. OpenAICompatible and Deepseek from
@astack-tech/integrations implement it; see the custom-model example for your own.
Methods
chatCompletion()
chatCompletion(messages, options?): Promise<AgentMessage>;
Defined in: packages/components/src/agents/types.ts:115
Sends the conversation and resolves with the assistant reply, including any tool calls and token usage.
Parameters
| Parameter | Type |
|---|---|
messages |
AgentMessage[] |
options? |
ModelProviderOptions |
Returns
Promise<AgentMessage>
streamChatCompletion()?
streamChatCompletion?(messages, options?): AsyncGenerator<Partial<AgentMessage>>;
Defined in: packages/components/src/agents/types.ts:120
Optional. Streams the reply as partial messages: text deltas, tool-call deltas and usage. Without it, StreamingAgent falls back to chatCompletion.
Parameters
| Parameter | Type |
|---|---|
messages |
AgentMessage[] |
options? |
ModelProviderOptions |
Returns
AsyncGenerator<Partial<AgentMessage>>