Skip to content

Feature request: Add an option to pass model config object in AIChatAgent class #760

@ashukumar2001

Description

@ashukumar2001

'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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions