You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f892440
Browse filesBrowse the repository at this point in the historyBrowse files
use baml_runtime::{tracingv2::storage::storage::BAML_TRACER,InternalRuntimeInterface};
16
+
use baml_runtime::tracingv2::storage::storage::BAML_TRACER;
16
17
use baml_schema_build::runtime_wasm::WasmProject;
17
18
use serde_wasm_bindgen::to_value;
18
-
use wasm_bindgen::JsValue;
19
+
use wasm_bindgen::{closure::Closure,JsCast,JsValue};
19
20
use wasm_bindgen_test::*;
20
21
21
22
// instantiate logger
22
23
23
24
wasm_bindgen_test_configure!(run_in_browser);
24
25
25
-
fnsample_baml_content() -> String{
26
-
r##"
27
-
28
-
29
-
class Email {
30
-
subject string
31
-
body string
32
-
from_address string
33
-
}
34
-
35
-
enum OrderStatus {
36
-
ORDERED
37
-
SHIPPED
38
-
DELIVERED
39
-
CANCELLED
40
-
}
41
-
42
-
class OrderInfo {
43
-
order_status OrderStatus
44
-
tracking_number string?
45
-
estimated_arrival_date string?
46
-
}
47
-
48
-
client<llm> GPT4Turbo {
49
-
provider baml-openai-chat
50
-
options {
51
-
model gpt-4-1106-preview
52
-
api_key env.OPENAI_API_KEY
53
-
}
54
-
}
55
-
56
-
function GetOrderInfo(input: string) -> OrderInfo {
57
-
client GPT4Turbo
58
-
prompt #"
59
-
Extract this info from the email in JSON format:
60
-
Before you output the JSON, please explain your
61
-
reasoning step-by-step. Here is an example on how to do this:
62
-
'If we think step by step we can see that ...
63
-
therefore the output JSON is:
64
-
{
65
-
... the json schema ...
66
-
}'
67
-
"#
68
-
}
69
-
"##
70
-
.to_string()
71
-
}
72
-
73
26
// TODO: add a flag to run_test that's debug, to attach a collector on every test. The collector can be created inside run_test. Make the collector call track_function(..)
74
27
// Then we can check the baml_tracer events since they'll be kept.
Copy file name to clipboardExpand all lines: typescript/packages/playground-common/src/shared/baml-project-panel/playground-panel/prompt-preview/test-panel/components/atoms.ts
0 commit comments