From c5267b50a7fe8a0ed7143ab8b51d5359e438eab0 Mon Sep 17 00:00:00 2001 From: Antonio Sarosi Date: Wed, 18 Dec 2024 14:40:29 +0100 Subject: [PATCH] Remove recursion debug limit --- .../jsonish/src/deserializer/coercer/field_type.rs | 7 ------- integ-tests/typescript/test-report.html | 10 +++++++--- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/engine/baml-lib/jsonish/src/deserializer/coercer/field_type.rs b/engine/baml-lib/jsonish/src/deserializer/coercer/field_type.rs index ab4d64cda..d0f984d1e 100644 --- a/engine/baml-lib/jsonish/src/deserializer/coercer/field_type.rs +++ b/engine/baml-lib/jsonish/src/deserializer/coercer/field_type.rs @@ -27,13 +27,6 @@ impl TypeCoercer for FieldType { target: &FieldType, value: Option<&crate::jsonish::Value>, ) -> Result { - unsafe { - LIMIT += 1; - if LIMIT > 500 { - panic!("Stack Overflow Bruh {}", LIMIT); - } - } - match value { Some(crate::jsonish::Value::AnyOf(candidates, primitive)) => { log::debug!( diff --git a/integ-tests/typescript/test-report.html b/integ-tests/typescript/test-report.html index ea171ca6e..38bc00df5 100644 --- a/integ-tests/typescript/test-report.html +++ b/integ-tests/typescript/test-report.html @@ -257,9 +257,13 @@ font-size: 1rem; padding: 0 0.5rem; } -

Test Report

Started: 2024-12-09 16:43:58
Suites (1)
0 passed
1 failed
0 pending
Tests (73)
71 passed
2 failed
0 pending
Integ tests > should work for all inputs
single bool
passed
0.64s
Integ tests > should work for all inputs
single string list
passed
0.718s
Integ tests > should work for all inputs
return literal union
passed
0.462s
Integ tests > should work for all inputs
single class
passed
0.469s
Integ tests > should work for all inputs
multiple classes
passed
0.464s
Integ tests > should work for all inputs
single enum list
passed
0.443s
Integ tests > should work for all inputs
single float
passed
0.408s
Integ tests > should work for all inputs
single int
passed
0.398s
Integ tests > should work for all inputs
single literal int
passed
0.428s
Integ tests > should work for all inputs
single literal bool
passed
0.401s
Integ tests > should work for all inputs
single literal string
passed
0.33s
Integ tests > should work for all inputs
single class with literal prop
passed
0.489s
Integ tests > should work for all inputs
single class with literal union prop
passed
1.094s
Integ tests > should work for all inputs
single optional string
passed
0.378s
Integ tests > should work for all inputs
single map string to string
passed
0.676s
Integ tests > should work for all inputs
single map string to class
passed
0.819s
Integ tests > should work for all inputs
single map string to map
passed
0.505s
Integ tests > should work for all inputs
enum key in map
passed
0.775s
Integ tests > should work for all inputs
literal string union key in map
passed
0.519s
Integ tests > should work for all inputs
single literal string key in map
passed
0.603s
Integ tests > should work for all inputs
primitive union alias
passed
0.413s
Integ tests > should work for all inputs
map alias
passed
0.869s
Integ tests > should work for all inputs
alias union
passed
1.331s
Integ tests > should work for all inputs
alias pointing to recursive class
passed
0.609s
Integ tests > should work for all inputs
class pointing to alias that points to recursive class
passed
0.932s
Integ tests > should work for all inputs
recursive class with alias indirection
passed
1.223s
Integ tests
should work for all outputs
passed
5.646s
Integ tests
works with retries1
passed
1.425s
Integ tests
works with retries2
passed
2.348s
Integ tests
works with fallbacks
passed
2.297s
Integ tests
should work with image from url
passed
1.386s
Integ tests
should work with image from base 64
passed
1.239s
Integ tests
should work with audio base 64
passed
1.734s
Integ tests
should work with audio from url
passed
1.844s
Integ tests
should support streaming in OpenAI
passed
2.423s
Integ tests
should support streaming in Gemini
passed
6.634s
Integ tests
should support AWS
passed
1.69s
Integ tests
should support streaming in AWS
passed
1.518s
Integ tests
should allow overriding the region
passed
0.062s
Integ tests
should support OpenAI shorthand
passed
8.762s
Integ tests
should support OpenAI shorthand streaming
passed
19.248s
Integ tests
should support anthropic shorthand
passed
2.567s
Integ tests
should support anthropic shorthand streaming
passed
4.385s
Integ tests
should support streaming without iterating
passed
2.164s
Integ tests
should support streaming in Claude
passed
2.722s
Integ tests
should support vertex
failed
0.003s
Error: BamlError: Failed to read service account file: 
+

Test Report

Started: 2024-12-18 13:37:55
Suites (1)
0 passed
1 failed
0 pending
Tests (80)
77 passed
3 failed
0 pending
Integ tests > should work for all inputs
single bool
passed
0.468s
Integ tests > should work for all inputs
single string list
passed
0.409s
Integ tests > should work for all inputs
return literal union
passed
0.303s
Integ tests > should work for all inputs
single class
passed
0.515s
Integ tests > should work for all inputs
multiple classes
passed
0.512s
Integ tests > should work for all inputs
single enum list
passed
0.421s
Integ tests > should work for all inputs
single float
passed
0.397s
Integ tests > should work for all inputs
single int
passed
0.512s
Integ tests > should work for all inputs
single literal int
passed
0.41s
Integ tests > should work for all inputs
single literal bool
passed
0.611s
Integ tests > should work for all inputs
single literal string
passed
0.412s
Integ tests > should work for all inputs
single class with literal prop
passed
0.512s
Integ tests > should work for all inputs
single class with literal union prop
passed
0.512s
Integ tests > should work for all inputs
single optional string
passed
0.304s
Integ tests > should work for all inputs
single map string to string
passed
0.516s
Integ tests > should work for all inputs
single map string to class
passed
0.713s
Integ tests > should work for all inputs
single map string to map
passed
0.614s
Integ tests > should work for all inputs
enum key in map
passed
0.821s
Integ tests > should work for all inputs
literal string union key in map
passed
0.819s
Integ tests > should work for all inputs
single literal string key in map
passed
0.92s
Integ tests > should work for all inputs
primitive union alias
passed
0.516s
Integ tests > should work for all inputs
map alias
passed
1.122s
Integ tests > should work for all inputs
alias union
passed
1.433s
Integ tests > should work for all inputs
alias pointing to recursive class
passed
0.817s
Integ tests > should work for all inputs
class pointing to alias that points to recursive class
passed
0.905s
Integ tests > should work for all inputs
recursive class with alias indirection
passed
0.735s
Integ tests > should work for all inputs
merge alias attributes
passed
0.669s
Integ tests > should work for all inputs
return alias with merged attrs
passed
0.422s
Integ tests > should work for all inputs
alias with multiple attrs
passed
0.472s
Integ tests > should work for all inputs
simple recursive map alias
passed
1.508s
Integ tests > should work for all inputs
simple recursive map alias
passed
0.499s
Integ tests > should work for all inputs
recursive alias cycles
passed
0.525s
Integ tests > should work for all inputs
json type alias cycle
failed
2.478s
Error: expect(received).toEqual(expected) // deep equality
+
+Expected: {"bool": true, "json": {"bool": true, "list": [1, 2, 3], "number": 1, "object": {"bool": true, "list": [1, 2, 3], "number": 1, "string": "test"}, "string": "test"}, "list": [1, 2, 3], "number": 1, "object": {"bool": true, "list": [1, 2, 3], "number": 1, "string": "test"}, "string": "test"}
+Received: "{number: 1, string: test, bool: true, list: [1, 2, 3], object: {number: 1, string: test, bool: true, list: [1, 2, 3]}, json: {number: 1, string: test, bool: true, list: [1, 2, 3], object: {number: 1, string: test, bool: true, list: [1, 2, 3]}}}"
+    at Object.toEqual (/workspaces/baml/integ-tests/typescript/tests/integ-tests.test.ts:234:19)
Integ tests
should work for all outputs
passed
4.88s
Integ tests
works with retries1
passed
1.131s
Integ tests
works with retries2
passed
2.247s
Integ tests
works with fallbacks
passed
2.048s
Integ tests
should work with image from url
passed
1.741s
Integ tests
should work with image from base 64
passed
1.571s
Integ tests
should work with audio base 64
passed
1.164s
Integ tests
should work with audio from url
passed
1.708s
Integ tests
should support streaming in OpenAI
passed
2.114s
Integ tests
should support streaming in Gemini
passed
11.139s
Integ tests
should support AWS
passed
1.553s
Integ tests
should support streaming in AWS
passed
1.608s
Integ tests
should allow overriding the region
passed
0.037s
Integ tests
should support OpenAI shorthand
passed
11.054s
Integ tests
should support OpenAI shorthand streaming
passed
10.68s
Integ tests
should support anthropic shorthand
passed
3.964s
Integ tests
should support anthropic shorthand streaming
passed
3.493s
Integ tests
should support streaming without iterating
passed
2.541s
Integ tests
should support streaming in Claude
passed
1.412s
Integ tests
should support vertex
failed
0.001s
Error: BamlError: Failed to read service account file: 
 
 Caused by:
-    No such file or directory (os error 2)
Integ tests
supports tracing sync
passed
0.023s
Integ tests
supports tracing async
passed
4.933s
Integ tests
should work with dynamic types single
passed
1.024s
Integ tests
should work with dynamic types enum
passed
1.11s
Integ tests
should work with dynamic literals
passed
0.932s
Integ tests
should work with dynamic types class
passed
1.335s
Integ tests
should work with dynamic inputs class
passed
0.515s
Integ tests
should work with dynamic inputs list
passed
0.608s
Integ tests
should work with dynamic output map
passed
1.073s
Integ tests
should work with dynamic output union
passed
1.795s
Integ tests
should work with nested classes
failed
0.109s
Error: BamlError: BamlClientError: Something went wrong with the LLM client: reqwest::Error { kind: Request, url: Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("localhost")), port: Some(11434), path: "/v1/chat/completions", query: None, fragment: None }, source: hyper_util::client::legacy::Error(Connect, ConnectError("tcp connect error", Os { code: 111, kind: ConnectionRefused, message: "Connection refused" })) }
+    No such file or directory (os error 2)
Integ tests
supports tracing sync
passed
0.017s
Integ tests
supports tracing async
passed
2.316s
Integ tests
should work with dynamic types single
passed
1.481s
Integ tests
should work with dynamic types enum
passed
0.99s
Integ tests
should work with dynamic literals
passed
0.954s
Integ tests
should work with dynamic types class
passed
1.434s
Integ tests
should work with dynamic inputs class
passed
0.511s
Integ tests
should work with dynamic inputs list
passed
0.52s
Integ tests
should work with dynamic output map
passed
0.66s
Integ tests
should work with dynamic output union
passed
1.791s
Integ tests
should work with nested classes
failed
0.104s
Error: BamlError: BamlClientError: Something went wrong with the LLM client: reqwest::Error { kind: Request, url: Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("localhost")), port: Some(11434), path: "/v1/chat/completions", query: None, fragment: None }, source: hyper_util::client::legacy::Error(Connect, ConnectError("tcp connect error", Os { code: 111, kind: ConnectionRefused, message: "Connection refused" })) }
     at BamlStream.parsed [as getFinalResponse] (/workspaces/baml/engine/language_client_typescript/stream.js:58:39)
