Merged
Conversation
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts chat streaming type handling to treat both MessageContent and raw strings uniformly while ensuring UniResponse is captured as the final response, and bumps the package patch version. Sequence diagram for updated chat streaming type handlingsequenceDiagram
participant ChatManager
participant ChatAdapter
ChatManager->>ChatAdapter: call_completion(send_messages, config, preset)
loop for each chunk
ChatAdapter-->>ChatManager: chunk
alt chunk is UniResponse
ChatManager->>ChatManager: set response = chunk
else chunk is MessageContent or str
ChatManager->>ChatManager: yield_response(chunk)
end
end
ChatManager->>ChatManager: if response is None raise RuntimeError
ChatManager-->>ChatAdapter: final response consumed
Class diagram for updated chat streaming types in _process_chatclassDiagram
class ChatManager {
+config
+preset
+yield_response(content)
+_process_chat()
}
class UniResponse {
}
class MessageContent {
}
class StringMessageContent {
+StringMessageContent(value)
}
ChatManager ..> UniResponse : uses as final response
ChatManager ..> MessageContent : streams instances
ChatManager ..> StringMessageContent : previously wrapped raw strings
MessageContent <|-- StringMessageContent : specialization
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Adjust chat response streaming to treat both MessageContent and raw string chunks as streamable output while preserving UniResponse as the final result, and bump the package patch version.
Bug Fixes:
Build: