Replies: 1 comment
-
Associated discord thread: https://discord.com/channels/1119368998161752075/1119375594984050779/1324870777136353351 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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 (logger)
(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
Logger 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