diff --git a/engine/baml-lib/baml-core/src/ir/ir_helpers/mod.rs b/engine/baml-lib/baml-core/src/ir/ir_helpers/mod.rs index b15a5a2cb..7b285773a 100644 --- a/engine/baml-lib/baml-core/src/ir/ir_helpers/mod.rs +++ b/engine/baml-lib/baml-core/src/ir/ir_helpers/mod.rs @@ -857,25 +857,14 @@ fn item_type( FieldType::Union(variants) => variants .into_iter() .find(|variant| { - let typechecks = ir + ir .distribute_type_with_meta(baml_child_value.clone(), variant.clone().to_owned()) - .is_ok(); - eprintln!( - "typecheck {:?} against {:?}: {:?}", - baml_child_value.clone().value(), - variant, - typechecks - ); - typechecks + .is_ok() }) .map(|v| v.clone()), FieldType::Tuple(_) => None, FieldType::WithMetadata { base, .. } => item_type(ir, base, baml_child_value), }; - eprintln!( - "item_type for {:?}\nitem value {:?}\nresult: {:?}", - field_type, baml_child_value, res - ); res } diff --git a/engine/baml-lib/baml-types/src/baml_value.rs b/engine/baml-lib/baml-types/src/baml_value.rs index 75e29ac5c..29af2bb97 100644 --- a/engine/baml-lib/baml-types/src/baml_value.rs +++ b/engine/baml-lib/baml-types/src/baml_value.rs @@ -654,6 +654,7 @@ impl Serialize for BamlValueWithMeta> { where S: Serializer, { + eprintln!("ABOUT TO SERIALIZE"); match self { BamlValueWithMeta::String(v, cr) => serialize_with_checks(v, cr, serializer), BamlValueWithMeta::Int(v, cr) => serialize_with_checks(v, cr, serializer), diff --git a/engine/baml-lib/jsonish/src/deserializer/deserialize_flags.rs b/engine/baml-lib/jsonish/src/deserializer/deserialize_flags.rs index fcd0b66c1..38d10312b 100644 --- a/engine/baml-lib/jsonish/src/deserializer/deserialize_flags.rs +++ b/engine/baml-lib/jsonish/src/deserializer/deserialize_flags.rs @@ -128,7 +128,7 @@ impl std::fmt::Debug for DeserializerConditions { impl std::fmt::Display for DeserializerConditions { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - if self.flags.is_empty() { + if true { return Ok(()); } diff --git a/engine/baml-lib/jsonish/src/deserializer/semantic_streaming.rs b/engine/baml-lib/jsonish/src/deserializer/semantic_streaming.rs index 10449aaa3..aa99b086e 100644 --- a/engine/baml-lib/jsonish/src/deserializer/semantic_streaming.rs +++ b/engine/baml-lib/jsonish/src/deserializer/semantic_streaming.rs @@ -45,11 +45,12 @@ pub fn validate_streaming_state( typed_baml_value.map_meta(|(flags, r#type)| (completion_state(&flags), r#type)); // dbg!(&baml_value_with_streaming_state_and_behavior); - process_node( + let res = process_node( ir, baml_value_with_streaming_state_and_behavior, allow_partials, - ) + ); + res } /// Consider a node's type, streaming state, and streaming behavior annotations. Return diff --git a/engine/baml-lib/jsonish/src/jsonish/parser/markdown_parser.rs b/engine/baml-lib/jsonish/src/jsonish/parser/markdown_parser.rs index 7de30cc0d..93f168b29 100644 --- a/engine/baml-lib/jsonish/src/jsonish/parser/markdown_parser.rs +++ b/engine/baml-lib/jsonish/src/jsonish/parser/markdown_parser.rs @@ -141,7 +141,7 @@ print("Hello, world!") let Value::AnyOf(value, _) = value else { panic!("Expected AnyOf, got {:#?}", value); }; - dbg!(&value); + // dbg!(&value); assert!(value.contains(&Value::String( "This is a test".to_string(), CompletionState::Complete diff --git a/engine/baml-runtime/src/internal/llm_client/mod.rs b/engine/baml-runtime/src/internal/llm_client/mod.rs index 6348d8a78..3d99970a6 100644 --- a/engine/baml-runtime/src/internal/llm_client/mod.rs +++ b/engine/baml-runtime/src/internal/llm_client/mod.rs @@ -34,11 +34,9 @@ pub fn parsed_value_to_response( field_type: &FieldType, allow_partials: bool, ) -> Result { - // dbg!(&baml_value); let meta_flags: BamlValueWithMeta> = baml_value.clone().into(); let baml_value_with_meta: BamlValueWithMeta> = baml_value.clone().into(); - // dbg!(&baml_value_with_meta); let value_with_response_checks: BamlValueWithMeta> = baml_value_with_meta .map_meta(|cs| { @@ -66,7 +64,6 @@ pub fn parsed_value_to_response( .zip_meta(value_with_response_checks)? .zip_meta(meta_flags)? .map_meta(|((x, y), z)| (z.clone(), y.clone(), if allow_partials { x.clone() } else { None } )); - // dbg!(&response_value); Ok(ResponseBamlValue(response_value)) } diff --git a/engine/baml-runtime/src/internal/llm_client/orchestrator/call.rs b/engine/baml-runtime/src/internal/llm_client/orchestrator/call.rs index f391a3368..b68861a09 100644 --- a/engine/baml-runtime/src/internal/llm_client/orchestrator/call.rs +++ b/engine/baml-runtime/src/internal/llm_client/orchestrator/call.rs @@ -69,11 +69,6 @@ pub async fn orchestrate( }; let sleep_duration = node.error_sleep_duration().cloned(); - // let (parsed_response, response_with_constraints) = match parsed_response { - // Some(Ok(v)) => (Some(Ok(v.clone())), Some(Ok(parsed_value_to_response(&v)))), - // Some(Err(e)) => (None, Some(Err(e))), - // None => (None, None), - // }; results.push(( node.scope, response, diff --git a/engine/baml-runtime/src/internal/prompt_renderer/mod.rs b/engine/baml-runtime/src/internal/prompt_renderer/mod.rs index aaa9f47c9..a77c43206 100644 --- a/engine/baml-runtime/src/internal/prompt_renderer/mod.rs +++ b/engine/baml-runtime/src/internal/prompt_renderer/mod.rs @@ -63,7 +63,8 @@ impl PromptRenderer { raw_string, allow_partials, )?; - parsed_value_to_response(ir, &parsed, &self.output_type, allow_partials) + let res = parsed_value_to_response(ir, &parsed, &self.output_type, allow_partials); + res } pub fn render_prompt( diff --git a/integ-tests/typescript/test-report.html b/integ-tests/typescript/test-report.html index e63f38d5d..5f5da0f20 100644 --- a/integ-tests/typescript/test-report.html +++ b/integ-tests/typescript/test-report.html @@ -257,4 +257,4 @@ font-size: 1rem; padding: 0 0.5rem; } -

Test Report

Started: 2025-01-08 16:40:45
Suites (2)
0 passed
1 failed
1 pending
Tests (91)
0 passed
1 failed
90 pending
Trace Test
traceSync with Return
pending
0s
Trace Test
traceSync with no return
pending
0s
Trace Test
traceAsync with Return
pending
0s
Trace Test
traceAsync with no return
pending
0s
Integ tests
should handle invalid AWS region gracefully
pending
0s
Integ tests
should handle invalid AWS access keygracefully
pending
0s
Integ tests
should handle invalid AWS profile gracefully
pending
0s
Integ tests
should handle invalid AWS session token gracefully
pending
0s
Integ tests > should work for all inputs
single bool
pending
0s
Integ tests > should work for all inputs
single string list
pending
0s
Integ tests > should work for all inputs
return literal union
pending
0s
Integ tests > should work for all inputs
optional list and map
pending
0s
Integ tests > should work for all inputs
single class
pending
0s
Integ tests > should work for all inputs
multiple classes
pending
0s
Integ tests > should work for all inputs
single enum list
pending
0s
Integ tests > should work for all inputs
single float
pending
0s
Integ tests > should work for all inputs
single int
pending
0s
Integ tests > should work for all inputs
single literal int
pending
0s
Integ tests > should work for all inputs
single literal bool
pending
0s
Integ tests > should work for all inputs
single literal string
pending
0s
Integ tests > should work for all inputs
single class with literal prop
pending
0s
Integ tests > should work for all inputs
single class with literal union prop
pending
0s
Integ tests > should work for all inputs
single optional string
pending
0s
Integ tests > should work for all inputs
single map string to string
pending
0s
Integ tests > should work for all inputs
single map string to class
pending
0s
Integ tests > should work for all inputs
single map string to map
pending
0s
Integ tests > should work for all inputs
enum key in map
pending
0s
Integ tests > should work for all inputs
literal string union key in map
pending
0s
Integ tests > should work for all inputs
single literal string key in map
pending
0s
Integ tests > should work for all inputs
primitive union alias
pending
0s
Integ tests > should work for all inputs
map alias
pending
0s
Integ tests > should work for all inputs
alias union
pending
0s
Integ tests > should work for all inputs
alias pointing to recursive class
pending
0s
Integ tests > should work for all inputs
class pointing to alias that points to recursive class
pending
0s
Integ tests > should work for all inputs
recursive class with alias indirection
pending
0s
Integ tests > should work for all inputs
merge alias attributes
pending
0s
Integ tests > should work for all inputs
simple recursive map alias
pending
0s
Integ tests > should work for all inputs
simple recursive map alias
pending
0s
Integ tests > should work for all inputs
recursive alias cycles
pending
0s
Integ tests > should work for all inputs
json type alias cycle
failed
4.313s
Error: Panic in async function
Integ tests
should work for all outputs
pending
0s
Integ tests
works with retries1
pending
0s
Integ tests
works with retries2
pending
0s
Integ tests
works with fallbacks
pending
0s
Integ tests
should work with image from url
pending
0s
Integ tests
should work with image from base 64
pending
0s
Integ tests
should work with audio base 64
pending
0s
Integ tests
should work with audio from url
pending
0s
Integ tests
should support streaming in OpenAI
pending
0s
Integ tests
should support streaming in Gemini
pending
0s
Integ tests
should support AWS
pending
0s
Integ tests
should support streaming in AWS
pending
0s
Integ tests
should allow overriding the region
pending
0s
Integ tests
should support OpenAI shorthand
pending
0s
Integ tests
should support OpenAI shorthand streaming
pending
0s
Integ tests
should support anthropic shorthand
pending
0s
Integ tests
should support anthropic shorthand streaming
pending
0s
Integ tests
should support streaming without iterating
pending
0s
Integ tests
should support streaming in Claude
pending
0s
Integ tests
should support azure
pending
0s
Integ tests
should support azure streaming
pending
0s
Integ tests
should fail if azure is not configured
pending
0s
Integ tests
should support vertex
pending
0s
Integ tests
supports tracing sync
pending
0s
Integ tests
supports tracing async
pending
0s
Integ tests
should work with dynamic types single
pending
0s
Integ tests
should work with dynamic types enum
pending
0s
Integ tests
should work with dynamic literals
pending
0s
Integ tests
should work with dynamic types class
pending
0s
Integ tests
should work with dynamic inputs class
pending
0s
Integ tests
should work with dynamic inputs list
pending
0s
Integ tests
should work with dynamic output map
pending
0s
Integ tests
should work with dynamic output union
pending
0s
Integ tests
should work with nested classes
pending
0s
Integ tests
should work with dynamic client
pending
0s
Integ tests
should work with 'onLogEvent'
pending
0s
Integ tests
should work with a sync client
pending
0s
Integ tests
should raise an error when appropriate
pending
0s
Integ tests
should raise a BAMLValidationError
pending
0s
Integ tests
should reset environment variables correctly
pending
0s
Integ tests
should use aliases when serializing input objects - classes
pending
0s
Integ tests
should use aliases when serializing, but still have original keys in jinja
pending
0s
Integ tests
should use aliases when serializing input objects - enums
pending
0s
Integ tests
should use aliases when serializing input objects - lists
pending
0s
Integ tests
constraints: should handle checks in return types
pending
0s
Integ tests
constraints: should handle checks in returned unions
pending
0s
Integ tests
constraints: should handle block-level checks
pending
0s
Integ tests
constraints: should handle nested-block-level checks
pending
0s
Integ tests
simple recursive type
pending
0s
Integ tests
mutually recursive type
pending
0s
should support semantic streaming
pending
0s
\ No newline at end of file +

Test Report

Started: 2025-01-09 13:22:56
Suites (2)
1 passed
0 failed
1 pending
Tests (91)
1 passed
0 failed
90 pending
Trace Test
traceSync with Return
pending
0s
Trace Test
traceSync with no return
pending
0s
Trace Test
traceAsync with Return
pending
0s
Trace Test
traceAsync with no return
pending
0s
Integ tests
should handle invalid AWS region gracefully
pending
0s
Integ tests
should handle invalid AWS access keygracefully
pending
0s
Integ tests
should handle invalid AWS profile gracefully
pending
0s
Integ tests
should handle invalid AWS session token gracefully
pending
0s
Integ tests > should work for all inputs
single bool
pending
0s
Integ tests > should work for all inputs
single string list
pending
0s
Integ tests > should work for all inputs
return literal union
pending
0s
Integ tests > should work for all inputs
optional list and map
pending
0s
Integ tests > should work for all inputs
single class
pending
0s
Integ tests > should work for all inputs
multiple classes
pending
0s
Integ tests > should work for all inputs
single enum list
pending
0s
Integ tests > should work for all inputs
single float
pending
0s
Integ tests > should work for all inputs
single int
pending
0s
Integ tests > should work for all inputs
single literal int
pending
0s
Integ tests > should work for all inputs
single literal bool
pending
0s
Integ tests > should work for all inputs
single literal string
pending
0s
Integ tests > should work for all inputs
single class with literal prop
pending
0s
Integ tests > should work for all inputs
single class with literal union prop
pending
0s
Integ tests > should work for all inputs
single optional string
pending
0s
Integ tests > should work for all inputs
single map string to string
pending
0s
Integ tests > should work for all inputs
single map string to class
pending
0s
Integ tests > should work for all inputs
single map string to map
pending
0s
Integ tests > should work for all inputs
enum key in map
pending
0s
Integ tests > should work for all inputs
literal string union key in map
pending
0s
Integ tests > should work for all inputs
single literal string key in map
pending
0s
Integ tests > should work for all inputs
primitive union alias
pending
0s
Integ tests > should work for all inputs
map alias
pending
0s
Integ tests > should work for all inputs
alias union
pending
0s
Integ tests > should work for all inputs
alias pointing to recursive class
pending
0s
Integ tests > should work for all inputs
class pointing to alias that points to recursive class
pending
0s
Integ tests > should work for all inputs
recursive class with alias indirection
pending
0s
Integ tests > should work for all inputs
merge alias attributes
pending
0s
Integ tests > should work for all inputs
simple recursive map alias
pending
0s
Integ tests > should work for all inputs
simple recursive map alias
pending
0s
Integ tests > should work for all inputs
recursive alias cycles
pending
0s
Integ tests > should work for all inputs
json type alias cycle
pending
0s
Integ tests
should work for all outputs
passed
13.654s
Integ tests
works with retries1
pending
0s
Integ tests
works with retries2
pending
0s
Integ tests
works with fallbacks
pending
0s
Integ tests
should work with image from url
pending
0s
Integ tests
should work with image from base 64
pending
0s
Integ tests
should work with audio base 64
pending
0s
Integ tests
should work with audio from url
pending
0s
Integ tests
should support streaming in OpenAI
pending
0s
Integ tests
should support streaming in Gemini
pending
0s
Integ tests
should support AWS
pending
0s
Integ tests
should support streaming in AWS
pending
0s
Integ tests
should allow overriding the region
pending
0s
Integ tests
should support OpenAI shorthand
pending
0s
Integ tests
should support OpenAI shorthand streaming
pending
0s
Integ tests
should support anthropic shorthand
pending
0s
Integ tests
should support anthropic shorthand streaming
pending
0s
Integ tests
should support streaming without iterating
pending
0s
Integ tests
should support streaming in Claude
pending
0s
Integ tests
should support azure
pending
0s
Integ tests
should support azure streaming
pending
0s
Integ tests
should fail if azure is not configured
pending
0s
Integ tests
should support vertex
pending
0s
Integ tests
supports tracing sync
pending
0s
Integ tests
supports tracing async
pending
0s
Integ tests
should work with dynamic types single
pending
0s
Integ tests
should work with dynamic types enum
pending
0s
Integ tests
should work with dynamic literals
pending
0s
Integ tests
should work with dynamic types class
pending
0s
Integ tests
should work with dynamic inputs class
pending
0s
Integ tests
should work with dynamic inputs list
pending
0s
Integ tests
should work with dynamic output map
pending
0s
Integ tests
should work with dynamic output union
pending
0s
Integ tests
should work with nested classes
pending
0s
Integ tests
should work with dynamic client
pending
0s
Integ tests
should work with 'onLogEvent'
pending
0s
Integ tests
should work with a sync client
pending
0s
Integ tests
should raise an error when appropriate
pending
0s
Integ tests
should raise a BAMLValidationError
pending
0s
Integ tests
should reset environment variables correctly
pending
0s
Integ tests
should use aliases when serializing input objects - classes
pending
0s
Integ tests
should use aliases when serializing, but still have original keys in jinja
pending
0s
Integ tests
should use aliases when serializing input objects - enums
pending
0s
Integ tests
should use aliases when serializing input objects - lists
pending
0s
Integ tests
constraints: should handle checks in return types
pending
0s
Integ tests
constraints: should handle checks in returned unions
pending
0s
Integ tests
constraints: should handle block-level checks
pending
0s
Integ tests
constraints: should handle nested-block-level checks
pending
0s
Integ tests
simple recursive type
pending
0s
Integ tests
mutually recursive type
pending
0s
should support semantic streaming
pending
0s
\ No newline at end of file