Replies: 10 comments 3 replies
-
Associated discord thread: https://discord.com/channels/1119368998161752075/1119375594984050779/1324870777136353351 |
Beta Was this translation helpful? Give feedback.
-
Maybe further down the road you want to add ability to hand off the transport mechanism to the user. They can make their own http calls and capture what they want and hand the data back to you. People may have special proxy servers they need to set or have to log the calls into ops monitoring pipeline etc. Also this way you also future proof yourself for any additional logs and error handling. |
Beta Was this translation helpful? Give feedback.
-
@hellovai thank you for the update! Is there any workaround to count the tokens already? |
Beta Was this translation helpful? Give feedback.
-
This APi makes sense and would address my use cases. I appreciate that you also gave consideration to the streaming API as well. |
Beta Was this translation helpful? Give feedback.
-
Current ETA: ~Feb 14. Will keep this updated! We are actively working on releasing this (#1 priority) |
Beta Was this translation helpful? Give feedback.
-
Happy Valentines day ❤️ .... I am really waiting for this feature. 😝 |
Beta Was this translation helpful? Give feedback.
-
Any update on this issue? I am especially looking forward to access to the raw model output (DeepSeek thinking process). |
Beta Was this translation helpful? Give feedback.
-
As an update for everyone, it looks like its still 2 releases away (March first week is the target)! We've got python finally working, and so just need to touch up the other languages and do final testing! but we're so excited to finally make this available!! @aaronvg is working hard ⚙️ |
Beta Was this translation helpful? Give feedback.
-
PR to track: #1512 |
Beta Was this translation helpful? Give feedback.
-
We merged the initial python implementation and is in 0.78.0 as a pre-alpha feature (not fully complete). If you use it please be aware the interfaces will change on the next release. https://github.com/BoundaryML/baml/blob/canary/integ-tests/python/tests/test_collector.py I will keep this updated when it's fully out for all languages (TS and Ruby) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Update: latest docs link: https://boundary-preview-3c6f166c-5bc3-4b4f-b5b1-7ec76926f143.docs.buildwithfern.com/ref/baml_client/collector (with some api updates)
------ Original post -----
One of the hardest parts about using BAML is exposing internal workings of BAML to developers using it. Items such as: Token Usage, Raw HTTP Response from the model are all abstracted away for the sake of simplicity. While we do value simplicity, we don’t want it introspection to be a blocker.
This document outlines a proposal that will allow BAML developers to:
💡 None of the content here changes anything about BAML code. This will only change baml_client code (i.e. how you call BAML functions).
Table of Contents
with_options
Get usage statistics (collector)
(This document is mostly python, but please see the full reference docs for other languages, they all expose the same capabilities)
Python
Accessing additional metadata
We also want to expose all metadata such as raw HTTP respones
Running calls in parallel (id)
When calling in parallel, its
logger.last
or filtering my function name may not be reliable.You can instead use the new
b.id
scope to generate an(id, T)
value from a function.Reducing repetition of baml_options with
with_options
You may find that always passing in
baml_options
can be cumbersome. We now allow you to construct aBamlClient
with default options passed in.Full reference docs
Collector Class
https://boundary-preview-12ad00fd-c3dc-43be-ab63-ae17b33338ce.docs.buildwithfern.com/ref/baml-client/logger
id scope
https://boundary-preview-12ad00fd-c3dc-43be-ab63-ae17b33338ce.docs.buildwithfern.com/ref/baml-client/id
with_options
https://boundary-preview-12ad00fd-c3dc-43be-ab63-ae17b33338ce.docs.buildwithfern.com/ref/baml-client/with-options
Beta Was this translation helpful? Give feedback.
All reactions