Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we define all BAML clients at runtime instead of using clients.baml #1330

Open
shoang22 opened this issue Jan 14, 2025 · 4 comments
Open

Comments

@shoang22
Copy link

shoang22 commented Jan 14, 2025

Hello, I use BAML with Azure Openai, which currently uses an auth token that expires after a certain amount of time, so I'd like to limit the client definitions in my python code, instead of having to use clients.baml.

Currently, I define the client in clients.baml, and use dummy variables for the credentials, and in my python code, I overwrite them with the correct credentials at runtime. Is there a cleaner way to accomplish this?

@aaronvg
Copy link
Contributor

aaronvg commented Jan 14, 2025

The client registry should help define things at runtime: https://docs.boundaryml.com/guide/baml-advanced/llm-client-registry

@shoang22
Copy link
Author

Right, that's what I'm using now. I'm wondering if I can use just the client registry, without having to define my clients in clients.baml with initial dummy variables

@aaronvg
Copy link
Contributor

aaronvg commented Jan 14, 2025

ah gotcha! Yes I'll discuss this with the team. Do you use the BAML Playground in VSCode by the way? Or just run your functions in your actual code?

@shoang22
Copy link
Author

Thank you! I do both, but the bulk of testing happens in the actual code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants