Skip to content

attempts at evaluting perf #1168

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

Draft
wants to merge 1 commit into
base: canary
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions engine/baml-runtime/src/tracing/api_wrapper/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ impl APIConfig {
Self::LocalOnly(config) => config.api_key.as_deref(),
Self::Web(config) => Some(config.api_key.as_str()),
}
.map(|s| s.trim()).filter(|s| !s.is_empty())
}

pub fn stage(&self) -> &str {
Expand Down Expand Up @@ -337,6 +338,7 @@ impl APIWrapper {

pub fn project_id(&self) -> Option<&str> {
self.config.project_id()
.map(|s| s.trim()).filter(|s| !s.is_empty())
}

pub fn session_id(&self) -> &str {
Expand Down
13 changes: 11 additions & 2 deletions integ-tests/baml_src/fiddle-examples/classify-message.baml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ enum Category {
}

function ClassifyMessage(input: string) -> Category {
client GPT4
client "openai/gpt-4o"

prompt #"
Classify the following INPUT into ONE
Expand All @@ -20,4 +20,13 @@ function ClassifyMessage(input: string) -> Category {

Response:
"#
}
}

test TestName {
functions [ClassifyMessage]
args {
input #"
hello world
"#
}
}
29 changes: 27 additions & 2 deletions integ-tests/baml_src/fiddle-examples/extract-receipt-info.baml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ class ReceiptInfo {
venue "barisa" | "ox_burger"
}

function ExtractReceiptInfo(email: string, reason: "curiosity" | "personal_finance") -> ReceiptInfo {
function ExtractReceiptInfo(email: string, idx: int) -> ReceiptInfo {
client GPT4o
prompt #"
Given the receipt below:
{{idx}}: Given the receipt below:

```
{{email}}
Expand All @@ -24,3 +24,28 @@ function ExtractReceiptInfo(email: string, reason: "curiosity" | "personal_finan
"#
}

test TestName {
functions [ExtractReceiptInfo]
args {
email #"
04/14/2024 1:05 pm
Venue: Ox Burger
Ticket: 220000082489
Register: Shop Counter
Employee: Connor
Customer: Sam
Item # Price
Guide leash (1 Pair) uni UNI
1 $34.95
The Index Town Walls
1 $35.00
Boot Punch
3 $60.00
Subtotal $129.95
Tax ($129.95 @ 9%) $11.70
Total Tax $11.70
Total $141.65
"#
reason "curiosity"
}
}
Loading
Loading