()
| 27 | |
| 28 | |
| 29 | async def async_stream() -> None: |
| 30 | stream = await async_client.completions.create( |
| 31 | prompt=f"{HUMAN_PROMPT} {question}{AI_PROMPT}", |
| 32 | model="claude-sonnet-5", |
| 33 | stream=True, |
| 34 | max_tokens_to_sample=300, |
| 35 | ) |
| 36 | |
| 37 | async for completion in stream: |
| 38 | print(completion.completion, end="", flush=True) |
| 39 | |
| 40 | print() |
| 41 | |
| 42 | |
| 43 | def stream_error() -> None: |
no test coverage detected