ai icon indicating copy to clipboard operation
ai copied to clipboard

Extend messages type

Open alicercedigital opened this issue 5 months ago • 1 comments

Feature Description

It is very simple: We need to extend messages to add other properties. On our app we store the total token and the cost to generate each message and because we use a lot of different agents so we need to store agent name, model and avatar. We can´t use the useChat because of that.

If we could just extend the message type for example adding a properties customProperties then we could use the useChat or anything that use the CoreMessage.

Use Case

If we could extend the message we make the messages be usable to any type of app that need others properties on message. Examples:

  • Add token usage on message
  • Add llm costs on message
  • Add model name on message
  • Add prompt on message
  • Add name of the assistant on message
  • Add avatar image of the assistant on message

Additional context

No response

alicercedigital avatar Sep 08 '24 19:09 alicercedigital