()
| 517 | if api_kwargs.get("stream", False): |
| 518 | |
| 519 | async def async_stream_generator(): |
| 520 | async for chunk in completion: |
| 521 | log.debug(f"Raw async chunk completion: {chunk}") |
| 522 | try: |
| 523 | parsed_content = parse_stream_response(chunk) |
| 524 | except Exception as e: |
| 525 | log.error(f"Error parsing async stream chunk: {e}") |
| 526 | parsed_content = None |
| 527 | if parsed_content: |
| 528 | yield parsed_content |
| 529 | |
| 530 | return async_stream_generator() |
| 531 | else: |
nothing calls this directly
no test coverage detected