Skip to content
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

Adding chunk to stream fails on dict #154

Closed
glennbach opened this issue Nov 1, 2023 · 3 comments
Closed

Adding chunk to stream fails on dict #154

glennbach opened this issue Nov 1, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@glennbach
Copy link

glennbach commented Nov 1, 2023

I'm building a rag chain, and have the rag portions on the server side and the chat history on the client side. When I stream, I'm getting dict chunks which breaks in client.py:547. If I change the block from:

if final_output:
  final_output += chunk
else:
  final_output = chunk

to

if final_output:
  if isinstance(final_output, dict):
    final_output.update(chunk)
  else:
    final_output += chunk
else:
  final_output = chunk

it works. Am I using this in a way that it wasn't intended, or can a solution like this be included?

Thanks,

Glenn

@eyurtsev
Copy link
Collaborator

eyurtsev commented Nov 2, 2023

Thanks! Will release a fix tomorrow. Any chance you have a short snippet I could use for a unit-test?

@eyurtsev eyurtsev self-assigned this Nov 2, 2023
@eyurtsev eyurtsev added the bug Something isn't working label Nov 2, 2023
@glennbach
Copy link
Author

glennbach commented Nov 2, 2023 via email

@eyurtsev
Copy link
Collaborator

eyurtsev commented Nov 3, 2023

Fixed in newest release. If you bump into any more issues, minimal code or chain or url to chain/code would be helpful to see to add more unit testing. Thanks for reporting!

@eyurtsev eyurtsev closed this as completed Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants