Handle the streaming response.
(generator: Stream[ChatCompletionChunk])
| 94 | |
| 95 | |
| 96 | def handle_streaming_response(generator: Stream[ChatCompletionChunk]): |
| 97 | """Handle the streaming response.""" |
| 98 | for completion in generator: |
| 99 | log.debug(f"Raw chunk completion: {completion}") |
| 100 | parsed_content = parse_stream_response(completion) |
| 101 | yield parsed_content |
| 102 | |
| 103 | |
| 104 | class DashscopeClient(ModelClient): |
no test coverage detected