Skip to content

Commit 430e428

Browse files
authored
Test collector using openai-generic client (groq) (#1813)
<!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > Add `TestGroq` function and related tests for Groq client integration with OpenAI-generic provider. > > - **Behavior**: > - Adds `TestGroq` function in `groq.baml` for testing Groq client with OpenAI-generic provider. > - Updates `client.go` and `async_client.py` to include `TestGroq` function for synchronous and asynchronous calls. > - Adds `TestGroq` endpoint to `openapi.yaml` for API interaction. > - **Testing**: > - Adds `test_collector_groq()` in `test_collector.py` to validate Groq client functionality. > - **Misc**: > - Updates `http-server.py` to handle Groq client responses. > - Modifies `uv.lock` to update dependencies. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for 139e70f. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
1 parent 56f69e4 commit 430e428

33 files changed

Lines changed: 1113 additions & 58 deletions
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
client<llm> Groq {
2+
provider openai-generic
3+
options {
4+
api_key env.GROQ_API_KEY
5+
model "llama-3.3-70b-versatile"
6+
base_url "https://api.groq.com/openai/v1"
7+
}
8+
}
9+
10+
function TestGroq(input: string) -> string {
11+
client Groq
12+
prompt #"
13+
{{ _.role('user') }}
14+
{{ input }}
15+
"#
16+
}

integ-tests/go/baml_client/client.go

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integ-tests/go/baml_client/inlinedbaml.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integ-tests/openapi/baml_client/openapi.yaml

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integ-tests/python/baml_client/async_client.py

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integ-tests/python/baml_client/async_request.py

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)