'extraOptions' will be helpful to pass LLM related configs to agents created from AIChatAgent class. this 'extraOptions' variable will be passed to onChatMessage method.
export type OnChatMessageOptions = { abortSignal?: AbortSignal; extraOptions?: Record<string, unknown>; };
// onMessage // const { body } = data.init; const parsed = JSON.parse(body as string); const { messages, extraOptions } = parsed; this.onChatMessage(()=>{}, {abortSignal, extraOptions})
here is my implementation: ashukumar2001/eddy/blob/feature/upgrade-to-ai-sdk-v6/src/worker/agents/ai-chat-agent.ts
live link: eddy