-
Your Name authored
The Anthropic SDK's messages.stream() is a synchronous context manager, not async. For async streaming, we need to use messages.create(..., stream=True) which returns an async iterator of ServerSentEvent objects. Changed from: async with client.messages.stream(**request_kwargs) as stream: To: stream = await client.messages.create(**request_kwargs, stream=True) async for event in stream:a303acc3