Skip to content

Return the file URL when stringifying a streamed output event - #484

Open
Twiink wants to merge 1 commit into
replicate:mainfrom
Twiink:fix/stringify-stream-file-output-20261127-r4
Open

Twiink wants to merge 1 commit into
replicate:mainfrom
Twiink:fix/stringify-stream-file-output-20261127-r4

Conversation

@Twiink

@Twiink Twiink commented Nov 27, 2026

Copy link
Copy Markdown

The documented str(event) pattern raises TypeError on a file output because EventSource has converted the URL to a FileOutput, and ServerSentEvent.str returns that object directly. Delegate string conversion to the data object so callers receive its URL. The original FileOutput stays on event.data for reading the file.

Tested text output, file output, and the done event through both iterators using an HTTP event-stream response. The offline suite passed (160 passed, 6 skipped). Ruff and Pyright for the SDK and changed test passed.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant