useChat with generateText (maxRoundTrips)? #2093
Replies: 5 comments 9 replies
-
Here is a guide for using |
Beta Was this translation helpful? Give feedback.
-
Hi @lgrammel, I'm also interested in using Quick preliminary escape hatch I've come up with: <div>
{messages.map((m) => (
<div key={m.id}>
{m.role === "user" && "You: " + m.content}
{m.role === "assistant" && "AI: " + JSON.parse(m.content).messages[0].content[0].text}
</div>
))}
</div> What do you think? What would you recommend todo? P.S. |
Beta Was this translation helpful? Give feedback.
-
Bump on this, I'm interested as well. |
Beta Was this translation helpful? Give feedback.
-
Came here to say the same thing. It's not ideal, but react-native/expo doesn't support streaming so it's easiest to just use generateText for now. But it seems that useChat doesn't play nice out of the box. |
Beta Was this translation helpful? Give feedback.
-
+1. I’m using a custom provider for a custom LLM that doesn’t support tool streaming yet, so being able to use |
Beta Was this translation helpful? Give feedback.
-
Is it possible to useChat with generateText instead of streamText? Is there a best practice for appending generated text to the message stream and sending it back to the frontend?
Main reason for this is that I'm using the new maxroundtrips with generateText, but still want to have a chat UI. Alternatively, is there a good way to feed tool results into the message stream for streamText?
Beta Was this translation helpful? Give feedback.
All reactions