Skip to content

Streaming support: async generators and wrap(stream=True) #23

Description

@tishachawla-jg

Problem

0.2.0 supports async def boundaries but not async generators (SSE streaming). And wrap(client) does not handle stream=True (a streamed response is an iterator, not one object).

Proposal

  • @boundary on an async def that yields: pass items straight through, record the assembled stream when exhausted, record a failed envelope on early close / error.
  • wrap(..., stream=True): tee the stream, record the concatenated completion at the end; on replay, yield the recorded chunks.

Acceptance

  • An async-generator boundary records and replays.
  • A streamed wrap call records the full completion and replays the chunks.
  • Tests for both.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions