Example: experimental_streamData
, server Timestamps, and client messages
#665
peterdresslar
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I've added to my sandbox repo with an example of running timestamps from the server to the client using
experimental_streamData
to send a server-generated timestamp to the client asdata
, just to get a good feel for how well that works. (and to address issue #647.)There are a few tricky aspects, including extending the shared type
Message
and understanding howuseState
rerenders for theuseChat
helpers. However, the good news is that thedata
object does update in a predictable manner, at least in testing.The code is in this repo: the route is under
/chat/openai-experimental-streamdata
, and the component isopenai-experimental-streamdata-timestamps.tsx
.You can test it online at this site by choosing the OpenAI with Experimental Stream Data Timestamps option.
Beta Was this translation helpful? Give feedback.
All reactions