Rename .stream()/.stream_async()'s content parameter to stream#102
Rename .stream()/.stream_async()'s content parameter to stream#102
.stream()/.stream_async()'s content parameter to stream#102Conversation
f8792d2 to
2b015bc
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR updates the .stream() and .stream_async() methods to rename their content parameter to stream, align internal flags, and update related tests and documentation.
- Rename
content→streamin signatures, docstrings, and internal calls - Map new
streamvalues to internalyield_contentflags - Update tests and changelog for the breaking change
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/conftest.py | Updated test call from content="all" to stream="content" |
| chatlas/_chat.py | Renamed content params to stream in .stream() methods, added yield_content mapping, and refreshed docblocks |
| CHANGELOG.md | Added breaking change entry for renaming content → stream |
Comments suppressed due to low confidence (1)
CHANGELOG.md:25
- The changelog entry has empty parentheses at the end; please include the relevant PR or issue number (e.g.,
(#494)).
* The `.stream()`/`.stream_async()` method's `content` parameter was renamed to `stream`. Set `stream` to "content" to gain access to tool request/result content objects. ()
The distinction is more about the return type. Anyway, I agree the naming is confusing – lots of things could be content – but the contract of always yielding |
Breaking change to align the API for streaming content objects with tidyverse/ellmer#494.
Before this change, to access tool request/result objects in a stream, it was:
Now it's
UPDATE: Now that I think through this naming change a bit more, I'm not convinced it's an improvement. With
stream="content", it could make one wonder whatchat.stream()is doing -- is it streaming something other than content? From that perspective, I likecontent="all"better -- it better implies that you're gaining access to additional content, which is the main point of the parameter existing.cc @gadenbuie