Skip to main content

Documentation Index

Fetch the complete documentation index at: https://www.getmaxim.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

View module source on GitHub

AsyncStreamWrapper

class AsyncStreamWrapper()
Async wrapper for OpenAI streaming chat completions that handles Maxim logging. This class wraps an async OpenAI stream to automatically log generation results and trace information when the stream is fully consumed. It accumulates chunks as they are yielded and processes the complete response for logging when the stream ends.