Skip to content

Rewrite the stream option in registerCopilotKit by Mastra according to the context. #714

@kosukeoya

Description

@kosukeoya

Current Situation

The threadId is passed from RunAgentInput, and the resourceId becomes either a fixed agent ID or the threadId passed from RunAgentInput.
In my use case, I want to include information obtained through session authentication (which can be referenced as c.get('user').id in hono, for example) in the resourceId and threadId. For this, it would be good to have middleware that can set options when calling agent.stream.

Without this, it is not possible to separate conversation histories for each user.

const response = await this.agent.stream(convertedMessages, {

conversation: https://discord.com/channels/1309558646228779139/1440176787911872673

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