One change
Streaming Input
agent-sdk/streaming-vs-single-mode
Nearest release: v2.1.247, published 5 hours before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
agent-sdk/streaming-vs-single-mode Changed · +1 / -2 lines
from line 272
async def single_message_example(): # Simple one-shot query using query() function - # query() raises after an error result, such as error_max_turns + # query() raises ResultError after an error result, such as error_max_turns try: async for message in query( prompt="Explain the authentication flow",
from line 280
): if isinstance(message, ResultMessage) and message.subtype == "success": print(message.result) - # The SDK raises a plain Exception for error results, so match Exception here except Exception as e: print(f"Query failed: {e}")