https://www.boundaryml.com logo
🟑 Streaming Tokens and Handling Partial Outputs i...
# questions
l
Hi, probably a dumb question but I'm stuck πŸ™‚ I want to stream tokens out of a function with a string type But as I stream the partial output it actually prints the entire thing every time, how do I get to just the delta?
v
For that you need to use the collector! Or you can build the delta object yourself using a delta variable
On phone or I’d post a code snippet sorry!
The cool thing about streaming in BAML πŸ‘ is we actually give you the value as soon as you are ready to consume instead of as it comes in. So if you’re running something kind of slow on every object, you’ll get it all the updates since the last process time rather than just the next event.
To access the raw underlying stream / sse events, we expose that via our collector interface