Skip to content

Allow submitting form without adding a message in useChat hook #167

@lesleh

Description

@lesleh

Currently we do nothing if no text is input in the form - https://github.com/vercel-labs/ai/blob/fd69e9a5628d1cd21a7c4a36584b4c577e0cc0a6/packages/core/react/use-chat.ts#L253

But, submitting a new API request without adding a new user message is a good way to get the LLM to continue its previous response, for example if the user hit stop, or the previous response reached the token limit. This is how the OpenAI playground works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai/uianything UI relatedfeatureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions