diff --git a/engine/baml-lib/llm-client/src/clients/aws_bedrock.rs b/engine/baml-lib/llm-client/src/clients/aws_bedrock.rs index db69e7ad0..c093e4f71 100644 --- a/engine/baml-lib/llm-client/src/clients/aws_bedrock.rs +++ b/engine/baml-lib/llm-client/src/clients/aws_bedrock.rs @@ -196,18 +196,14 @@ impl UnresolvedAwsBedrock { let session_token = match self.session_token.as_ref() { Some(session_token) => { let token = session_token.resolve(ctx)?; - if !token.is_empty() && !token.starts_with('$') { + if !token.is_empty() { Some(token) } else { None } } None => match ctx.get_env_var("AWS_SESSION_TOKEN") { - Ok(session_token) - if !session_token.is_empty() && !session_token.starts_with('$') => - { - Some(session_token) - } + Ok(session_token) if !session_token.is_empty() => Some(session_token), _ => None, }, }; diff --git a/integ-tests/typescript/test-report.html b/integ-tests/typescript/test-report.html index 9b2a7b338..3a65c8b39 100644 --- a/integ-tests/typescript/test-report.html +++ b/integ-tests/typescript/test-report.html @@ -257,4 +257,87 @@ font-size: 1rem; padding: 0 0.5rem; } -

Test Report

Started: 2024-12-30 14:48:03
Suites (1)
1 passed
0 failed
0 pending
Tests (4)
4 passed
0 failed
0 pending
Trace Test
traceSync with Return
passed
0.016s
Trace Test
traceSync with no return
passed
0.001s
Trace Test
traceAsync with Return
passed
0.001s
Trace Test
traceAsync with no return
passed
0.003s
\ No newline at end of file +

Test Report

Started: 2024-12-30 15:53:23
Suites (2)
0 passed
1 failed
1 pending
Tests (88)
0 passed
2 failed
86 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 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
return alias with merged attrs
pending
0s
Integ tests > should work for all inputs
alias with multiple attrs
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
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
failed
0.615s
Error: BamlError: BamlClientError: Something went wrong with the LLM client: ServiceError(
+    ServiceError {
+        source: Unhandled(
+            Unhandled {
+                source: ErrorMetadata {
+                    code: Some(
+                        "UnrecognizedClientException",
+                    ),
+                    message: Some(
+                        "The security token included in the request is invalid",
+                    ),
+                    extras: Some(
+                        {
+                            "aws_request_id": "3365eb2d-e9be-48d5-bcfb-a57127431493",
+                        },
+                    ),
+                },
+                meta: ErrorMetadata {
+                    code: Some(
+                        "UnrecognizedClientException",
+                    ),
+                    message: Some(
+                        "The security token included in the request is invalid",
+                    ),
+                    extras: Some(
+                        {
+                            "aws_request_id": "3365eb2d-e9be-48d5-bcfb-a57127431493",
+                        },
+                    ),
+                },
+            },
+        ),
+        raw: Response {
+            status: StatusCode(
+                403,
+            ),
+            headers: Headers {
+                headers: {
+                    "date": HeaderValue {
+                        _private: H0(
+                            "Mon, 30 Dec 2024 23:53:25 GMT",
+                        ),
+                    },
+                    "content-type": HeaderValue {
+                        _private: H0(
+                            "application/json",
+                        ),
+                    },
+                    "content-length": HeaderValue {
+                        _private: H0(
+                            "67",
+                        ),
+                    },
+                    "x-amzn-requestid": HeaderValue {
+                        _private: H0(
+                            "3365eb2d-e9be-48d5-bcfb-a57127431493",
+                        ),
+                    },
+                    "x-amzn-errortype": HeaderValue {
+                        _private: H0(
+                            "UnrecognizedClientException:http://internal.amazon.com/coral/com.amazon.coral.service/",
+                        ),
+                    },
+                },
+            },
+            body: SdkBody {
+                inner: Once(
+                    Some(
+                        b"{\"message\":\"The security token included in the request is invalid\"}",
+                    ),
+                ),
+                retryable: true,
+            },
+            extensions: Extensions {
+                extensions_02x: Extensions,
+                extensions_1x: Extensions,
+            },
+        },
+    },
+)
+    at BamlAsyncClient.parsed [as TestAws] (/Users/seawatts/src/github.com/boundaryml/baml/integ-tests/typescript/baml_client/async_client.ts:2460:18)
+    at Object.<anonymous> (/Users/seawatts/src/github.com/boundaryml/baml/integ-tests/typescript/tests/integ-tests.test.ts:379:17)
Integ tests
should support streaming in AWS
failed
0.507s
Error: BamlError: BamlClientError: BamlClientHttpError: LLM call failed: LLMErrorResponse { client: "AwsBedrock", model: Some("meta.llama3-8b-instruct-v1:0"), prompt: Chat([RenderedChatMessage { role: "user", allow_duplicate_role: false, parts: [Text("Write a nice short story about Dr. Pepper")] }]), request_options: {}, start_time: SystemTime { tv_sec: 1735602805, tv_nsec: 598786000 }, latency: 437.833083ms, message: "ServiceError(\n    ServiceError {\n        source: Unhandled(\n            Unhandled {\n                source: ErrorMetadata {\n                    code: Some(\n                        \"UnrecognizedClientException\",\n                    ),\n                    message: Some(\n                        \"The security token included in the request is invalid\",\n                    ),\n                    extras: Some(\n                        {\n                            \"aws_request_id\": \"2bb65d0a-cc8b-4b18-9c3c-30df3352eed7\",\n                        },\n                    ),\n                },\n                meta: ErrorMetadata {\n                    code: Some(\n                        \"UnrecognizedClientException\",\n                    ),\n                    message: Some(\n                        \"The security token included in the request is invalid\",\n                    ),\n                    extras: Some(\n                        {\n                            \"aws_request_id\": \"2bb65d0a-cc8b-4b18-9c3c-30df3352eed7\",\n                        },\n                    ),\n                },\n            },\n        ),\n        raw: Response {\n            status: StatusCode(\n                403,\n            ),\n            headers: Headers {\n                headers: {\n                    \"date\": HeaderValue {\n                        _private: H0(\n                            \"Mon, 30 Dec 2024 23:53:26 GMT\",\n                        ),\n                    },\n                    \"content-type\": HeaderValue {\n                        _private: H0(\n                            \"application/json\",\n                        ),\n                    },\n                    \"content-length\": HeaderValue {\n                        _private: H0(\n                            \"67\",\n                        ),\n                    },\n                    \"x-amzn-requestid\": HeaderValue {\n                        _private: H0(\n                            \"2bb65d0a-cc8b-4b18-9c3c-30df3352eed7\",\n                        ),\n                    },\n                    \"x-amzn-errortype\": HeaderValue {\n                        _private: H0(\n                            \"UnrecognizedClientException:http://internal.amazon.com/coral/com.amazon.coral.service/\",\n                        ),\n                    },\n                },\n            },\n            body: SdkBody {\n                inner: Once(\n                    Some(\n                        b\"{\\\"message\\\":\\\"The security token included in the request is invalid\\\"}\",\n                    ),\n                ),\n                retryable: true,\n            },\n            extensions: Extensions {\n                extensions_02x: Extensions,\n                extensions_1x: Extensions,\n            },\n        },\n    },\n)", code: NotSupported }
+    at BamlStream.parsed [as getFinalResponse] (/Users/seawatts/src/github.com/boundaryml/baml/engine/language_client_typescript/stream.js:58:39)
+    at Object.<anonymous> (/Users/seawatts/src/github.com/boundaryml/baml/integ-tests/typescript/tests/integ-tests.test.ts:389:19)
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
\ No newline at end of file