You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A generic message type allows consumers of the API to include domain-specific data on their Messages with type-safety. The current solution either require creating a custom .d.ts definition of Message or abusing the annotations field.
I propose exporting a generic Message in place of the current Message interface as follows.
APIs and hooks which consume Message should be generic as well. For example,
const{append}=useChat<{filePath: string}>()append({role: "user",content: "what is the meaning of life",filePath: "/files/uploaded/hitchhiker.pdf"})
should be possible.
Use Case
The content of a message is typically just one piece of a complex LLM solution. Documents, requestIDs, and third-party tracking IDs are common requirements.
Additional context
Tagging @shuding as we briefly discussed this earlier today.
The text was updated successfully, but these errors were encountered:
Feature Description
A generic message type allows consumers of the API to include domain-specific data on their Messages with type-safety. The current solution either require creating a custom .d.ts definition of
Message
or abusing theannotations
field.I propose exporting a generic
Message
in place of the currentMessage
interface as follows.APIs and hooks which consume
Message
should be generic as well. For example,should be possible.
Use Case
The content of a message is typically just one piece of a complex LLM solution. Documents, requestIDs, and third-party tracking IDs are common requirements.
Additional context
Tagging @shuding as we briefly discussed this earlier today.
The text was updated successfully, but these errors were encountered: