Skip to content

Commit 3a22ca9

Browse files
authored
Update PR #2494
1 parent b212a77 commit 3a22ca9

20 files changed

Lines changed: 180 additions & 253 deletions

‎e2e/scenarios/ai-sdk-instrumentation/__snapshots__/ai-sdk-v7-auto-hook.span-tree.json‎

Lines changed: 1 addition & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎e2e/scenarios/ai-sdk-instrumentation/__snapshots__/ai-sdk-v7-auto-hook.span-tree.txt‎

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
span_tree:
22
└── ai-sdk-instrumentation-root [task]
33
metadata: {
4-
"aiSdkVersion": "7.0.105",
4+
"aiSdkVersion": "7.0.103",
55
"scenario": "ai-sdk-instrumentation",
66
"testRunId": "<run:1>",
77
"workflowVersion": "1.0.8"
@@ -88,42 +88,6 @@ span_tree:
8888
│ "prompt_tokens": 382,
8989
│ "tokens": 444
9090
│ }
91-
├── ai-sdk-evaluate-string-operation
92-
│ metadata: {
93-
│ "operation": "evaluate-string",
94-
│ "testRunId": "<run:1>"
95-
│ }
96-
│ └── evaluate [question]
97-
│ input: {
98-
│ "questions": [
99-
│ {
100-
│ "instructions": "Was the delivery successful?",
101-
│ "type": "boolean"
102-
│ }
103-
│ ],
104-
│ "state": "The package arrived intact and on time."
105-
│ }
106-
│ output: {
107-
│ "answers": [
108-
│ {
109-
│ "probability": 0.98,
110-
│ "type": "boolean"
111-
│ }
112-
│ ]
113-
│ }
114-
│ metadata: {
115-
│ "braintrust": {
116-
│ "integration_name": "ai-sdk",
117-
│ "sdk_language": "typescript"
118-
│ },
119-
│ "model": "jev-1.13.0",
120-
│ "provider": "typesafe-ai"
121-
│ }
122-
│ metrics: {
123-
│ "completion_tokens": 20,
124-
│ "prompt_tokens": 279,
125-
│ "tokens": 299
126-
│ }
12791
├── ai-sdk-generate-operation
12892
│ metadata: {
12993
│ "operation": "generate",

‎e2e/scenarios/ai-sdk-instrumentation/__snapshots__/ai-sdk-v7-explicit.span-tree.json‎

Lines changed: 1 addition & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎e2e/scenarios/ai-sdk-instrumentation/__snapshots__/ai-sdk-v7-explicit.span-tree.txt‎

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
span_tree:
22
└── ai-sdk-instrumentation-root [task]
33
metadata: {
4-
"aiSdkVersion": "7.0.105",
4+
"aiSdkVersion": "7.0.103",
55
"scenario": "ai-sdk-instrumentation",
66
"testRunId": "<run:1>",
77
"workflowVersion": "1.0.8"
@@ -88,42 +88,6 @@ span_tree:
8888
│ "prompt_tokens": 382,
8989
│ "tokens": 444
9090
│ }
91-
├── ai-sdk-evaluate-string-operation
92-
│ metadata: {
93-
│ "operation": "evaluate-string",
94-
│ "testRunId": "<run:1>"
95-
│ }
96-
│ └── evaluate [question]
97-
│ input: {
98-
│ "questions": [
99-
│ {
100-
│ "instructions": "Was the delivery successful?",
101-
│ "type": "boolean"
102-
│ }
103-
│ ],
104-
│ "state": "The package arrived intact and on time."
105-
│ }
106-
│ output: {
107-
│ "answers": [
108-
│ {
109-
│ "probability": 0.98,
110-
│ "type": "boolean"
111-
│ }
112-
│ ]
113-
│ }
114-
│ metadata: {
115-
│ "braintrust": {
116-
│ "integration_name": "ai-sdk",
117-
│ "sdk_language": "typescript"
118-
│ },
119-
│ "model": "jev-1.13.0",
120-
│ "provider": "typesafe-ai"
121-
│ }
122-
│ metrics: {
123-
│ "completion_tokens": 20,
124-
│ "prompt_tokens": 279,
125-
│ "tokens": 299
126-
│ }
12791
├── ai-sdk-generate-operation
12892
│ metadata: {
12993
│ "operation": "generate",

‎e2e/scenarios/ai-sdk-instrumentation/__snapshots__/ai-sdk-v7-latest-auto-hook.span-tree.json‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎e2e/scenarios/ai-sdk-instrumentation/__snapshots__/ai-sdk-v7-latest-auto-hook.span-tree.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ span_tree:
116116
│ "sdk_language": "typescript"
117117
│ },
118118
│ "model": "jev-1.13.0",
119-
│ "provider": "typesafe-ai"
119+
│ "provider": "typesafe"
120120
│ }
121121
│ metrics: {
122122
│ "completion_tokens": 20,

‎e2e/scenarios/ai-sdk-instrumentation/__snapshots__/ai-sdk-v7-latest-explicit.span-tree.json‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎e2e/scenarios/ai-sdk-instrumentation/__snapshots__/ai-sdk-v7-latest-explicit.span-tree.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ span_tree:
116116
│ "sdk_language": "typescript"
117117
│ },
118118
│ "model": "jev-1.13.0",
119-
│ "provider": "typesafe-ai"
119+
│ "provider": "typesafe"
120120
│ }
121121
│ metrics: {
122122
│ "completion_tokens": 20,

‎e2e/scenarios/ai-sdk-instrumentation/assertions.ts‎

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,7 @@ export function defineAISDKInstrumentationAssertions(options: {
675675
supportsDenyOutputOverrideScenario: boolean;
676676
supportsEmbedMany: boolean;
677677
supportsEvaluate?: boolean;
678+
supportsEvaluateStringModel?: boolean;
678679
supportsGenerateObject: boolean;
679680
supportsGenerateImage: boolean;
680681
supportsOutputObjectScenario: boolean;
@@ -969,35 +970,37 @@ export function defineAISDKInstrumentationAssertions(options: {
969970
tokens: expect.any(Number),
970971
});
971972

972-
const stringOperation = findLatestSpan(
973-
events,
974-
"ai-sdk-evaluate-string-operation",
975-
);
976-
const stringSpans = findChildSpans(
977-
events,
978-
"evaluate",
979-
stringOperation?.span.id,
980-
);
981-
expect(stringSpans).toHaveLength(1);
982-
expect(stringSpans[0].input).toMatchObject({
983-
state: "The package arrived intact and on time.",
984-
questions: [
985-
expect.objectContaining({ id: "positive", type: "boolean" }),
986-
],
987-
});
988-
expect(stringSpans[0].output).toMatchObject({
989-
answers: [
990-
{
991-
id: "positive",
992-
type: "boolean",
993-
probability: expect.any(Number),
994-
},
995-
],
996-
});
997-
expect(stringSpans[0].row.metadata).toMatchObject({
998-
model: expect.stringMatching(/^jev-/),
999-
provider: "typesafe-ai",
1000-
});
973+
if (options.supportsEvaluateStringModel !== false) {
974+
const stringOperation = findLatestSpan(
975+
events,
976+
"ai-sdk-evaluate-string-operation",
977+
);
978+
const stringSpans = findChildSpans(
979+
events,
980+
"evaluate",
981+
stringOperation?.span.id,
982+
);
983+
expect(stringSpans).toHaveLength(1);
984+
expect(stringSpans[0].input).toMatchObject({
985+
state: "The package arrived intact and on time.",
986+
questions: [
987+
expect.objectContaining({ id: "positive", type: "boolean" }),
988+
],
989+
});
990+
expect(stringSpans[0].output).toMatchObject({
991+
answers: [
992+
{
993+
id: "positive",
994+
type: "boolean",
995+
probability: expect.any(Number),
996+
},
997+
],
998+
});
999+
expect(stringSpans[0].row.metadata).toMatchObject({
1000+
model: expect.stringMatching(/^jev-/),
1001+
provider: "typesafe",
1002+
});
1003+
}
10011004
},
10021005
);
10031006
}

‎e2e/scenarios/ai-sdk-instrumentation/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"ai-sdk-anthropic-v6-latest": "npm:@ai-sdk/anthropic@3.0.107",
9999
"ai-sdk-cohere-v6": "npm:@ai-sdk/cohere@3.0.7",
100100
"ai-sdk-cohere-v6-latest": "npm:@ai-sdk/cohere@3.0.51",
101-
"ai-sdk-v7": "npm:ai@7.0.105",
101+
"ai-sdk-v7": "npm:ai@7.0.103",
102102
"ai-sdk-v7-latest": "npm:ai@7.0.105",
103103
"ai-sdk-openai-v7": "npm:@ai-sdk/openai@4.0.0",
104104
"ai-sdk-openai-v7-latest": "npm:@ai-sdk/openai@4.0.36",

0 commit comments

Comments
 (0)