Skip to content

useChat key parameter nonfunctional #896

Closed
@ekatzenstein

Description

@ekatzenstein

Description

I'm using a key to refresh useChat and it's non-reactive with new initialMessages:

Code example

  const { messages, input, handleInputChange, handleSubmit } = useChat({
    initialMessages: gptMessages as Message[],
    onFinish,
    key: chatMode,
  });

Additional context

chatMode is changing dynamically to refresh the session but the initialMessages don't update.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai/uibugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions