-
Notifications
You must be signed in to change notification settings - Fork 16k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
community: added citation to streaming #29176
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -228,10 +228,12 @@ def _stream( | |||
chunk = chunk.dict() | |||
if len(chunk["choices"]) == 0: | |||
continue | |||
citations = chunk.get("citations", []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i believe citations come back with every chunk, so you'll have to only return them on the first chunk, or otherwise detect that the citations are identical to the ones already outputted.
Otherwise citations will be repeated when merging AIMessageChunk objects
PR message: Added citation for streaming
- Description: Added citation for streaming
- Issue: none
- Dependencies: none
- Twitter handle: none