prompt | string | The user message, appended as the trailing turn. |
messages | MessageType[] | Prior conversation turns prepended before prompt. |
systemPrompts | string[] | Extra system prompts, appended after the agent’s base prompts. |
tools | AiToolClassType[] | Extra tools for this call only, added to the agent’s own. |
middlewares | AiMiddlewareClassType[] | Extra middleware for this call only. |
temperature | number | Output randomness, range [0.0, 2.0]. |
topP | number | Nucleus sampling threshold. |
maxTokens | number | Maximum tokens to generate. |
outputSchema | AssertType | A schema for structured output. |
metadata | Record<string, unknown> | Request-scoped data carried through middleware, never sent to the model. |
context | unknown | Runtime dependencies for tools and middleware, never sent to the model. |
conversationId | string | Identifier for tracking a conversation. |
abortController | AbortController | Cancels the in-flight request. |
agentLoopStrategy | AgentLoopStrategy | Controls how the agent loop iterates (TanStack AI). |