Streaming & Async Support
Icho fully supports recording and replaying streaming responses (both sync and async generators) for OpenAI, Anthropic, and LangChain Groq models.
OpenAI Streaming Example:
from openai import OpenAI from icho import cassette client = OpenAI() with cassette("tests/cassettes"): stream = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Write a poem"}], stream=True ) for chunk in stream: print(chunk.choices[0].delta.content or "", end="")