-    at Object.<anonymous> (/workspaces/baml/integ-tests/typescript/tests/integ-tests.test.ts:635:19)
Integ tests
should work with dynamic client
passed
0.493s
Integ tests
should work with 'onLogEvent'
passed
2.269s
Integ tests
should work with a sync client
passed
0.701s
Integ tests
should raise an error when appropriate
passed
1.082s
Integ tests
should raise a BAMLValidationError
passed
0.66s
Integ tests
should reset environment variables correctly
passed
2.453s
Integ tests
should use aliases when serializing input objects - classes
passed
0.94s
Integ tests
should use aliases when serializing, but still have original keys in jinja
passed
0.802s
Integ tests
should use aliases when serializing input objects - enums
passed
0.408s
Integ tests
should use aliases when serializing input objects - lists
passed
0.513s
Integ tests
constraints: should handle checks in return types
passed
0.638s
Integ tests
constraints: should handle checks in returned unions
passed
0.709s
Integ tests
constraints: should handle block-level checks
passed
2.75s
Integ tests
constraints: should handle nested-block-level checks
passed
0.612s
Integ tests
simple recursive type
passed
2.458s
Integ tests
mutually recursive type
passed
2.048s
\ No newline at end of file + at Object.<anonymous> (/workspaces/baml/integ-tests/typescript/tests/integ-tests.test.ts:687:19)
Integ tests
should work with dynamic client
passed
0.34s
Integ tests
should work with 'onLogEvent'
passed
1.79s
Integ tests
should work with a sync client
passed
0.417s
Integ tests
should raise an error when appropriate
passed
1.026s
Integ tests
should raise a BAMLValidationError
passed
0.512s
Integ tests
should reset environment variables correctly
passed
5.938s
Integ tests
should use aliases when serializing input objects - classes
passed
0.813s
Integ tests
should use aliases when serializing, but still have original keys in jinja
passed
0.824s
Integ tests
should use aliases when serializing input objects - enums
passed
0.719s
Integ tests
should use aliases when serializing input objects - lists
passed
0.407s
Integ tests
constraints: should handle checks in return types
passed
0.676s
Integ tests
constraints: should handle checks in returned unions
passed
1.07s
Integ tests
constraints: should handle block-level checks
passed
0.598s
Integ tests
constraints: should handle nested-block-level checks
passed
0.625s
Integ tests
simple recursive type
passed
3.175s
Integ tests
mutually recursive type
passed
2.458s
\ No newline at end of file