https://www.boundaryml.com logo
🟡 Inquiry about code snippet from BoundaryML docu...
# questions
r
Has anyone used this code snippet from https://docs.boundaryml.com/ref/baml_client/with-options ? it would be nice to see a tutorial or blog on that ... My use case would be - streaming tx from via jdbc ...
Copy code
from baml_client.async_client import b
from baml_py import Collector

async def run():
    collector = Collector(name="my-collector")
    my_b = b.with_options(collector=collector, client_registry=client_registry)

    stream = my_b.stream.ExtractResume("...")
    async for chunk in stream:
        print(chunk)
    
    result = await stream.get_final_result()
    print(collector.id(stream.id).usage)
v
oh whoops
stream.id
may not exist (it should but it may not)
if you find thats the case, let us know and we can patch it quick!
r
most likely - 🙂 - but i have not tried just trying to wrap my head around it first 😉 let me ask
windsurf
to create a hypothetical solution 😉