Skip to content

Conversation

@jlowin
Copy link
Member

@jlowin jlowin commented Jan 15, 2024

This PR allows you to pass a stream_callback to generate_chat in order to handle streaming responses from chat completion endpoints.

stream_callback receives a StreamingChatResponse object which has:

  • chunk, the most recently received chatcompletion delta
  • completion, the reconstructed chatcompletion (up through the provided chunk)
  • messages, for easy access to the messages received in the completion (a list in case n > 1)

Note this is not used in Marvin features yet.

@jlowin
Copy link
Member Author

jlowin commented Jan 15, 2024

Merging because the failed test is a flaky one

@jlowin jlowin merged commit 9bc94be into 2.0 Jan 15, 2024
@jlowin jlowin deleted the streaming branch January 15, 2024 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants