diff --git a/.changeset/hip-crews-wash.md b/.changeset/hip-crews-wash.md new file mode 100644 index 000000000..02a943323 --- /dev/null +++ b/.changeset/hip-crews-wash.md @@ -0,0 +1,5 @@ +--- +"braintrust": minor +--- + +feat(ai-sdk): Add AI SDK v7 support diff --git a/e2e/config/pr-comment-scenarios.json b/e2e/config/pr-comment-scenarios.json index 0b8107e88..3151a8140 100644 --- a/e2e/config/pr-comment-scenarios.json +++ b/e2e/config/pr-comment-scenarios.json @@ -145,7 +145,8 @@ { "variantKey": "ai-sdk-v3", "label": "v3" }, { "variantKey": "ai-sdk-v4", "label": "v4" }, { "variantKey": "ai-sdk-v5", "label": "v5" }, - { "variantKey": "ai-sdk-v6", "label": "v6" } + { "variantKey": "ai-sdk-v6", "label": "v6" }, + { "variantKey": "ai-sdk-v7", "label": "v7" } ] }, { diff --git a/e2e/helpers/normalize.ts b/e2e/helpers/normalize.ts index 0db1a800d..d3d963bb1 100644 --- a/e2e/helpers/normalize.ts +++ b/e2e/helpers/normalize.ts @@ -15,6 +15,14 @@ type TokenMaps = { xacts: Map; }; +export type NormalizeOptions = { + additionalProviderIdKeys?: Iterable; +}; + +type ResolvedNormalizeOptions = { + providerIdKeys: Set; +}; + const ISO_DATE_REGEX = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/; const ISO_DATE_SUBSTRING_REGEX = /(? typeof entry === "string" ? tokenFor(tokenMaps.ids, entry, "span") - : normalizeValue(entry, tokenMaps), + : normalizeValue(entry, tokenMaps, options), ); } - return value.map((entry) => normalizeValue(entry, tokenMaps)); + return value.map((entry) => normalizeValue(entry, tokenMaps, options)); } if (value && typeof value === "object") { - return normalizeObject(value, tokenMaps); + return normalizeObject(value, tokenMaps, options); } if (typeof value === "number") { @@ -339,7 +349,7 @@ function normalizeValue( return tokenFor(tokenMaps.runs, value, "run"); } - if (currentKey && PROVIDER_ID_KEYS.has(currentKey)) { + if (currentKey && options.providerIdKeys.has(currentKey)) { return tokenFor(tokenMaps.ids, value, currentKey); } @@ -400,10 +410,28 @@ function normalizeValue( return value; } -export function normalizeForSnapshot(value: Json): Json { - return normalizeValue(value, { - ids: new Map(), - runs: new Map(), - xacts: new Map(), - }); +function resolveNormalizeOptions( + options: NormalizeOptions | undefined, +): ResolvedNormalizeOptions { + return { + providerIdKeys: new Set([ + ...PROVIDER_ID_KEYS, + ...(options?.additionalProviderIdKeys ?? []), + ]), + }; +} + +export function normalizeForSnapshot( + value: Json, + options?: NormalizeOptions, +): Json { + return normalizeValue( + value, + { + ids: new Map(), + runs: new Map(), + xacts: new Map(), + }, + resolveNormalizeOptions(options), + ); } diff --git a/e2e/helpers/span-tree.ts b/e2e/helpers/span-tree.ts index 331a9d34d..dd58bca81 100644 --- a/e2e/helpers/span-tree.ts +++ b/e2e/helpers/span-tree.ts @@ -1,6 +1,10 @@ import { matchFileSnapshot } from "./file-snapshot"; import type { CapturedLogEvent } from "./mock-braintrust-server"; -import { normalizeForSnapshot, type Json } from "./normalize"; +import { + normalizeForSnapshot, + type Json, + type NormalizeOptions, +} from "./normalize"; export type SpanTreeFields = Record; @@ -25,6 +29,10 @@ type SpanTreeJsonNode = { type?: string; } & Record; +type SpanTreeSnapshotOptions = { + normalize?: NormalizeOptions; +}; + const FIELD_ORDER = [ "span_attributes", "input", @@ -53,9 +61,14 @@ function jsonClone(value: unknown): Json | undefined { return JSON.parse(JSON.stringify(value)) as Json; } -function normalizeJson(value: unknown): Json | undefined { +function normalizeJson( + value: unknown, + options?: NormalizeOptions, +): Json | undefined { const cloned = jsonClone(value); - return cloned === undefined ? undefined : normalizeForSnapshot(cloned); + return cloned === undefined + ? undefined + : normalizeForSnapshot(cloned, options); } function sortJsonKeys(value: Json): Json { @@ -182,11 +195,14 @@ function shouldRenderField(value: Json | undefined): value is Json { return true; } -function normalizeFields(fields: SpanTreeFields): Record { +function normalizeFields( + fields: SpanTreeFields, + options?: NormalizeOptions, +): Record { const normalized: Record = {}; for (const [key, value] of Object.entries(fields)) { - const normalizedValue = normalizeJson(value); + const normalizedValue = normalizeJson(value, options); if (shouldRenderField(normalizedValue)) { normalized[key] = sortJsonKeys(normalizedValue); } @@ -298,12 +314,13 @@ function renderEntry( entry: NormalizedEntry, prefix: string, isLast: boolean, + options?: SpanTreeSnapshotOptions, ): string[] { const connector = isLast ? "└── " : "├── "; const childPrefix = `${prefix}${isLast ? " " : "│ "}`; const type = entry.event.span.type ? ` [${entry.event.span.type}]` : ""; const lines = [`${prefix}${connector}${entry.name}${type}`]; - const fields = normalizeFields(entry.fields); + const fields = normalizeFields(entry.fields, options?.normalize); for (const key of sortedFieldKeys(fields)) { lines.push( @@ -313,7 +330,12 @@ function renderEntry( entry.children.forEach((child, index) => { lines.push( - ...renderEntry(child, childPrefix, index === entry.children.length - 1), + ...renderEntry( + child, + childPrefix, + index === entry.children.length - 1, + options, + ), ); }); @@ -322,40 +344,45 @@ function renderEntry( export function formatSpanTreeSnapshot( entries: readonly (CapturedLogEvent | SpanTreeEntry)[], + options?: SpanTreeSnapshotOptions, ): string { const roots = buildEntries(entries); return [ "span_tree:", ...roots.flatMap((entry, index) => - renderEntry(entry, "", index === roots.length - 1), + renderEntry(entry, "", index === roots.length - 1, options), ), "", ].join("\n"); } -function jsonEntry(entry: NormalizedEntry): SpanTreeJsonNode { +function jsonEntry( + entry: NormalizedEntry, + options?: SpanTreeSnapshotOptions, +): SpanTreeJsonNode { const node: SpanTreeJsonNode = { name: entry.name, ...(entry.event.span.type ? { type: entry.event.span.type } : {}), children: [], }; - const fields = normalizeFields(entry.fields); + const fields = normalizeFields(entry.fields, options?.normalize); for (const key of sortedFieldKeys(fields)) { node[fieldLabel(key)] = fields[key] as Json; } - node.children = entry.children.map((child) => jsonEntry(child)); + node.children = entry.children.map((child) => jsonEntry(child, options)); return node; } export function formatSpanTreeJsonSnapshot( entries: readonly (CapturedLogEvent | SpanTreeEntry)[], + options?: SpanTreeSnapshotOptions, ): string { const roots = buildEntries(entries); return `${JSON.stringify( { - span_tree: roots.map((entry) => jsonEntry(entry)), + span_tree: roots.map((entry) => jsonEntry(entry, options)), }, null, 2, @@ -371,13 +398,14 @@ function txtSnapshotPath(jsonSnapshotPath: string): string { export async function matchSpanTreeSnapshot( entries: readonly (CapturedLogEvent | SpanTreeEntry)[], jsonSnapshotPath: string, + options?: SpanTreeSnapshotOptions, ): Promise { await matchFileSnapshot( - formatSpanTreeSnapshot(entries), + formatSpanTreeSnapshot(entries, options), txtSnapshotPath(jsonSnapshotPath), ); await matchFileSnapshot( - formatSpanTreeJsonSnapshot(entries), + formatSpanTreeJsonSnapshot(entries, options), jsonSnapshotPath, ); } diff --git a/e2e/scenarios/ai-sdk-instrumentation/__cassettes__/ai-sdk-v7.cassette.blobs/831ef4f50b23e36798adeddf0314b9154707117acf2e6a8637b8c57a8db961b0.bin b/e2e/scenarios/ai-sdk-instrumentation/__cassettes__/ai-sdk-v7.cassette.blobs/831ef4f50b23e36798adeddf0314b9154707117acf2e6a8637b8c57a8db961b0.bin new file mode 100644 index 000000000..f6c2605ca --- /dev/null +++ b/e2e/scenarios/ai-sdk-instrumentation/__cassettes__/ai-sdk-v7.cassette.blobs/831ef4f50b23e36798adeddf0314b9154707117acf2e6a8637b8c57a8db961b0.bin @@ -0,0 +1 @@ +{"object":"list","data":[{"object":"embedding","embedding":[-0.029693603515625,0.006252288818359375,-0.03509521484375,0.00760650634765625,-0.002857208251953125,-0.015716552734375,-0.0035533905029296875,0.0014905929565429688,-0.001220703125,0.007617950439453125,0.0274810791015625,-0.020660400390625,0.005039215087890625,0.016448974609375,-0.005931854248046875,0.04437255859375,0.0294647216796875,0.049285888671875,0.06573486328125,0.0092010498046875,-0.0160369873046875,-0.0011644363403320312,-0.00426483154296875,0.00943756103515625,0.032257080078125,-0.01113128662109375,0.0194549560546875,0.0390625,-0.002246856689453125,0.055999755859375,0.038482666015625,-0.01031494140625,-0.005443572998046875,-0.00653839111328125,0.020355224609375,-0.052734375,-0.0214080810546875,-0.03033447265625,0.01270294189453125,0.04833984375,-0.0067596435546875,-0.04791259765625,-0.0226287841796875,0.060546875,-0.01763916015625,-0.0248260498046875,-0.0186309814453125,-0.01374053955078125,0.0143890380859375,-0.00994110107421875,0.0458984375,-0.00934600830078125,-0.00284576416015625,0.0162200927734375,-0.0178070068359375,0.022735595703125,0.04669189453125,0.0190277099609375,0.01433563232421875,0.018402099609375,0.033172607421875,-0.013519287109375,0.0382080078125,-0.0172576904296875,-0.004840850830078125,0.036041259765625,-0.034332275390625,0.0274200439453125,0.0180816650390625,0.023193359375,0.008941650390625,0.07293701171875,-0.00952911376953125,0.0172882080078125,0.044097900390625,0.0311737060546875,0.02508544921875,0.05303955078125,0.0002739429473876953,-0.0177459716796875,0.00775146484375,0.035797119140625,0.00970458984375,-0.00867462158203125,-0.01093292236328125,-0.02435302734375,0.002471923828125,0.01416778564453125,-0.0041351318359375,-0.0293426513671875,-0.004817962646484375,-0.00484466552734375,-0.03558349609375,0.042144775390625,-0.0162506103515625,-0.017669677734375,0.01189422607421875,-0.0347900390625,-0.03802490234375,0.01824951171875,0.05499267578125,-0.020904541015625,-0.0087890625,0.041473388671875,0.01337432861328125,0.00963592529296875,0.02972412109375,-0.0006489753723144531,0.0144805908203125,-0.041778564453125,-0.051483154296875,0.0189971923828125,0.01248931884765625,0.016510009765625,-0.039306640625,0.0159759521484375,0.02313232421875,-0.01395416259765625,0.02362060546875,-0.0051116943359375,0.00428009033203125,0.0137786865234375,-0.051483154296875,0.0226287841796875,0.0196533203125,-0.016510009765625,0.00733184814453125,-0.0027942657470703125,0.005496978759765625,-0.04425048828125,0.00412750244140625,-0.0296630859375,0.021026611328125,0.043426513671875,0.037017822265625,-0.027252197265625,0.027069091796875,-0.01202392578125,0.0011720657348632812,0.01387786865234375,-0.010009765625,0.0201263427734375,0.0112457275390625,0.05078125,-0.01611328125,-0.0538330078125,-0.035980224609375,0.029815673828125,0.0479736328125,-0.04315185546875,0.01546478271484375,-0.038665771484375,0.02508544921875,0.0067138671875,0.0283355712890625,-0.062225341796875,0.004871368408203125,0.031341552734375,0.0310516357421875,0.0228118896484375,-0.045257568359375,0.042327880859375,-0.01229095458984375,-0.01806640625,-0.003322601318359375,0.01143646240234375,0.0025177001953125,-0.013397216796875,-0.002910614013671875,0.0264892578125,-0.0269775390625,0.0020904541015625,0.0540771484375,0.05462646484375,0.0157012939453125,-0.019805908203125,0.025634765625,0.047607421875,-0.0276947021484375,0.0106048583984375,-0.0244140625,0.0160369873046875,0.03216552734375,-0.005123138427734375,-0.00482940673828125,0.023162841796875,0.0021572113037109375,-0.0310516357421875,-0.0006508827209472656,0.051422119140625,0.06304931640625,-0.0350341796875,0.039398193359375,0.0007729530334472656,-0.06353759765625,-0.00445556640625,0.0120391845703125,-0.03558349609375,0.00997161865234375,-0.0082855224609375,-0.055755615234375,0.053863525390625,-0.021087646484375,0.01529693603515625,-0.00685882568359375,-0.013031005859375,-0.0257568359375,-0.053955078125,0.0595703125,0.00995635986328125,-0.0035991668701171875,-0.00554656982421875,-0.005092620849609375,-0.008697509765625,0.016326904296875,-0.00875091552734375,-0.020843505859375,0.036407470703125,0.0665283203125,-0.0186920166015625,0.0217132568359375,0.01473236083984375,0.032257080078125,0.0025196075439453125,-0.0372314453125,0.043365478515625,0.053741455078125,-0.014495849609375,-0.033843994140625,-0.0021514892578125,0.0008454322814941406,0.000759124755859375,-0.04510498046875,-0.01324462890625,-0.0218353271484375,-0.0264892578125,0.007175445556640625,-0.0186920166015625,-0.06329345703125,0.01430511474609375,-0.0178985595703125,0.0283050537109375,0.0084686279296875,-0.01349639892578125,0.005268096923828125,-0.0137176513671875,0.0196380615234375,0.03411865234375,-0.032562255859375,0.0189208984375,0.0325927734375,-0.0010929107666015625,-0.0022258758544921875,-0.0187530517578125,-0.00879669189453125,0.0276641845703125,0.0017147064208984375,-0.0003955364227294922,-0.049041748046875,-0.0006108283996582031,-0.01500701904296875,0.00524139404296875,0.00431060791015625,-0.00516510009765625,0.0095977783203125,0.00943756103515625,-0.00948333740234375,0.0108489990234375,-0.0250091552734375,-0.055145263671875,0.06256103515625,-0.007354736328125,0.000530242919921875,0.0321044921875,-0.0182952880859375,0.00975799560546875,-0.013671875,0.0005946159362792969,-0.0080718994140625,-0.01395416259765625,-0.0242462158203125,0.01947021484375,-0.0340576171875,-0.0036830902099609375,-0.017578125,-0.0211029052734375,0.039031982421875,0.054351806640625,0.004619598388671875,0.0367431640625,-0.006916046142578125,0.00891876220703125,-0.00592803955078125,0.019744873046875,-0.03875732421875,-0.006404876708984375,0.0278778076171875,0.007274627685546875,0.00289154052734375,0.01007080078125,0.0191802978515625,-0.04583740234375,-0.0018024444580078125,0.00919342041015625,-0.048614501953125,0.0784912109375,-0.00893402099609375,0.0280303955078125,0.03485107421875,0.0017671585083007812,-0.046875,-0.0160064697265625,0.04437255859375,-0.11090087890625,-0.0017719268798828125,0.0016231536865234375,-0.00923919677734375,0.040283203125,0.00966644287109375,0.00212860107421875,-0.0004906654357910156,-0.011383056640625,-0.0209503173828125,0.0019969940185546875,-0.013519287109375,0.0089569091796875,0.0301361083984375,0.03253173828125,-0.0049896240234375,0.0010986328125,0.00025844573974609375,-0.0194549560546875,0.007305145263671875,0.044342041015625,-0.01424407958984375,-0.0249481201171875,0.01165771484375,0.0249786376953125,0.037811279296875,-0.0050506591796875,-0.008819580078125,-0.01113128662109375,-0.0104522705078125,0.0156707763671875,-0.011810302734375,0.0013675689697265625,0.02374267578125,0.032135009765625,-0.01096343994140625,-0.036041259765625,-0.03466796875,-0.03729248046875,-0.0243682861328125,0.0292205810546875,-0.0302581787109375,0.002567291259765625,0.07830810546875,0.046844482421875,-0.041168212890625,0.00487518310546875,-0.029144287109375,-0.04193115234375,-0.033203125,-0.039031982421875,-0.06695556640625,0.0243072509765625,-0.0086822509765625,0.01177215576171875,-0.0221710205078125,0.045623779296875,-0.017974853515625,-0.0101165771484375,0.0523681640625,-0.05157470703125,0.00490570068359375,-0.0380859375,-0.03460693359375,0.0114593505859375,-0.0052642822265625,-0.057708740234375,-0.053863525390625,0.039703369140625,0.0263671875,-0.055816650390625,0.01544952392578125,0.032012939453125,0.003353118896484375,-0.06689453125,-0.0166168212890625,-0.0134124755859375,-0.0120697021484375,0.017791748046875,0.0113677978515625,0.0274810791015625,-0.0161285400390625,-0.021453857421875,0.0243682861328125,0.00009119510650634766,-0.052886962890625,-0.01444244384765625,-0.027374267578125,-0.0139923095703125,-0.0167236328125,-0.022918701171875,0.019317626953125,0.0340576171875,-0.016937255859375,-0.00797271728515625,-0.00978851318359375,-0.04583740234375,0.00009036064147949219,-0.080078125,0.034454345703125,-0.00510406494140625,0.007190704345703125,0.010528564453125,0.058929443359375,-0.046600341796875,0.011810302734375,0.00418853759765625,0.023712158203125,-0.00968170166015625,0.019256591796875,-0.0217132568359375,-0.0181884765625,0.006565093994140625,-0.0206298828125,-0.0345458984375,0.0195770263671875,-0.014678955078125,0.0228271484375,-0.05865478515625,0.0019989013671875,-0.036651611328125,-0.00382232666015625,0.0005340576171875,0.0016489028930664062,-0.01276397705078125,-0.022735595703125,-0.0012254714965820312,0.051910400390625,-0.024139404296875,0.003009796142578125,-0.011444091796875,-0.04400634765625,-0.026519775390625,0.04541015625,0.041473388671875,0.00965118408203125,0.01297760009765625,-0.0284576416015625,0.01171875,-0.0008630752563476562,-0.0239105224609375,0.002323150634765625,0.043121337890625,0.00373077392578125,0.0648193359375,0.0159149169921875,-0.047821044921875,0.02655029296875,0.07342529296875,-0.0037059783935546875,0.04779052734375,0.0294036865234375,0.0010004043579101562,0.0294036865234375,0.03125,-0.0283966064453125,-0.014495849609375,-0.0279388427734375,0.005413055419921875,0.021881103515625,0.04620361328125,0.01143646240234375,0.0186309814453125,-0.0533447265625,0.04168701171875,-0.03326416015625,-0.037200927734375,-0.023651123046875,0.02337646484375,-0.01325225830078125,-0.013092041015625,-0.0784912109375,-0.01152801513671875,0.0182952880859375,0.005504608154296875,-0.036407470703125,0.007091522216796875,-0.0030059814453125,-0.01953125,0.00966644287109375,-0.004993438720703125,0.0205230712890625,-0.00522613525390625,-0.04156494140625,-0.04498291015625,0.01451873779296875,0.0031909942626953125,-0.008697509765625,0.01085662841796875,0.0232391357421875,0.042266845703125,0.0282745361328125,0.070556640625,-0.003322601318359375,0.007259368896484375,-0.002223968505859375,-0.01983642578125,0.0287933349609375,0.0018215179443359375,-0.00756072998046875,-0.004375457763671875,-0.01457977294921875,-0.0015707015991210938,-0.01076507568359375,0.04107666015625,-0.0244293212890625,0.013641357421875,0.01038360595703125,0.043792724609375,-0.007076263427734375,0.0005197525024414062,0.0233154296875,0.006282806396484375,-0.033599853515625,-0.0100555419921875,0.0182037353515625,-0.0311279296875,0.0347900390625,-0.01318359375,-0.0082550048828125,0.00899505615234375,0.007293701171875,-0.0240936279296875,-0.005283355712890625,0.034210205078125,0.00798797607421875,0.0299072265625,0.0267333984375,0.011688232421875,-0.029754638671875,0.003299713134765625,-0.020965576171875,0.0014324188232421875,0.038543701171875,-0.0197601318359375,-0.0178680419921875,-0.026702880859375,-0.0011472702026367188,0.0136260986328125,-0.04693603515625,-0.0115966796875,0.01268768310546875,-0.0287933349609375,0.00980377197265625,-0.000942230224609375,-0.00209808349609375,0.00921630859375,-0.00817108154296875,0.07098388671875,0.0019855499267578125,0.006877899169921875,0.036224365234375,0.0418701171875,0.0191497802734375,-0.0103912353515625,-0.02496337890625,-0.0196533203125,0.009368896484375,0.037017822265625,-0.0185089111328125,0.0099029541015625,0.038604736328125,-0.0120391845703125,-0.0031795501708984375,-0.0017566680908203125,-0.01244354248046875,0.04595947265625,-0.0019779205322265625,0.0175018310546875,0.028289794921875,-0.00925445556640625,-0.0213165283203125,-0.00818634033203125,-0.0027599334716796875,-0.001918792724609375,-0.01007080078125,-0.0255126953125,0.030364990234375,0.001514434814453125,-0.0030727386474609375,-0.0011396408081054688,0.03668212890625,0.017181396484375,-0.043914794921875,-0.04083251953125,-0.036041259765625,0.0023784637451171875,-0.019744873046875,-0.0014486312866210938,-0.00992584228515625,-0.01213836669921875,0.0254058837890625,0.00476837158203125,0.053253173828125,-0.01454925537109375,0.00110626220703125,-0.017120361328125,0.0077362060546875,-0.0311126708984375,0.01331329345703125,-0.0035762786865234375,0.004894256591796875,0.00015103816986083984,-0.0110931396484375,0.023590087890625,-0.00012946128845214844,0.0221710205078125,0.00262451171875,0.031707763671875,-0.037384033203125,0.0060882568359375,-0.01454925537109375,0.0531005859375,0.018890380859375,0.00891876220703125,0.01534271240234375,-0.0279693603515625,0.035369873046875,-0.00714874267578125,0.044097900390625,0.00286865234375,0.0017747879028320312,-0.0233612060546875,-0.0465087890625,-0.01438140869140625,0.00331878662109375,-0.025909423828125,0.01485443115234375,0.02691650390625,0.06268310546875,-0.019073486328125,0.01108551025390625,0.00832366943359375,0.0255889892578125,0.051361083984375,0.037872314453125,-0.03045654296875,0.0132293701171875,0.0017871856689453125,-0.0162811279296875,0.01015472412109375,0.006267547607421875,0.0528564453125,-0.011962890625,0.01557159423828125,-0.042022705078125,0.01412200927734375,-0.01214599609375,-0.0003833770751953125,0.0243377685546875,-0.0321044921875,-0.005100250244140625,0.0157012939453125,0.01959228515625,0.04827880859375,0.0272979736328125,0.01120758056640625,-0.02294921875,-0.024078369140625,-0.00682830810546875,0.01287841796875,0.037445068359375,-0.03387451171875,0.0242919921875,-0.0185699462890625,-0.032012939453125,0.0247344970703125,-0.044097900390625,0.027008056640625,-0.042205810546875,0.00775146484375,-0.01312255859375,0.0207672119140625,-0.04705810546875,-0.00002086162567138672,0.00946807861328125,-0.022796630859375,-0.001911163330078125,-0.017822265625,-0.022918701171875,0.02947998046875,0.0144805908203125,-0.048858642578125,0.02301025390625,0.0194244384765625,0.0165863037109375,0.061981201171875,-0.01277923583984375,-0.0180206298828125,-0.0389404296875,-0.025390625,-0.00925445556640625,0.017822265625,-0.017486572265625,-0.0123291015625,-0.0086517333984375,0.0148468017578125,-0.0228271484375,-0.042999267578125,-0.04510498046875,-0.0075225830078125,0.007099151611328125,-0.0009489059448242188,-0.0082244873046875,0.00585174560546875,0.027618408203125,-0.006977081298828125,-0.00044655799865722656,-0.01319122314453125,-0.01983642578125,0.0007576942443847656,-0.0027294158935546875,-0.02001953125,-0.010162353515625,0.00470733642578125,0.013427734375,-0.0140838623046875,-0.03204345703125,-0.036102294921875,-0.0203094482421875,0.037139892578125,0.0091552734375,0.022613525390625,-0.00959014892578125,0.0222930908203125,-0.05511474609375,0.01125335693359375,0.0017213821411132812,-0.009918212890625,-0.01071929931640625,-0.0038814544677734375,0.0085296630859375,0.054962158203125,-0.0198516845703125,-0.0285491943359375,-0.03131103515625,-0.010528564453125,-0.00775146484375,0.002780914306640625,0.00933074951171875,-0.00494384765625,0.02655029296875,-0.0091094970703125,0.037994384765625,0.021575927734375,-0.0247802734375,-0.03839111328125,0.02630615234375,0.035675048828125,-0.016693115234375,-0.0201416015625,0.0300750732421875,-0.0182952880859375,-0.00444793701171875,0.002124786376953125,-0.00836181640625,-0.010009765625,-0.006195068359375,0.011871337890625,-0.043060302734375,0.0030670166015625,0.062255859375,0.026275634765625,-0.03021240234375,-0.006267547607421875,-0.01654052734375,-0.01441192626953125,0.0283660888671875,-0.01087188720703125,0.0156402587890625,0.01531982421875,-0.01348876953125,-0.0278167724609375,0.05560302734375,-0.044525146484375,-0.019622802734375,-0.002971649169921875,-0.0102081298828125,0.0030956268310546875,-0.0214080810546875,-0.0106964111328125,-0.0023326873779296875,-0.0257568359375,0.034820556640625,-0.004199981689453125,-0.006397247314453125,-0.0191802978515625,0.0171051025390625,0.003627777099609375,-0.0168914794921875,0.007293701171875,0.05279541015625,0.0255126953125,0.0025959014892578125,0.0182952880859375,-0.01070404052734375,-0.0017757415771484375,0.0000616908073425293,-0.0401611328125,-0.0014514923095703125,0.008209228515625,0.011566162109375,-0.01113128662109375,-0.0065460205078125,-0.047698974609375,0.037322998046875,0.022247314453125,0.0218963623046875,-0.006984710693359375,0.004993438720703125,-0.06488037109375,0.0343017578125,-0.03314208984375,0.02899169921875,0.0101776123046875,0.0004622936248779297,0.00783538818359375,-0.035736083984375,0.01192474365234375,0.011444091796875,0.00446319580078125,0.0164947509765625,0.0293426513671875,-0.010101318359375,-0.00659942626953125,-0.0218353271484375,0.006134033203125,-0.026092529296875,0.057525634765625,0.008331298828125,-0.054351806640625,0.006420135498046875,-0.01384735107421875,0.0032749176025390625,-0.00943756103515625,0.00666046142578125,0.00923919677734375,-0.03973388671875,0.0173187255859375,-0.020294189453125,0.0189971923828125,-0.0526123046875,0.037689208984375,-0.019134521484375,0.036712646484375,0.0257720947265625,-0.028289794921875,-0.0215301513671875,-0.0013914108276367188,0.0299530029296875,-0.048980712890625,-0.00582122802734375,-0.044769287109375,-0.02301025390625,-0.04052734375,-0.005565643310546875,0.055328369140625,-0.016143798828125,-0.00376129150390625,0.0190277099609375,0.00807952880859375,0.005237579345703125,0.0297088623046875,0.01401519775390625,0.017242431640625,0.01528167724609375,-0.050567626953125,-3.874301910400391e-6,-0.00545501708984375,0.026947021484375,0.0048980712890625,-0.0352783203125,-0.0018253326416015625,-0.0186920166015625,-0.0036602020263671875,0.01751708984375,0.0295867919921875,-0.009674072265625,-0.015380859375,0.0238037109375,0.019775390625,-0.0159149169921875,-0.00209808349609375,0.006374359130859375,0.004749298095703125,0.0152587890625,-0.06591796875,-0.043914794921875,0.0220489501953125,0.040130615234375,0.00868988037109375,0.0225067138671875,-0.008697509765625,-0.032073974609375,-0.0084075927734375,-0.0214080810546875,-0.001522064208984375,-0.004085540771484375,-0.04107666015625,-0.018890380859375,0.022857666015625,0.0699462890625,-0.03497314453125,0.0250091552734375,0.0292205810546875,-0.008758544921875,0.03369140625,-0.0214996337890625,0.034942626953125,-0.004695892333984375,-0.035858154296875,0.0088653564453125,-0.0101470947265625,-0.005767822265625,0.004047393798828125,0.0003993511199951172,-0.006076812744140625,0.013458251953125,0.0292205810546875,-0.01467132568359375,0.0034465789794921875,-0.01081085205078125,0.01300811767578125,-0.00955963134765625,0.001434326171875,0.01392364501953125,0.01541900634765625,0.035400390625,-0.0010480880737304688,0.0052642822265625,0.0246124267578125,-0.00414276123046875,-0.0174102783203125,0.0157318115234375,-0.01537322998046875,0.041259765625,0.02301025390625,0.024200439453125,-0.0196075439453125,-0.006893157958984375,-0.01448822021484375,0.0259552001953125,-0.01004791259765625,0.002593994140625,0.0282440185546875,-0.004119873046875,-0.007381439208984375,0.021270751953125,0.0098724365234375,0.018951416015625,-0.0098724365234375,-0.0199737548828125,-0.0013942718505859375,0.023101806640625,0.0037441253662109375,0.0250091552734375,0.0294189453125,-0.016815185546875,-0.0148468017578125,0.006320953369140625,0.05792236328125,-0.021697998046875,-0.038055419921875,0.026947021484375,-0.00004357099533081055,0.0264892578125,0.0128173828125,-0.0010890960693359375,0.01422882080078125,-0.01125335693359375,-0.01617431640625,-0.03173828125,-0.0277862548828125,-0.004199981689453125,0.03680419921875,-0.017669677734375,0.01030731201171875,-0.01233673095703125,-0.00849151611328125,0.029876708984375,-0.032806396484375,0.00913238525390625,-0.00605010986328125,0.006114959716796875,0.0222320556640625,0.033050537109375,-0.03460693359375,-0.0234375,-0.0027942657470703125,0.01120758056640625,-0.01033782958984375,-0.020233154296875,-0.0245208740234375,0.0301513671875,0.0260162353515625,-0.039886474609375,-0.013214111328125,0.0019626617431640625,-0.0294189453125,-0.017486572265625,-0.0009965896606445312,-0.0186767578125,0.0027828216552734375,0.036102294921875,0.00815582275390625,-0.009796142578125,-0.009979248046875,-0.0166015625,0.00576019287109375,-0.017669677734375,-0.027862548828125,0.0159759521484375,-0.0150604248046875,-0.0180816650390625,-0.019073486328125,0.0224456787109375,-0.009857177734375,-0.0100555419921875,0.003284454345703125,-0.04827880859375,0.045318603515625,-0.033782958984375,0.0164337158203125,0.00742340087890625,-0.02081298828125,0.00969696044921875,0.0006995201110839844,0.00843048095703125,0.0035457611083984375,-0.00695037841796875,-0.005512237548828125,0.00899505615234375,0.021026611328125,0.037628173828125,-0.0006351470947265625,0.053497314453125,-0.026580810546875,-0.045989990234375,0.002155303955078125,-0.04168701171875,-0.00646209716796875,-0.00945281982421875,-0.02001953125,-0.046600341796875,-0.018341064453125,-0.0034542083740234375,0.0109100341796875,0.03955078125,-0.01140594482421875,0.0157012939453125,-0.016571044921875,0.03289794921875,0.00975799560546875,-0.0246734619140625,-0.0183868408203125,-0.02294921875,0.03326416015625,-0.02099609375,0.014892578125,-0.01061248779296875,-0.00032973289489746094,0.007068634033203125,0.0217132568359375,-0.0255126953125,0.041534423828125,0.0280914306640625,0.04107666015625,0.02001953125,-0.00707244873046875,0.07147216796875,0.0264434814453125,-0.056488037109375,-0.0211639404296875,0.025787353515625,-0.0496826171875,-0.02508544921875,-0.03546142578125,0.01421356201171875,0.04412841796875,-0.0217742919921875,-0.0106048583984375,0.049835205078125,0.005687713623046875,-0.00865936279296875,0.01120758056640625,0.006267547607421875,0.0091400146484375,0.042327880859375,-0.0245361328125,-0.0028095245361328125,-0.0108184814453125,0.01107025146484375,0.0009617805480957031,-0.0189056396484375,0.006519317626953125,-0.038421630859375,0.0018253326416015625,-0.015289306640625,0.038909912109375,0.0306549072265625,-0.002887725830078125,-0.02459716796875,0.013275146484375,0.01399993896484375,-0.0029888153076171875,-0.01131439208984375,0.021453857421875,0.019866943359375,-0.019927978515625,0.01288604736328125,0.019500732421875,0.00716400146484375,0.0232391357421875,-0.0166778564453125,-0.020965576171875,-0.023590087890625,0.0217742919921875,0.031494140625,0.0254669189453125,-0.0089111328125,-0.017486572265625,-0.015960693359375,-0.007175445556640625,-0.01690673828125,-0.01319122314453125,-0.005855560302734375,0.05218505859375,0.043731689453125,-0.0145721435546875,-0.008575439453125,0.049713134765625,0.017242431640625,-0.033447265625,0.0213775634765625,0.043060302734375,-0.0217437744140625,0.0210113525390625,-0.00208282470703125,0.005641937255859375,0.0066986083984375,-0.026519775390625,0.01898193359375,0.01500701904296875,-0.044464111328125,0.0249786376953125,0.0226593017578125,0.0257720947265625,-0.00914764404296875,0.00954437255859375,0.049560546875,0.01800537109375,-0.0193023681640625,-0.00379180908203125,0.04083251953125,-0.0159912109375,-0.028472900390625,-0.0355224609375,0.02520751953125,0.03948974609375,0.01552581787109375,0.016937255859375,-0.005840301513671875,0.01023101806640625,-0.0285797119140625,-0.0302581787109375,0.029205322265625,0.036102294921875,0.0211334228515625,0.0272216796875,0.050262451171875,-0.005649566650390625,-0.0144805908203125,0.0008845329284667969,0.0250701904296875,-0.0008416175842285156,-0.011688232421875,0.0114898681640625,-0.0256500244140625,0.005138397216796875,0.00832366943359375,-0.039093017578125,-0.038848876953125,-0.0104522705078125,-0.02667236328125,0.0276031494140625,0.0250244140625,0.0006175041198730469,0.007038116455078125,-0.0219268798828125,0.022247314453125,0.0108184814453125,0.0062103271484375,0.05853271484375,0.0042724609375,0.0249481201171875,-0.0247344970703125,-0.006622314453125,-0.03411865234375,0.0112457275390625,-0.037078857421875,-0.018524169921875,0.0032291412353515625,-0.03143310546875,-0.00916290283203125,0.017852783203125,0.034027099609375,-0.01361846923828125,-0.00972747802734375,0.031585693359375,-0.0253448486328125,-0.0010271072387695312,-0.01215362548828125,-0.0281524658203125,-0.007396697998046875,-0.004039764404296875,0.035125732421875,0.01322174072265625,-0.0194854736328125,0.0142364501953125,-0.04754638671875,-0.019622802734375,-0.0193023681640625,0.0257568359375,0.00856781005859375,0.0276336669921875,-0.00754547119140625,-0.01280975341796875,-0.043914794921875,0.0018911361694335938,0.03936767578125,-0.0222625732421875,0.03350830078125,-0.0005059242248535156,0.03570556640625,-0.00714874267578125,-0.00952911376953125,-0.03997802734375,0.027496337890625,0.0147552490234375,-0.00455474853515625,0.006282806396484375,-0.0196075439453125,-0.01361846923828125,-0.021392822265625,0.0007505416870117188,-0.017974853515625,0.0064544677734375,-0.0028285980224609375,-0.0016756057739257812,-0.009918212890625,0.010009765625,0.046142578125,-0.01959228515625,-0.01221466064453125,0.0243377685546875,0.01666259765625,0.002071380615234375,-0.017242431640625,0.050506591796875,0.03045654296875,0.0288238525390625,-0.01258087158203125,0.007537841796875,0.005657196044921875,-0.01055145263671875,0.05718994140625,0.0073699951171875,0.0086517333984375,-0.0091400146484375,0.045623779296875,-0.00679779052734375,0.042266845703125,-0.01152801513671875,0.006084442138671875,-0.00603485107421875,0.0257110595703125,0.006839752197265625,-0.0239715576171875,-0.0007081031799316406,-0.01235198974609375,-0.00844573974609375,-0.02984619140625,-0.042572021484375,-0.00992584228515625,-0.0260772705078125,0.0233154296875,-0.0022182464599609375,0.025390625,0.025390625,-0.006938934326171875,0.0275115966796875,-0.0104827880859375,0.01390838623046875,-0.016876220703125,-0.020599365234375,0.04547119140625,-0.00899505615234375,-0.0156402587890625,-0.020294189453125,-0.01065826416015625,-0.0218353271484375,-0.01171875,-0.01436614990234375,-0.054779052734375,0.0189056396484375,-0.051483154296875,-0.046722412109375,0.01300048828125,0.0203857421875,-0.0005512237548828125,0.01059722900390625,0.019805908203125,0.0034618377685546875,0.00009673833847045898,0.019744873046875,-0.05584716796875,0.03558349609375,-0.0254058837890625,-0.04217529296875,-0.0294036865234375,-0.00960540771484375,-0.01404571533203125,0.0033588409423828125,-0.00876617431640625,-0.0003409385681152344,-0.016815185546875,0.019744873046875,0.00672149658203125,-0.045257568359375,0.022125244140625,-0.05731201171875,-0.0246429443359375,0.0352783203125,-0.034637451171875,-0.011383056640625,0.049713134765625,0.004161834716796875,0.01076507568359375,-0.01325225830078125,-0.03765869140625,0.0001271963119506836,-0.01235198974609375,-0.0184783935546875,-0.0095062255859375,0.016448974609375,0.0056915283203125,-0.036956787109375,0.0230560302734375,-0.028228759765625,-0.008148193359375,-0.0260772705078125,0.0123291015625,-0.034393310546875,-0.033599853515625,0.0210113525390625,-0.01261138916015625,-0.0113677978515625,-0.018096923828125,0.020172119140625,-0.0027294158935546875,-0.0033130645751953125,-0.0301971435546875,0.0157470703125,-0.032562255859375,0.053466796875,-0.0010614395141601562,0.0064544677734375,-0.043731689453125,0.0095062255859375,0.0012807846069335938,-0.00567626953125,0.00836181640625,-0.0024127960205078125,0.0023937225341796875,0.01412200927734375,0.050567626953125,-0.0023021697998046875,0.02734375,-0.03729248046875,-0.008758544921875,0.0017147064208984375,-0.0084228515625,0.0184783935546875,0.027557373046875,0.036773681640625,-0.03021240234375,-0.01244354248046875,0.00040340423583984375,-0.00030803680419921875,0.017578125,0.004215240478515625,0.006160736083984375,-0.0084686279296875,-0.027923583984375,0.0236053466796875,0.0095672607421875,-0.00843048095703125,0.0011854171752929688,-0.01306915283203125,-0.0256805419921875,-0.0226898193359375,0.0019893646240234375,-0.0257568359375,0.01043701171875,-0.004833221435546875,0.00861358642578125,0.03741455078125,0.01023101806640625,0.02008056640625,0.0498046875,0.03436279296875,0.003940582275390625,0.03369140625,-0.00649261474609375,0.0019855499267578125,0.00975799560546875,-0.01123809814453125,-0.01116180419921875,-0.027801513671875,0.003082275390625,0.006183624267578125,-0.0030803680419921875,-0.00018668174743652344,-0.0131988525390625,0.0095367431640625,-0.0174102783203125,-0.01776123046875,-0.05194091796875,0.0261383056640625,-0.0247039794921875,0.00560760498046875,-0.0200042724609375,-0.004375457763671875,-0.0006608963012695312,-0.0038776397705078125,-0.0026187896728515625,0.037506103515625,0.019805908203125,0.012481689453125,0.0277252197265625,-0.0310211181640625,-0.007778167724609375,-0.00533294677734375,0.00830078125,-0.005252838134765625,0.019805908203125,-0.014739990234375,0.00870513916015625,0.0014009475708007812,-0.0139617919921875,0.0243377685546875,-0.0016222000122070312,0.042144775390625,-0.00211334228515625,0.012298583984375,0.031341552734375,0.0250396728515625,-0.0260162353515625,-0.0260009765625,0.0006937980651855469,-0.01934814453125,0.01016998291015625,0.0159759521484375,-0.0167236328125,0.0163726806640625,0.0251922607421875,0.0005245208740234375,0.0158538818359375,-0.0015630722045898438,-0.023529052734375,-0.028656005859375,0.0273895263671875,0.017669677734375,0.00554656982421875,-0.003910064697265625,-0.0145111083984375,-0.0003292560577392578,0.007663726806640625,-0.0272216796875,0.0036525726318359375,-0.0101470947265625,-0.00982666015625,0.045654296875,0.0185699462890625,0.01513671875,0.0307159423828125,-0.022735595703125,0.00028443336486816406,-0.003429412841796875,-0.0244293212890625,-0.022064208984375,-0.006580352783203125,-0.00789642333984375,0.02294921875,0.020782470703125,0.0019483566284179688,-0.00928497314453125,-0.0092010498046875,-0.0171051025390625,-0.0182952880859375,0.0223846435546875,0.007068634033203125,0.016998291015625,0.03106689453125,0.0020160675048828125,-0.04119873046875,-0.00293731689453125,-0.0229949951171875,0.031829833984375,0.0133819580078125,0.0265045166015625,-0.037139892578125,-0.00786590576171875,0.01837158203125,-0.033721923828125,-0.034423828125,0.01537322998046875,-0.01531982421875,-0.0061187744140625,0.0005688667297363281,-0.0278167724609375,0.00412750244140625,-0.004215240478515625],"index":0},{"object":"embedding","embedding":[-0.0276031494140625,0.00597381591796875,-0.00803375244140625,0.0107421875,-0.0203094482421875,0.00571441650390625,-0.004535675048828125,0.034271240234375,-0.020416259765625,0.0070648193359375,-0.01284027099609375,-0.022735595703125,0.046966552734375,0.017547607421875,0.00891876220703125,0.0158538818359375,-0.0012454986572265625,0.0281219482421875,0.01419830322265625,0.03753662109375,0.01611328125,-0.006336212158203125,0.009033203125,0.0296630859375,0.038299560546875,-0.0033283233642578125,0.01250457763671875,-0.04534912109375,-0.01479339599609375,-0.034698486328125,0.0210418701171875,-0.021209716796875,0.04254150390625,0.003894805908203125,-0.01396942138671875,-0.016357421875,-0.00847625732421875,0.00850677490234375,0.004974365234375,0.01058197021484375,-0.0204620361328125,-0.045684814453125,-0.033203125,0.044097900390625,-0.06219482421875,0.00858306884765625,-0.03961181640625,-0.00615692138671875,-0.01317596435546875,-0.01239013671875,0.064208984375,-0.0032596588134765625,0.015838623046875,-0.041259765625,0.02593994140625,-0.0015211105346679688,-0.0215301513671875,0.0364990234375,0.02471923828125,0.036102294921875,0.056060791015625,-0.0002894401550292969,0.01459503173828125,-0.006664276123046875,-0.0408935546875,-0.01519012451171875,0.022308349609375,0.0236358642578125,0.01490020751953125,-0.056549072265625,0.047393798828125,0.0408935546875,0.014404296875,0.007427215576171875,0.012176513671875,0.0548095703125,0.0391845703125,0.04571533203125,0.0325927734375,-0.01346588134765625,0.005523681640625,0.022369384765625,0.01055908203125,-0.01812744140625,-0.0068359375,-0.0369873046875,0.033172607421875,0.014434814453125,0.007022857666015625,-0.0106201171875,-0.048828125,-0.03778076171875,-0.002582550048828125,0.0831298828125,0.0033130645751953125,-0.0294342041015625,-0.0186767578125,-0.0026187896728515625,-0.04736328125,0.0066375732421875,0.0616455078125,-0.025787353515625,0.044830322265625,0.01568603515625,0.0242462158203125,-0.024200439453125,0.032196044921875,0.00853729248046875,0.0103759765625,0.0253448486328125,-0.045166015625,0.04205322265625,0.053558349609375,-0.0186614990234375,-0.0565185546875,0.0183563232421875,0.0167999267578125,-0.004268646240234375,-0.028106689453125,0.0264434814453125,-0.00801849365234375,0.027435302734375,-0.0307464599609375,0.0098419189453125,0.00359344482421875,-0.0158843994140625,0.0207672119140625,0.002166748046875,-0.0220489501953125,-0.00519561767578125,0.02496337890625,0.01253509521484375,0.0031414031982421875,0.01505279541015625,0.0193939208984375,0.0055389404296875,-0.034820556640625,0.046173095703125,-0.00794219970703125,-0.01151275634765625,-0.01084136962890625,0.01491546630859375,0.0168609619140625,0.037506103515625,-0.0452880859375,0.034820556640625,-0.0304412841796875,0.0350341796875,0.043121337890625,-0.002010345458984375,0.0035190582275390625,-0.0028095245361328125,0.019317626953125,-0.0168914794921875,0.01343536376953125,-0.056549072265625,0.0017986297607421875,0.0811767578125,-0.003940582275390625,-0.00823211669921875,-0.032440185546875,0.02142333984375,0.0100250244140625,0.0125579833984375,-0.04705810546875,0.0035190582275390625,-0.01117706298828125,0.005069732666015625,-0.0033931732177734375,-0.047271728515625,-0.0169830322265625,0.0322265625,-0.00872039794921875,0.049346923828125,-0.050933837890625,0.0124969482421875,0.0302581787109375,0.01433563232421875,-0.00771331787109375,0.041259765625,0.0137939453125,0.026885986328125,-0.0135345458984375,0.0035533905029296875,-0.0178070068359375,0.019073486328125,0.0022182464599609375,-0.00925445556640625,-0.0201263427734375,0.07403564453125,-0.008026123046875,-0.0289306640625,0.032196044921875,-0.0293731689453125,-0.0237579345703125,-0.0050811767578125,0.0372314453125,-0.05950927734375,0.046417236328125,0.003631591796875,0.00437164306640625,0.004947662353515625,-0.0115203857421875,0.0260772705078125,-0.02734375,-0.001964569091796875,-0.0155792236328125,-0.022918701171875,0.024139404296875,0.0288848876953125,0.0026493072509765625,-0.0185699462890625,-0.049346923828125,-0.0295867919921875,-0.0014190673828125,0.005260467529296875,-0.03277587890625,0.019989013671875,0.0635986328125,0.0128173828125,0.00568389892578125,0.009490966796875,0.04803466796875,-0.05755615234375,0.012939453125,0.0275421142578125,0.045196533203125,-0.00989532470703125,-0.039825439453125,-0.0203704833984375,-0.0084381103515625,-0.017242431640625,-0.00969696044921875,-0.034576416015625,0.002094268798828125,-0.0002903938293457031,-0.0095062255859375,-0.0193328857421875,-0.038482666015625,-0.04608154296875,-0.041656494140625,-0.0027523040771484375,0.08740234375,-0.04534912109375,-0.0081634521484375,-0.0137176513671875,0.0037288665771484375,0.035369873046875,-0.026123046875,0.0289459228515625,-0.041046142578125,-0.0124969482421875,0.01531982421875,-0.01312255859375,0.004993438720703125,-0.0030841827392578125,-0.0216827392578125,0.0179901123046875,-0.01256561279296875,-0.0228424072265625,-0.032623291015625,-0.0276031494140625,-0.0092620849609375,-0.003574371337890625,-0.020599365234375,0.004932403564453125,0.0023651123046875,0.005558013916015625,-0.0579833984375,-0.07427978515625,0.019500732421875,0.01287078857421875,0.03228759765625,0.00010305643081665039,-0.0528564453125,-0.0162811279296875,0.02203369140625,-0.01386260986328125,0.009368896484375,-0.0013399124145507812,-0.007289886474609375,0.01465606689453125,-0.0185394287109375,-0.0306854248046875,0.0230255126953125,-0.0309600830078125,-0.0294952392578125,0.053253173828125,0.0099639892578125,0.03338623046875,0.0345458984375,0.0102081298828125,0.00933837890625,0.0263214111328125,0.035552978515625,0.007167816162109375,0.032318115234375,-0.009063720703125,-0.057647705078125,0.006927490234375,0.033294677734375,-0.059051513671875,0.0204010009765625,-0.01143646240234375,-0.037750244140625,0.07305908203125,-0.0447998046875,0.042205810546875,0.006656646728515625,0.0243988037109375,-0.052886962890625,-0.052642822265625,0.0237579345703125,-0.090087890625,0.00047206878662109375,-0.007904052734375,-0.00682830810546875,-0.00757598876953125,0.01348114013671875,-0.01218414306640625,-0.0159149169921875,-0.033233642578125,-0.0460205078125,0.0107421875,0.0004703998565673828,0.050048828125,0.033538818359375,0.034271240234375,0.037139892578125,0.01200103759765625,0.0206298828125,-0.0119476318359375,0.023529052734375,0.04534912109375,0.03216552734375,-0.0233001708984375,0.0289764404296875,0.04193115234375,0.0293121337890625,-0.0103607177734375,0.0228424072265625,0.00884246826171875,-0.0086822509765625,0.0014495849609375,0.00827789306640625,0.0345458984375,0.00958251953125,-0.004055023193359375,-0.0007348060607910156,-0.02435302734375,-0.03717041015625,-0.004734039306640625,-0.03466796875,0.0205841064453125,0.018890380859375,0.0091705322265625,0.04296875,0.04083251953125,-0.03790283203125,0.019195556640625,0.0205230712890625,-0.026397705078125,0.0092620849609375,0.005062103271484375,0.0029201507568359375,0.0018939971923828125,-0.035308837890625,0.00981903076171875,-0.01357269287109375,0.01153564453125,-0.021514892578125,-0.03814697265625,0.0235748291015625,0.003353118896484375,-0.005977630615234375,-0.015625,0.0157470703125,0.0299072265625,0.00589752197265625,-0.042877197265625,-0.052459716796875,0.03753662109375,-0.0068511962890625,-0.06939697265625,-0.03204345703125,0.00659942626953125,-0.000720977783203125,-0.042205810546875,-0.05816650390625,-0.0187835693359375,-0.0204315185546875,0.02191162109375,0.00772857666015625,0.0102081298828125,-0.0243988037109375,-0.033416748046875,-0.00809478759765625,0.02899169921875,-0.07745361328125,-0.007110595703125,-0.01751708984375,-0.046966552734375,-0.0169219970703125,-0.01519012451171875,-0.0072784423828125,0.0032634735107421875,-0.0076751708984375,0.029052734375,0.0090484619140625,-0.0455322265625,-0.01087188720703125,-0.020294189453125,0.010406494140625,0.01546478271484375,-0.01690673828125,0.0146331787109375,-0.0400390625,0.00225830078125,0.03106689453125,-0.019287109375,0.056854248046875,-0.010498046875,-0.03253173828125,-0.04217529296875,0.01922607421875,-0.02008056640625,0.0160675048828125,0.038238525390625,0.002979278564453125,-0.051025390625,0.014556884765625,-0.05303955078125,-0.01377105712890625,-0.004703521728515625,-0.023681640625,-0.0145263671875,0.02276611328125,0.0077667236328125,0.0145416259765625,-0.0057830810546875,-0.003337860107421875,-0.024200439453125,0.0242919921875,0.02471923828125,-0.03900146484375,0.03192138671875,-0.0171966552734375,0.03240966796875,0.0148773193359375,0.00237274169921875,-0.0178985595703125,-0.01192474365234375,0.00039839744567871094,-0.0318603515625,0.006153106689453125,0.0263824462890625,0.06695556640625,0.0784912109375,0.01401519775390625,-0.027587890625,-0.005825042724609375,0.043609619140625,-0.0007381439208984375,0.044097900390625,0.0015621185302734375,0.0040740966796875,-0.027618408203125,0.017333984375,-0.004596710205078125,-0.031036376953125,0.004589080810546875,0.052978515625,0.0032215118408203125,0.00415802001953125,-0.00023043155670166016,0.03289794921875,-0.0177459716796875,-0.0152740478515625,0.035552978515625,-0.060302734375,0.00489044189453125,0.06109619140625,0.0124969482421875,-0.0511474609375,-0.045257568359375,-0.037445068359375,0.00988006591796875,-0.0498046875,-0.0379638671875,-0.0509033203125,0.00611114501953125,0.0122222900390625,0.034576416015625,-0.006237030029296875,0.02734375,-0.0089263916015625,-0.0455322265625,-0.0258331298828125,-0.0015459060668945312,0.00824737548828125,-0.0248260498046875,-0.0024738311767578125,0.043975830078125,0.0440673828125,0.053924560546875,0.0224151611328125,-0.0574951171875,0.005802154541015625,-0.0028018951416015625,-0.05908203125,0.00731658935546875,-0.0215911865234375,-0.009613037109375,-0.01343536376953125,-0.025604248046875,0.0108489990234375,0.0216064453125,0.049835205078125,-0.04559326171875,0.0194244384765625,0.0219573974609375,0.01154327392578125,-0.0047454833984375,-0.00589752197265625,-0.005725860595703125,0.01023101806640625,-0.031829833984375,-0.0032711029052734375,0.00762939453125,-0.02392578125,0.026275634765625,-0.001926422119140625,-0.0022792816162109375,-0.048828125,-0.0203094482421875,-0.038482666015625,0.019378662109375,0.032257080078125,-0.0257415771484375,-0.006542205810546875,0.038055419921875,0.026702880859375,-0.02911376953125,0.0148162841796875,-0.0256805419921875,0.01059722900390625,0.00872802734375,0.00007730722427368164,0.0036029815673828125,-0.005950927734375,0.0228729248046875,-0.00560760498046875,-0.01403045654296875,-0.00518798828125,0.0011968612670898438,-0.01314544677734375,0.03326416015625,0.0178375244140625,0.0077056884765625,-0.0102081298828125,-0.005580902099609375,0.046295166015625,-0.0292205810546875,-0.00012922286987304688,0.0005135536193847656,0.05389404296875,-0.0100555419921875,-0.005802154541015625,-0.0060882568359375,-0.015716552734375,0.01111602783203125,0.00830078125,0.0138397216796875,0.0232086181640625,-0.016326904296875,0.01274871826171875,0.0034236907958984375,-0.006916046142578125,0.009765625,0.06097412109375,-0.02593994140625,-0.0008983612060546875,0.028472900390625,-0.0026950836181640625,0.0165252685546875,-0.01338958740234375,0.0007648468017578125,0.0028228759765625,-0.005645751953125,-0.0202789306640625,0.036834716796875,-0.0149383544921875,0.040252685546875,0.00836944580078125,0.05181884765625,-0.0013103485107421875,-0.026123046875,-0.0226898193359375,-0.040496826171875,0.0161590576171875,-0.001983642578125,-0.0086669921875,0.01175689697265625,-0.005279541015625,0.0322265625,-0.0063934326171875,0.05731201171875,-0.0180511474609375,-0.0137176513671875,-0.019989013671875,-0.0234832763671875,-0.024078369140625,-0.0029697418212890625,-0.00921630859375,-0.01413726806640625,0.0108489990234375,-0.00902557373046875,0.006130218505859375,0.0008502006530761719,0.033782958984375,0.026397705078125,-0.008544921875,0.00743865966796875,0.0015745162963867188,-0.0093231201171875,0.03179931640625,-0.0017852783203125,-0.0190582275390625,0.007465362548828125,0.0032482147216796875,0.024993896484375,-0.0036163330078125,0.0440673828125,-0.02838134765625,0.004364013671875,-0.01554107666015625,-0.023681640625,0.01129913330078125,-0.00461578369140625,-0.032379150390625,-0.004634857177734375,0.0036449432373046875,0.045501708984375,-0.05303955078125,0.04205322265625,0.00907135009765625,0.00019252300262451172,0.049835205078125,-0.00553131103515625,-0.0020427703857421875,0.01045989990234375,-0.01311492919921875,-0.0063934326171875,-0.002849578857421875,-0.006103515625,0.02093505859375,-0.033111572265625,0.0269927978515625,-0.030029296875,-0.006832122802734375,-0.007781982421875,0.019287109375,0.0135498046875,-0.0235748291015625,0.009979248046875,0.0107421875,0.00989532470703125,0.0242919921875,-0.0396728515625,-0.01157379150390625,-0.004062652587890625,0.0011358261108398438,0.0224151611328125,-0.045196533203125,0.061798095703125,-0.0137939453125,0.0178680419921875,-0.0243682861328125,-0.053436279296875,-0.0001188516616821289,-0.01342010498046875,0.01372528076171875,-0.032135009765625,0.0009021759033203125,0.02294921875,0.0011987686157226562,-0.0117340087890625,-0.0088043212890625,0.0107421875,0.007022857666015625,-0.0149993896484375,-0.00006276369094848633,-0.0035610198974609375,0.046722412109375,0.0281524658203125,-0.031982421875,0.038116455078125,0.016021728515625,-0.017547607421875,0.0002999305725097656,0.0076446533203125,-0.005260467529296875,-0.04449462890625,-0.06036376953125,-0.007236480712890625,-0.0160064697265625,-0.01947021484375,-0.0009965896606445312,-0.020050048828125,-0.0083770751953125,-0.008544921875,0.0139923095703125,-0.038299560546875,-0.0174102783203125,0.02191162109375,-0.0310821533203125,0.0272216796875,0.022918701171875,0.0269012451171875,0.0096435546875,0.0179290771484375,-0.00760650634765625,-0.0271148681640625,-0.002658843994140625,0.01462554931640625,0.01145172119140625,0.01336669921875,0.0216522216796875,-0.00574493408203125,-0.05145263671875,0.0312042236328125,0.0036773681640625,-0.03875732421875,0.0286712646484375,0.0169525146484375,0.0439453125,-0.0006585121154785156,-0.031097412109375,-0.0377197265625,-0.01554107666015625,-0.01540374755859375,-0.03076171875,-0.013031005859375,0.01372528076171875,-0.0198974609375,0.0125885009765625,0.0120697021484375,-0.01312255859375,-0.03253173828125,-0.002483367919921875,0.0014448165893554688,0.004062652587890625,0.015777587890625,-0.018707275390625,-0.0019121170043945312,-0.004669189453125,0.020751953125,-0.00811004638671875,0.00421905517578125,0.0033588409423828125,-0.0222625732421875,0.0266265869140625,0.0225830078125,0.0021076202392578125,0.01229095458984375,-0.0023136138916015625,-0.06585693359375,-0.01076507568359375,0.035858154296875,0.01264190673828125,-0.0219879150390625,-0.032073974609375,-0.00490570068359375,-0.0100250244140625,0.0826416015625,0.0053253173828125,0.0005230903625488281,0.035736083984375,-0.019500732421875,-0.042694091796875,0.032623291015625,-0.035308837890625,-0.0250244140625,0.0097503662109375,-0.02301025390625,-0.0045928955078125,0.0229034423828125,-0.0251312255859375,0.0155181884765625,-0.0258941650390625,-0.0335693359375,0.01032257080078125,-0.0186920166015625,-0.0225830078125,-0.0084075927734375,0.01499176025390625,0.0214080810546875,-0.0048675537109375,-0.0277557373046875,0.009033203125,0.0193328857421875,0.00020241737365722656,-0.0176239013671875,-0.01540374755859375,-0.0036296844482421875,-0.03961181640625,0.01319122314453125,-0.007770538330078125,-0.0460205078125,-0.0165557861328125,0.01187896728515625,0.0054779052734375,-0.020660400390625,0.002349853515625,0.020416259765625,-0.03082275390625,0.01512908935546875,-0.04327392578125,0.0176239013671875,0.0093841552734375,0.005889892578125,-0.006572723388671875,-0.024627685546875,-0.02886962890625,0.032989501953125,-0.04425048828125,-0.0017108917236328125,-0.0052642822265625,0.036468505859375,-0.0151519775390625,-0.025299072265625,-0.006500244140625,-0.012237548828125,0.0201263427734375,0.0263824462890625,0.011566162109375,0.004077911376953125,0.01311492919921875,-0.01325225830078125,0.0098724365234375,-0.026123046875,0.0400390625,-0.0068511962890625,-0.0592041015625,-0.00904083251953125,-0.0005679130554199219,0.008056640625,-0.03570556640625,-0.02740478515625,0.0081024169921875,0.002285003662109375,-0.0293731689453125,-0.0282135009765625,0.0018987655639648438,-0.0127716064453125,-0.007289886474609375,0.037811279296875,0.058502197265625,-0.0026416778564453125,-0.031280517578125,-0.01031494140625,-0.00966644287109375,0.033050537109375,-0.0304107666015625,0.0169525146484375,-0.026702880859375,0.0096588134765625,-0.002239227294921875,0.025848388671875,-0.001529693603515625,-0.0220794677734375,-0.0116424560546875,0.0321044921875,0.003749847412109375,0.0025787353515625,0.027069091796875,0.012420654296875,-0.05731201171875,0.042236328125,-0.06341552734375,0.0052337646484375,0.0190582275390625,0.0199432373046875,-0.0017642974853515625,-0.01026153564453125,-0.03973388671875,-0.0263214111328125,0.00750732421875,0.029327392578125,0.0281982421875,-0.037200927734375,0.02557373046875,0.0061798095703125,-0.007366180419921875,0.01904296875,0.012481689453125,0.01418304443359375,0.00960540771484375,0.022369384765625,0.0073699951171875,-0.022918701171875,0.00786590576171875,0.023468017578125,0.0230865478515625,0.00366973876953125,0.0239715576171875,-0.0282745361328125,0.0208587646484375,-0.001316070556640625,0.01399993896484375,-0.008636474609375,-0.01316070556640625,-0.0102996826171875,-0.0011873245239257812,0.010772705078125,-0.006557464599609375,-0.01389312744140625,0.023834228515625,-0.00524139404296875,0.042755126953125,-0.02825927734375,0.0273895263671875,-0.04132080078125,0.01416778564453125,-0.0166015625,-0.020355224609375,-0.031829833984375,-0.002521514892578125,0.0004220008850097656,0.0027408599853515625,0.0166015625,-0.0048980712890625,-0.006336212158203125,-0.01264190673828125,0.0292816162109375,0.0011386871337890625,-0.0036182403564453125,0.004474639892578125,-0.0030689239501953125,0.022796630859375,0.032989501953125,-0.020111083984375,0.004695892333984375,0.0222015380859375,0.0181427001953125,-0.0297088623046875,0.0419921875,0.01457977294921875,0.04180908203125,-0.00559234619140625,-0.0282745361328125,-0.0222930908203125,0.025177001953125,-0.0075531005859375,0.0120849609375,-0.021759033203125,0.007068634033203125,-0.01403045654296875,0.03204345703125,0.035919189453125,0.0263519287109375,-0.0113677978515625,0.00518035888671875,-0.040802001953125,-0.00799560546875,-0.00795745849609375,-0.022979736328125,-0.028228759765625,0.0010633468627929688,0.018585205078125,0.0163421630859375,-0.006229400634765625,-0.02667236328125,0.016448974609375,-0.034088134765625,-0.01308441162109375,-0.0262298583984375,0.013671875,0.01611328125,0.031585693359375,-0.004398345947265625,0.043853759765625,0.0025730133056640625,-0.03375244140625,0.0170745849609375,0.005588531494140625,-0.0233612060546875,0.032806396484375,-0.032928466796875,-0.01263427734375,-0.05047607421875,-0.017852783203125,0.0002999305725097656,-0.0172119140625,0.028839111328125,-0.00940704345703125,-0.021514892578125,-0.03314208984375,0.00450897216796875,0.004913330078125,-0.011505126953125,-0.017730712890625,0.00522613525390625,-0.01044464111328125,-0.0056304931640625,-0.025726318359375,-0.01030731201171875,0.000141143798828125,-0.0177459716796875,0.0199432373046875,0.02783203125,0.0006208419799804688,0.0256195068359375,-0.009857177734375,-0.03076171875,0.021697998046875,0.0760498046875,0.057769775390625,-0.033111572265625,0.045074462890625,0.0137481689453125,0.0119476318359375,0.007106781005859375,-0.01214599609375,0.0283966064453125,0.03729248046875,0.0010881423950195312,0.0081634521484375,0.026947021484375,0.020111083984375,-0.00656890869140625,0.0257415771484375,-0.049652099609375,0.042572021484375,0.00981903076171875,0.01548004150390625,0.05078125,-0.035064697265625,0.0182037353515625,0.00782012939453125,-0.008026123046875,-0.0006632804870605469,0.009490966796875,-0.0030040740966796875,-0.01499176025390625,0.0266571044921875,0.0247344970703125,0.0284271240234375,0.0367431640625,-0.0239105224609375,0.003936767578125,0.0025005340576171875,-0.01422119140625,-0.0006680488586425781,-0.04022216796875,-0.036407470703125,-0.0313720703125,0.01030731201171875,0.00152587890625,-0.03411865234375,0.01300048828125,-0.01727294921875,-0.00595855712890625,-0.01374053955078125,0.0113983154296875,-0.036163330078125,-0.035980224609375,-0.0013408660888671875,0.005481719970703125,0.032470703125,-0.019287109375,0.05072021484375,-0.0094451904296875,0.0292510986328125,0.01641845703125,0.020355224609375,-0.01404571533203125,0.0276031494140625,0.0101165771484375,-0.000055849552154541016,-0.01464080810546875,0.04168701171875,0.02850341796875,-0.0265045166015625,-0.044952392578125,-0.0309295654296875,-0.00738525390625,-0.017669677734375,-0.006511688232421875,-0.0291595458984375,0.00968170166015625,0.054901123046875,-0.0020694732666015625,-0.0131072998046875,0.004180908203125,0.0062408447265625,-0.0245513916015625,-0.0102996826171875,0.003307342529296875,-0.022308349609375,0.0165252685546875,0.004009246826171875,-0.017547607421875,0.042083740234375,0.023406982421875,-0.049591064453125,0.0033702850341796875,0.007068634033203125,-0.01305389404296875,0.012542724609375,-0.01103973388671875,-0.002765655517578125,0.0638427734375,0.0129547119140625,0.0255126953125,0.041229248046875,-0.01519012451171875,-0.01953125,0.00821685791015625,-0.00949859619140625,0.03448486328125,-0.00882720947265625,-0.005035400390625,0.0193023681640625,0.017669677734375,-0.01288604736328125,0.0092620849609375,-0.001102447509765625,0.0027484893798828125,0.0172576904296875,-0.0173797607421875,0.0006561279296875,0.0438232421875,-0.01629638671875,0.03375244140625,-0.005008697509765625,-0.03082275390625,-0.0254364013671875,0.01029205322265625,0.0418701171875,-0.002864837646484375,-0.00262451171875,-0.007106781005859375,0.057281494140625,0.04241943359375,-0.003719329833984375,-0.0233917236328125,0.06158447265625,-0.036956787109375,-0.022796630859375,-0.0003299713134765625,0.0163726806640625,0.0269927978515625,-0.05517578125,0.0013637542724609375,0.0146026611328125,0.026336669921875,0.00457763671875,-0.0062255859375,0.0114593505859375,-0.0207672119140625,0.0204010009765625,0.013824462890625,-0.00006508827209472656,-0.0250701904296875,0.033966064453125,0.038238525390625,0.00429534912109375,-0.040496826171875,-0.0310821533203125,0.05224609375,0.01543426513671875,0.0025196075439453125,0.016632080078125,-0.00516510009765625,0.0249481201171875,-0.046234130859375,-0.01171112060546875,0.004306793212890625,0.0120849609375,0.05364990234375,0.01523590087890625,-0.0060577392578125,-0.0860595703125,-0.02093505859375,0.007965087890625,0.002246856689453125,0.011627197265625,0.004337310791015625,-0.034210205078125,-0.00942230224609375,-0.00809478759765625,0.0418701171875,-0.0021762847900390625,-0.05126953125,-0.017822265625,-0.0088653564453125,-0.034759521484375,-0.00539398193359375,0.03582763671875,0.0277252197265625,-0.0007104873657226562,0.023345947265625,0.003570556640625,0.0065155029296875,0.03973388671875,0.0066070556640625,-0.00890350341796875,0.008331298828125,-0.01509857177734375,-0.0193328857421875,0.0176849365234375,-0.0128021240234375,-0.0254669189453125,-0.0193634033203125,-0.01556396484375,-0.008270263671875,0.0179290771484375,-0.017730712890625,0.0276641845703125,-0.0269317626953125,-0.0040740966796875,-0.01464080810546875,-0.0004687309265136719,-0.01187896728515625,0.02880859375,-0.015289306640625,-0.01275634765625,0.02294921875,0.005645751953125,-0.0229034423828125,-0.0176849365234375,-0.0158538818359375,0.01227569580078125,-0.030303955078125,0.01039886474609375,0.021759033203125,-0.00572967529296875,0.040069580078125,-0.0193634033203125,-0.048492431640625,0.0482177734375,-0.0116729736328125,0.01151275634765625,0.019927978515625,-0.0080413818359375,0.012481689453125,-0.00482940673828125,-0.0125885009765625,-0.01361083984375,-0.026336669921875,0.02716064453125,0.017547607421875,0.0019931793212890625,-0.01479339599609375,-0.0135040283203125,-0.0224609375,-0.00421905517578125,-0.03338623046875,-0.0140838623046875,-0.0137939453125,0.01397705078125,-0.03765869140625,0.03204345703125,-0.009429931640625,0.021820068359375,0.00443267822265625,0.030487060546875,-0.0003521442413330078,0.0120849609375,-0.031829833984375,0.04547119140625,-0.002704620361328125,-0.003231048583984375,-0.00853729248046875,-0.006988525390625,-0.01605224609375,-0.00402069091796875,0.0294342041015625,0.004398345947265625,0.025848388671875,-0.0026416778564453125,0.0090789794921875,-0.009490966796875,0.00983428955078125,-0.03662109375,-0.0072021484375,0.00507354736328125,-0.01128387451171875,0.032745361328125,0.0028171539306640625,0.026947021484375,0.00811004638671875,-0.01096343994140625,-0.01165771484375,-0.029266357421875,0.0060272216796875,-0.001102447509765625,-0.029144287109375,-0.0201263427734375,0.0225677490234375,0.0213165283203125,-0.0133514404296875,0.048126220703125,-0.0189971923828125,-0.05853271484375,-0.033477783203125,-0.01446533203125,0.0288848876953125,-0.041259765625,-0.0548095703125,-0.00940704345703125,-0.019622802734375,0.0047454833984375,-0.03509521484375,-0.0226287841796875,-0.029327392578125,0.038238525390625,-0.0027751922607421875,-0.04779052734375,0.0355224609375,0.01447296142578125,0.01421356201171875,0.0055084228515625,0.00298309326171875,-0.0176849365234375,0.001338958740234375,0.0012731552124023438,-0.0428466796875,0.007808685302734375,-0.00771331787109375,-0.001007080078125,-0.0056610107421875,-0.00719451904296875,-0.0259857177734375,0.0235595703125,-0.009765625,0.0062408447265625,0.01438140869140625,0.031494140625,0.009490966796875,-0.012786865234375,0.01421356201171875,-0.047027587890625,-0.00366973876953125,0.0308685302734375,-0.007366180419921875,0.01947021484375,0.0205535888671875,0.0004658699035644531,0.0263214111328125,-0.0004673004150390625,0.01404571533203125,0.01611328125,0.01396942138671875,-0.00716400146484375,-0.018646240234375,0.005725860595703125,-0.00864410400390625,-0.0033550262451171875,0.016357421875,0.0027599334716796875,0.00913238525390625,-0.00743865966796875,0.028839111328125,0.00261688232421875,-0.0049591064453125,0.0197601318359375,-0.0244140625,0.00262451171875,-0.010162353515625,-0.0005154609680175781,0.0023860931396484375,-0.018707275390625,-0.0283050537109375,0.0301055908203125,-0.013946533203125,0.06622314453125,-0.0226898193359375,-0.0244140625,-0.0277557373046875,-0.006786346435546875,0.0005354881286621094,-0.019744873046875,-0.03582763671875,-0.03375244140625,-0.028839111328125,0.035552978515625,0.05462646484375,0.0040130615234375,0.004924774169921875,-0.0191192626953125,0.0024280548095703125,0.021270751953125,-0.0120391845703125,0.0282135009765625,0.0045166015625,0.01332855224609375,0.040191650390625,-0.00826263427734375,0.004730224609375,0.004833221435546875,0.01386260986328125,0.0293121337890625,0.0205841064453125,0.002429962158203125,-0.029022216796875,-0.0312042236328125,-0.007904052734375,0.03839111328125,-0.0035552978515625,0.00200653076171875,-0.0019817352294921875,-0.0010461807250976562,0.0187530517578125,-0.0204925537109375,0.0140228271484375,-0.0243988037109375,-0.0190582275390625,-0.0021038055419921875,-0.00801849365234375,-0.0094451904296875,0.0718994140625,-0.0038661956787109375,0.0158538818359375,0.0325927734375,0.0006241798400878906,0.0567626953125,-0.00885772705078125,-0.0037822723388671875,-0.00995635986328125,-0.0227508544921875,0.002719879150390625,0.0049285888671875,-0.02093505859375,-0.037384033203125,-0.033782958984375,-0.0181884765625,-0.03558349609375,0.003993988037109375,0.0037841796875,-0.0110931396484375,-0.0149078369140625,-0.005252838134765625,-0.0200653076171875,0.0199127197265625,-0.0299072265625,-0.03515625,-0.0101470947265625,0.00557708740234375,-0.006252288818359375,0.01523590087890625,0.01593017578125,-0.00553131103515625,-0.023193359375,0.00457763671875,-0.0380859375,-0.009307861328125,0.03179931640625,-0.00745391845703125,0.004055023193359375,0.0033588409423828125,0.0258941650390625,0.01256561279296875,0.005893707275390625,0.012420654296875,0.007610321044921875,-0.03399658203125,0.0008511543273925781,0.00971221923828125,-0.026519775390625,-0.04150390625,0.00804901123046875,-0.0062713623046875,-0.002960205078125,0.005809783935546875,0.004833221435546875,0.002658843994140625,0.0105743408203125,0.0217437744140625,-0.0191802978515625,0.018096923828125,-0.028228759765625,-0.050537109375,-0.0137939453125,0.0014362335205078125,-0.01470947265625,0.000049054622650146484,-0.0226898193359375,-0.0350341796875,-0.004940032958984375,0.0094451904296875,0.033660888671875,-0.0206298828125,0.0065460205078125,0.046783447265625,-0.00516510009765625,0.01416778564453125,0.0308685302734375,-0.0294647216796875,-0.036895751953125,-0.0298614501953125,0.03973388671875,0.015869140625,0.0122528076171875,0.00885009765625,0.0193023681640625,0.0175933837890625,-0.0258941650390625,-0.005615234375,-0.0237884521484375,-0.013885498046875,-0.01120758056640625,0.031402587890625,0.006366729736328125,0.00010627508163452148,0.0699462890625,0.01125335693359375,-0.018798828125,-0.00640106201171875,-0.01247406005859375,-0.01401519775390625,0.0006556510925292969,0.0053863525390625,-0.0233917236328125,-0.0540771484375,0.02117919921875,0.01708984375,-0.018707275390625,0.01007843017578125,0.009033203125,-0.017974853515625,-0.0224609375,-0.01107025146484375,-0.0188446044921875,0.0070648193359375],"index":1},{"object":"embedding","embedding":[-0.109375,-0.041168212890625,-0.00209808349609375,0.0236663818359375,-0.031402587890625,0.01515960693359375,-0.00433349609375,0.003223419189453125,-0.0031375885009765625,-0.03753662109375,0.0133056640625,0.0272216796875,0.0340576171875,-0.0050506591796875,0.01294708251953125,0.041778564453125,-0.0038242340087890625,0.050750732421875,0.019744873046875,0.00460052490234375,-0.0187835693359375,0.031707763671875,-0.00287628173828125,-0.00405120849609375,0.05450439453125,-0.037109375,-0.0191497802734375,0.02001953125,0.012451171875,-0.0321044921875,-0.00786590576171875,-0.036407470703125,0.0053863525390625,0.0006589889526367188,-0.0269012451171875,-0.0019702911376953125,0.042266845703125,-0.0302276611328125,0.006134033203125,0.0036334991455078125,-0.0274200439453125,-0.0114288330078125,-0.006626129150390625,0.082275390625,-0.03704833984375,0.0020542144775390625,-0.016204833984375,0.039764404296875,-0.0162353515625,-0.017486572265625,0.0228729248046875,-0.02874755859375,0.0213470458984375,0.0036716461181640625,-0.01520538330078125,-0.00858306884765625,0.082275390625,-0.0196075439453125,0.00635528564453125,0.006847381591796875,0.007328033447265625,-0.00823974609375,0.0274200439453125,-0.0010509490966796875,0.005878448486328125,0.0355224609375,0.0254669189453125,0.054931640625,0.04034423828125,-0.010284423828125,0.0228118896484375,0.06689453125,0.0032176971435546875,0.061492919921875,0.003978729248046875,0.0599365234375,-0.00018668174743652344,0.0155181884765625,0.0263671875,0.0152740478515625,-0.003875732421875,0.00428009033203125,0.03509521484375,-0.0008482933044433594,0.0279388427734375,-0.0244598388671875,0.02374267578125,0.0247039794921875,0.0273590087890625,-0.0491943359375,-0.005619049072265625,0.01155853271484375,0.01197052001953125,0.040130615234375,0.017913818359375,0.01593017578125,0.0155181884765625,-0.018035888671875,-0.0693359375,0.001392364501953125,0.030792236328125,-0.038665771484375,-0.0020198822021484375,0.018707275390625,0.004955291748046875,-0.0245819091796875,0.01145172119140625,0.0162506103515625,0.024261474609375,0.02923583984375,-0.032257080078125,-0.00864410400390625,0.0015535354614257812,-0.006103515625,-0.053924560546875,0.0042572021484375,-0.01531219482421875,-0.0294342041015625,0.03948974609375,-0.00182342529296875,-0.0267181396484375,0.03955078125,0.01093292236328125,0.0005817413330078125,0.003528594970703125,0.018035888671875,-0.00980377197265625,0.00978851318359375,0.0012912750244140625,-0.008331298828125,0.049285888671875,0.0355224609375,0.0168609619140625,0.014495849609375,-0.0003895759582519531,0.00012755393981933594,-0.0097503662109375,0.020477294921875,0.01129150390625,0.032806396484375,0.01004791259765625,-0.0125885009765625,0.0114593505859375,0.044586181640625,0.0032100677490234375,-0.01395416259765625,-0.00208282470703125,0.031280517578125,0.02313232421875,0.0166778564453125,-0.0094451904296875,-0.0135345458984375,0.032562255859375,-0.0269012451171875,-0.02923583984375,-0.0017242431640625,-0.01273345947265625,0.07257080078125,0.01476287841796875,0.048126220703125,-0.04498291015625,0.042144775390625,0.034454345703125,0.01214599609375,-0.033050537109375,-0.028594970703125,-0.0303497314453125,-0.00139617919921875,-0.0008273124694824219,-0.0216217041015625,-0.039642333984375,0.0188140869140625,0.010284423828125,0.060791015625,0.01503753662109375,-0.033935546875,0.007648468017578125,0.015411376953125,-0.048095703125,0.0330810546875,-0.00743865966796875,0.05645751953125,0.02081298828125,-0.0450439453125,-0.020538330078125,0.03472900390625,-0.00972747802734375,-0.02435302734375,-0.034149169921875,0.01300811767578125,0.016448974609375,-0.0345458984375,0.01364898681640625,0.0286407470703125,-0.01548004150390625,0.0196990966796875,-0.03045654296875,0.005924224853515625,0.06927490234375,-0.021026611328125,0.0015935897827148438,-0.0247802734375,-0.0006380081176757812,-0.00962066650390625,-0.01468658447265625,-0.0439453125,0.005985260009765625,-0.0003972053527832031,0.040679931640625,0.0224761962890625,-0.038818359375,-0.036346435546875,-0.021240234375,-0.0288238525390625,0.038482666015625,0.0239715576171875,-0.005756378173828125,0.058746337890625,0.049285888671875,-0.018890380859375,-0.005542755126953125,0.0188446044921875,0.022613525390625,-0.022247314453125,0.01313018798828125,0.0011758804321289062,-0.013671875,-0.010467529296875,-0.0276031494140625,0.004062652587890625,-0.0277862548828125,-0.0002111196517944336,0.0022411346435546875,-0.015380859375,-0.0426025390625,-0.040863037109375,0.0023517608642578125,0.009765625,-0.050750732421875,-0.0189361572265625,-0.01273345947265625,-0.02825927734375,0.06005859375,0.048614501953125,-0.03021240234375,-0.0079193115234375,0.033538818359375,0.0244140625,-0.006313323974609375,0.07568359375,-0.045166015625,-0.041168212890625,-0.004741668701171875,-0.0202178955078125,0.005764007568359375,0.0030269622802734375,-0.031280517578125,0.0028591156005859375,0.0015001296997070312,-0.033203125,-0.038299560546875,-0.01739501953125,-0.01483154296875,-0.0091552734375,-0.07476806640625,-0.01548004150390625,0.014617919921875,0.0382080078125,-0.0166473388671875,-0.04852294921875,-0.0270233154296875,0.0196990966796875,0.0216827392578125,0.0241851806640625,-0.06103515625,-0.00942230224609375,0.0213623046875,-0.0279083251953125,0.02764892578125,0.020538330078125,-0.0038509368896484375,-0.057403564453125,0.0033779144287109375,0.0150146484375,-0.028045654296875,-0.01387786865234375,-0.007648468017578125,0.060943603515625,-0.005767822265625,0.0003478527069091797,0.0189666748046875,0.00475311279296875,-0.00823974609375,-0.000995635986328125,0.00011414289474487305,0.0169525146484375,0.0104827880859375,-0.03680419921875,-0.01168060302734375,-0.0173797607421875,0.068359375,-0.061309814453125,0.043121337890625,0.0196533203125,-0.051177978515625,0.052337646484375,-0.02374267578125,0.031890869140625,-0.027069091796875,0.01070404052734375,-0.005950927734375,0.01035308837890625,0.01224517822265625,-0.057952880859375,-0.001903533935546875,-0.0149078369140625,-0.05450439453125,-0.026580810546875,-0.0080413818359375,-0.021148681640625,0.003803253173828125,0.065185546875,-0.0183258056640625,-0.0077362060546875,-0.01934814453125,0.0029811859130859375,0.051971435546875,0.061187744140625,-0.02301025390625,0.00794219970703125,0.01367950439453125,0.0038280487060546875,-0.003147125244140625,0.038330078125,-0.01271820068359375,0.004421234130859375,-0.0843505859375,0.0276031494140625,0.005889892578125,-0.0015592575073242188,-0.0057525634765625,-0.0166778564453125,0.032012939453125,0.03082275390625,0.00980377197265625,0.03265380859375,-0.01308441162109375,-0.03662109375,-0.0287322998046875,0.016387939453125,-0.0208282470703125,-0.0225067138671875,-0.0316162109375,0.021240234375,0.003940582275390625,-0.01513671875,0.03875732421875,-0.005725860595703125,-0.0631103515625,0.0178070068359375,-0.025634765625,-0.0243988037109375,0.0045013427734375,0.01611328125,0.00463104248046875,-0.02044677734375,-0.003543853759765625,0.0211639404296875,-0.0245819091796875,0.005535125732421875,0.0311126708984375,-0.0036792755126953125,0.0012331008911132812,-0.00688934326171875,-0.00762939453125,0.00809478759765625,0.0216827392578125,-0.0267486572265625,-0.01416778564453125,-0.056884765625,-0.07440185546875,0.0060272216796875,0.016448974609375,-0.01107025146484375,0.015899658203125,0.01131439208984375,-0.03472900390625,-0.0015583038330078125,-0.03076171875,-0.04901123046875,-0.01172637939453125,0.0229644775390625,0.015960693359375,0.049591064453125,0.01532745361328125,-0.036163330078125,0.00244140625,0.01085662841796875,-0.040069580078125,-0.0036830902099609375,0.00577545166015625,0.0179901123046875,-0.017486572265625,0.015838623046875,-0.050506591796875,0.010589599609375,-0.030303955078125,0.0289306640625,0.040374755859375,0.024749755859375,-0.032501220703125,-0.056793212890625,0.024383544921875,0.02117919921875,0.0400390625,0.0237579345703125,0.03472900390625,-0.0132293701171875,0.00814056396484375,-0.01528167724609375,0.039093017578125,0.011688232421875,-0.0190887451171875,-0.04949951171875,0.0108642578125,-0.04339599609375,0.0228729248046875,0.014892578125,-0.00335693359375,-0.017669677734375,-0.01104736328125,-0.058258056640625,-0.01296234130859375,0.024444580078125,-0.014068603515625,-0.0296783447265625,0.0163726806640625,-0.0169677734375,0.0108795166015625,0.012542724609375,0.0141754150390625,-0.0032634735107421875,-0.04998779296875,-0.003383636474609375,-0.027862548828125,0.0197296142578125,0.037872314453125,0.0242156982421875,0.07562255859375,-0.0227203369140625,0.022552490234375,0.034637451171875,0.0165252685546875,-0.059173583984375,0.06964111328125,0.007808685302734375,0.0118865966796875,0.0291748046875,0.00638580322265625,-0.00960540771484375,-0.0241546630859375,0.0262298583984375,-0.018768310546875,0.039703369140625,0.004184722900390625,0.000469207763671875,0.00287628173828125,0.048187255859375,0.01364898681640625,-0.0133819580078125,-0.0015916824340820312,-0.005641937255859375,0.0106658935546875,0.0191650390625,-0.026275634765625,0.0156402587890625,0.022003173828125,0.04498291015625,0.042938232421875,-0.0445556640625,-0.0193634033203125,0.0165252685546875,-0.014984130859375,-0.01090240478515625,-0.057952880859375,-0.08489990234375,0.00222015380859375,0.0008978843688964844,-0.011749267578125,0.0283355712890625,-0.0018205642700195312,0.0030803680419921875,-0.023895263671875,-0.007259368896484375,0.050567626953125,0.04998779296875,-0.034881591796875,-0.0207061767578125,0.0526123046875,-0.025390625,0.0003478527069091797,-0.0030078887939453125,0.01092529296875,0.00814056396484375,0.0628662109375,0.0191650390625,0.016082763671875,0.0014362335205078125,-0.026519775390625,0.005199432373046875,-0.036651611328125,-0.016754150390625,-0.016204833984375,0.01080322265625,-0.032745361328125,0.032928466796875,0.04364013671875,0.035675048828125,-0.0006570816040039062,0.0015211105346679688,-0.0096588134765625,0.033050537109375,-0.00948333740234375,0.00823974609375,0.0286407470703125,0.03521728515625,0.00963592529296875,0.00397491455078125,0.0184326171875,-0.018951416015625,0.053924560546875,0.0222015380859375,0.01439666748046875,-0.027496337890625,0.01367950439453125,-0.0193634033203125,0.047515869140625,0.0109100341796875,0.0299530029296875,-0.0007367134094238281,0.042999267578125,-0.0018091201782226562,-0.041473388671875,-0.01525115966796875,-0.0012178421020507812,-0.0150146484375,0.0052642822265625,-0.03082275390625,0.01242828369140625,-0.0076141357421875,0.006072998046875,-0.02740478515625,0.00616455078125,0.0265655517578125,0.00513458251953125,-0.0225067138671875,0.004360198974609375,-0.0016584396362304688,-0.03753662109375,0.0191192626953125,-0.0253448486328125,0.03192138671875,-0.0574951171875,0.00261688232421875,-0.0001729726791381836,0.06341552734375,-0.01300811767578125,0.016510009765625,0.0017061233520507812,-0.0096893310546875,-0.0178375244140625,-0.0062255859375,0.016754150390625,0.06256103515625,-0.0034503936767578125,0.022216796875,0.0005221366882324219,-0.00971221923828125,-0.0230255126953125,0.0274505615234375,0.0160675048828125,0.01055145263671875,0.007282257080078125,-0.0243988037109375,0.024993896484375,0.0088348388671875,0.00531005859375,-0.0205230712890625,0.024139404296875,-0.005138397216796875,0.02618408203125,0.0226898193359375,0.01331329345703125,0.011260986328125,0.06915283203125,-0.0312347412109375,0.01552581787109375,-0.0032405853271484375,-0.0511474609375,0.01373291015625,0.01401519775390625,0.00839996337890625,0.018798828125,0.0357666015625,0.003753662109375,0.03466796875,0.0016660690307617188,-0.0009546279907226562,0.021026611328125,0.0015621185302734375,-0.006763458251953125,-0.04949951171875,0.039886474609375,0.0159454345703125,0.0123291015625,0.036285400390625,-0.001781463623046875,-0.01617431640625,-0.0303192138671875,0.007480621337890625,0.017120361328125,-0.0175933837890625,-0.0259857177734375,0.031890869140625,-0.0191650390625,0.026275634765625,-0.01364898681640625,-0.00846099853515625,-0.0034389495849609375,-0.030609130859375,0.019012451171875,0.002735137939453125,0.051788330078125,-0.0594482421875,0.01343536376953125,-0.0309906005859375,-0.037109375,-0.01397705078125,0.0231170654296875,-0.0212554931640625,-0.0069580078125,0.01369476318359375,0.044525146484375,0.00041103363037109375,0.05560302734375,0.032196044921875,0.01065826416015625,0.07470703125,0.0098876953125,-0.0294647216796875,0.01244354248046875,-0.0083770751953125,-0.0213775634765625,-0.00968170166015625,0.0015869140625,0.00469207763671875,-0.049896240234375,-0.0243072509765625,-0.0247039794921875,-0.0152130126953125,0.0013437271118164062,-0.01152801513671875,0.01026153564453125,0.00955963134765625,0.006298065185546875,0.0014028549194335938,-0.017059326171875,0.05267333984375,-0.017486572265625,-0.0062713623046875,-0.003734588623046875,-0.004344940185546875,-0.01824951171875,-0.02557373046875,0.048675537109375,-0.040985107421875,0.032257080078125,-0.004398345947265625,-0.02764892578125,0.01139068603515625,-0.032135009765625,0.0004584789276123047,-0.0137481689453125,0.0224609375,0.0228729248046875,-0.005985260009765625,-0.00949859619140625,-0.050933837890625,0.03228759765625,0.021087646484375,-0.01165771484375,0.05096435546875,0.00984954833984375,0.041412353515625,0.00830078125,0.0229339599609375,0.0305633544921875,0.006435394287109375,-0.0140228271484375,-0.0035800933837890625,-0.031158447265625,0.0290679931640625,0.0033588409423828125,-0.01448822021484375,-0.06231689453125,-0.005084991455078125,0.008941650390625,-0.006275177001953125,-0.0133056640625,0.021575927734375,-0.014984130859375,-0.00293731689453125,-0.0189666748046875,0.016845703125,-0.0010395050048828125,-0.005519866943359375,0.0092620849609375,-0.0255279541015625,0.01788330078125,-0.040313720703125,0.0055389404296875,0.03314208984375,-0.02105712890625,-0.0174102783203125,0.0276031494140625,-0.0084686279296875,-0.005535125732421875,0.0189361572265625,-0.00940704345703125,0.0159454345703125,0.0103607177734375,-0.0015439987182617188,-0.0279388427734375,0.01788330078125,0.021026611328125,-0.00945281982421875,0.0194854736328125,-0.01540374755859375,-0.01100921630859375,-0.03021240234375,-0.005992889404296875,-0.0227203369140625,0.0129852294921875,0.00925445556640625,-0.0251007080078125,0.040252685546875,0.0217132568359375,-0.0032901763916015625,-0.0309600830078125,0.050689697265625,-0.0267486572265625,0.005855560302734375,0.01078033447265625,-0.013214111328125,0.0231170654296875,-0.0318603515625,0.037109375,0.0183258056640625,0.0145416259765625,-0.0411376953125,0.0195465087890625,0.004222869873046875,0.0014972686767578125,0.0125885009765625,0.01715087890625,0.0118255615234375,-0.01500701904296875,0.00485992431640625,0.00385284423828125,0.012786865234375,-0.01080322265625,0.0211639404296875,-0.0261688232421875,0.00743865966796875,0.037933349609375,0.02789306640625,-0.0170745849609375,-0.0118255615234375,0.0101165771484375,-0.01160430908203125,0.0253448486328125,-0.00577545166015625,-0.0240936279296875,0.004611968994140625,-0.00848388671875,-0.00014030933380126953,0.0155792236328125,-0.0152130126953125,-0.046417236328125,0.00955963134765625,-0.0229034423828125,-0.006420135498046875,-0.0270538330078125,-0.049713134765625,-0.0103607177734375,0.01209259033203125,0.051177978515625,0.01210784912109375,-0.0222625732421875,0.023468017578125,0.0233306884765625,0.0182037353515625,-0.02069091796875,-0.005046844482421875,0.0161285400390625,0.0098419189453125,-0.0071258544921875,0.0015897750854492188,-0.0193939208984375,-0.04949951171875,-0.016143798828125,-0.0086822509765625,-0.00980377197265625,-0.019012451171875,0.0013942718505859375,-0.02203369140625,0.0178070068359375,-0.00458526611328125,0.0241851806640625,0.01168060302734375,0.02166748046875,0.007503509521484375,0.017333984375,-0.042816162109375,0.082763671875,-0.0299224853515625,-0.00897979736328125,-0.0657958984375,0.0252532958984375,-0.0008730888366699219,0.025421142578125,0.0194549560546875,-0.0135040283203125,0.016876220703125,0.0247344970703125,0.023468017578125,0.00228118896484375,0.04876708984375,-0.01226806640625,0.0142974853515625,-0.0072174072265625,0.0501708984375,0.006420135498046875,-0.00713348388671875,-0.0032596588134765625,0.00705718994140625,0.036865234375,0.011138916015625,-0.019439697265625,-0.017852783203125,-0.0069580078125,0.001804351806640625,-0.0245819091796875,0.01271820068359375,-0.00021326541900634766,-0.002086639404296875,0.0239715576171875,0.040679931640625,-0.01071929931640625,-0.009307861328125,-0.0257720947265625,0.037445068359375,0.05352783203125,0.003307342529296875,0.04693603515625,-0.00843048095703125,-0.02557373046875,-0.00460052490234375,0.0189361572265625,-0.0153961181640625,-0.00323486328125,0.037689208984375,0.003955841064453125,0.02325439453125,-0.01751708984375,-0.007282257080078125,0.003925323486328125,-0.00832366943359375,-0.0119476318359375,-0.039459228515625,0.029022216796875,-0.01343536376953125,-0.0291900634765625,0.033416748046875,-0.07177734375,-0.009185791015625,-0.02508544921875,0.0062103271484375,0.006256103515625,0.0543212890625,-0.006633758544921875,-0.01204681396484375,-0.02978515625,-0.01456451416015625,0.03460693359375,0.005725860595703125,0.0015535354614257812,0.0273895263671875,0.02972412109375,-0.01104736328125,-0.04754638671875,0.005878448486328125,0.039459228515625,0.000010609626770019531,-0.0196075439453125,0.010162353515625,-0.022491455078125,0.0304718017578125,-0.0223236083984375,-0.0216217041015625,0.0203704833984375,-0.0229339599609375,-0.007198333740234375,0.0004706382751464844,0.0192108154296875,-0.042022705078125,-0.004131317138671875,0.003253936767578125,-0.0213165283203125,0.0155029296875,-0.01488494873046875,0.0180206298828125,-0.0295867919921875,-0.0180511474609375,-0.035858154296875,0.00876617431640625,0.0010461807250976562,0.0164031982421875,0.01776123046875,-0.032745361328125,0.032012939453125,-0.0271453857421875,-0.0134735107421875,-0.02362060546875,-0.0038089752197265625,0.0010433197021484375,0.01166534423828125,-0.016265869140625,0.0113067626953125,-0.00952911376953125,-0.007297515869140625,-0.0229034423828125,0.028533935546875,0.00759124755859375,0.022735595703125,-0.01947021484375,0.0096282958984375,0.0014600753784179688,0.03424072265625,-0.032196044921875,-0.00791168212890625,0.004146575927734375,0.04083251953125,-0.02349853515625,0.0028820037841796875,0.0167694091796875,0.010711669921875,0.0234222412109375,0.00494384765625,0.001522064208984375,0.055511474609375,0.0186309814453125,0.0037994384765625,-0.0109710693359375,-0.0012912750244140625,0.034393310546875,0.0242462158203125,0.03662109375,-0.0256195068359375,-0.0156402587890625,0.023956298828125,-0.0071563720703125,0.0408935546875,0.005878448486328125,-0.0248260498046875,0.03076171875,-0.01476287841796875,0.0228729248046875,-0.0140533447265625,-0.01922607421875,-0.028289794921875,0.0496826171875,0.01934814453125,0.0008916854858398438,-0.02691650390625,-0.0053863525390625,-0.042694091796875,0.0012788772583007812,-0.0141143798828125,-0.01204681396484375,-0.03253173828125,-0.001861572265625,-0.0167083740234375,-0.006755828857421875,0.0240478515625,-0.006927490234375,0.01013946533203125,-0.033782958984375,-0.0017223358154296875,-0.012542724609375,0.00119781494140625,-0.034515380859375,0.006877899169921875,-0.0193328857421875,0.01580810546875,-0.0158538818359375,-0.0267791748046875,-0.008941650390625,-0.02874755859375,-0.01123046875,0.022430419921875,-0.02581787109375,-0.01190185546875,0.01384735107421875,-0.0299530029296875,-0.0230255126953125,0.06689453125,0.00531005859375,0.00626373291015625,0.028106689453125,0.0261383056640625,0.0030727386474609375,0.02716064453125,-0.0179443359375,-0.005168914794921875,0.01922607421875,0.01557159423828125,0.008544921875,0.0073089599609375,-0.0025482177734375,-0.006778717041015625,0.05413818359375,-0.053070068359375,0.0006098747253417969,-0.01323699951171875,0.0003764629364013672,-0.0013532638549804688,-0.033233642578125,-0.00258636474609375,0.0191802978515625,0.0222015380859375,-0.00884246826171875,-0.0129852294921875,0.02630615234375,0.01313018798828125,0.036895751953125,0.036651611328125,-0.00231170654296875,0.007556915283203125,-0.0290374755859375,-0.0120697021484375,0.005924224853515625,0.006282806396484375,0.015777587890625,0.00336456298828125,-0.0184478759765625,-0.025299072265625,0.00423431396484375,0.0201873779296875,-0.0123291015625,0.0235137939453125,-0.0167236328125,-0.01459503173828125,-0.043243408203125,0.0229034423828125,-0.00437164306640625,-0.00434112548828125,-0.01165008544921875,0.00939178466796875,0.0168914794921875,0.0133819580078125,-0.004978179931640625,0.011566162109375,0.00395965576171875,-0.006320953369140625,0.01318359375,-0.01114654541015625,0.0374755859375,0.046722412109375,0.033416748046875,0.0194091796875,0.031463623046875,0.020233154296875,0.0318603515625,-0.00789642333984375,-0.049468994140625,0.0182037353515625,-0.0455322265625,-0.0117340087890625,-0.0400390625,-0.0413818359375,0.0052337646484375,-0.0185699462890625,-0.0021839141845703125,0.0044403076171875,-0.0070343017578125,-0.0017652511596679688,-0.00734710693359375,-0.001739501953125,-0.0019969940185546875,0.01617431640625,0.0156707763671875,-0.0093536376953125,0.03570556640625,0.03643798828125,-0.026580810546875,-0.0230712890625,0.042572021484375,0.01099395751953125,0.026580810546875,-0.038177490234375,0.0279998779296875,-0.0071258544921875,-0.01248931884765625,-0.0203704833984375,0.0240020751953125,-0.01251220703125,-0.026824951171875,-0.045867919921875,0.0209503173828125,0.034423828125,-0.0234222412109375,-0.0306243896484375,0.0075531005859375,0.0234527587890625,-0.00811004638671875,-0.01168060302734375,-0.026824951171875,-0.004955291748046875,0.0144500732421875,-0.00788116455078125,-0.02862548828125,-0.01052093505859375,-0.024505615234375,0.021148681640625,-0.026123046875,-0.0121002197265625,-0.01239776611328125,0.02020263671875,0.04632568359375,0.0112457275390625,0.02386474609375,-0.0312042236328125,0.03240966796875,0.0413818359375,-0.052825927734375,0.0036220550537109375,0.0684814453125,-0.034820556640625,-0.007404327392578125,0.001888275146484375,-0.0161590576171875,-0.01444244384765625,-0.0228271484375,0.00530242919921875,0.00025844573974609375,-0.0174102783203125,-0.00977325439453125,-0.006916046142578125,0.0108489990234375,-0.01207733154296875,-0.005504608154296875,0.03387451171875,0.00794219970703125,-0.03466796875,0.00504302978515625,0.0167236328125,0.0086669921875,-0.029022216796875,-0.0474853515625,0.03143310546875,0.00667572021484375,-0.004016876220703125,-0.0046234130859375,0.0273895263671875,0.039703369140625,-0.025665283203125,-0.0210113525390625,0.0195159912109375,0.01776123046875,0.0243072509765625,0.005157470703125,0.0126190185546875,-0.033782958984375,0.034332275390625,-0.00260162353515625,0.0071563720703125,0.0006117820739746094,-0.0170135498046875,-0.0303955078125,-0.037628173828125,0.00027561187744140625,0.0028285980224609375,-0.0281524658203125,-0.044403076171875,-0.006744384765625,0.0251312255859375,-0.0157928466796875,0.035797119140625,0.03167724609375,0.029571533203125,-0.00963592529296875,-0.0152587890625,-0.0099334716796875,-0.05657958984375,0.0240936279296875,-0.01267242431640625,0.0028476715087890625,-0.006137847900390625,-0.0127716064453125,-0.010650634765625,0.0258636474609375,-0.025299072265625,-0.02197265625,0.00930023193359375,-0.041595458984375,-0.0081024169921875,0.021728515625,-0.017852783203125,0.0616455078125,-0.01038360595703125,0.03277587890625,-0.0039520263671875,0.01995849609375,-0.022857666015625,0.0001170039176940918,-0.0109100341796875,-0.0100555419921875,0.0023956298828125,0.00206756591796875,-0.0297698974609375,0.00734710693359375,-0.006740570068359375,0.0308990478515625,-0.0088958740234375,0.02276611328125,-0.004119873046875,-0.0002149343490600586,0.01100921630859375,0.00643157958984375,-0.03228759765625,0.034332275390625,-0.0145416259765625,0.0236968994140625,0.01360321044921875,0.01153564453125,0.0285491943359375,-0.0157318115234375,0.00995635986328125,0.0263671875,0.005367279052734375,-0.0047607421875,-0.032440185546875,-0.0015411376953125,-0.0291748046875,0.00960540771484375,0.0367431640625,0.00801849365234375,-0.0292205810546875,-0.0211639404296875,0.0005865097045898438,0.00787353515625,-0.01461029052734375,-0.0079193115234375,-0.0307159423828125,-0.03271484375,0.018035888671875,0.0157318115234375,-0.017608642578125,-0.00252532958984375,-0.036041259765625,0.0247344970703125,0.043121337890625,-0.00458526611328125,0.006542205810546875,-0.030670166015625,0.00060272216796875,0.00572967529296875,0.00826263427734375,-0.006744384765625,0.039947509765625,0.0263214111328125,-0.00548553466796875,-0.021881103515625,-0.00037980079650878906,-0.01419830322265625,0.038909912109375,0.015380859375,0.01351165771484375,0.0187530517578125,-0.00960540771484375,-0.0187530517578125,-0.0292816162109375,-0.04876708984375,0.0198974609375,-0.008697509765625,-0.00626373291015625,0.0028018951416015625,0.019378662109375,-0.01824951171875,0.0253753662109375,0.017120361328125,-0.0114593505859375,0.027587890625,0.00534820556640625,-0.0188751220703125,-0.006801605224609375,0.01062774658203125,0.018310546875,-0.0201263427734375,-0.016357421875,-0.0232696533203125,-0.032379150390625,0.0260162353515625,-0.05108642578125,-0.00862884521484375,-0.047698974609375,0.032073974609375,-0.007564544677734375,-0.021697998046875,0.04931640625,0.015838623046875,-0.020355224609375,0.00942230224609375,0.012847900390625,0.033294677734375,0.0185699462890625,-0.005794525146484375,-0.0184478759765625,0.024139404296875,-0.01267242431640625,0.005611419677734375,-0.03802490234375,-0.0263824462890625,-0.01363372802734375,-0.032012939453125,0.00466156005859375,0.0157470703125,0.0272674560546875,0.047515869140625,0.01004791259765625,-0.0167999267578125,0.016204833984375,-0.01219940185546875,-0.01168060302734375,0.01422119140625,-0.00372314453125,-0.00446319580078125,0.004669189453125,-0.02911376953125,0.0386962890625,-0.0092010498046875,-0.005123138427734375,0.004131317138671875,-0.0050048828125,-0.0279388427734375,-0.0092620849609375,-0.0208587646484375,-0.003910064697265625,0.0099639892578125,0.02911376953125,-0.0206146240234375,-0.00799560546875,-0.01511383056640625,-0.0149383544921875,0.00433349609375,-0.045318603515625,-0.00568389892578125,0.0245361328125,0.007244110107421875,-0.022918701171875,0.0135498046875,-0.01259613037109375,-0.031280517578125,-0.023223876953125,-0.005489349365234375,0.02044677734375,0.0285491943359375,0.034210205078125,-0.003025054931640625,-0.0467529296875,-0.01141357421875,0.0135498046875,-0.0244903564453125,0.01107025146484375,-0.02276611328125,0.01422119140625,0.00830078125,0.01849365234375,0.00677490234375,0.056793212890625,0.0021457672119140625,0.0230255126953125,0.005889892578125,-0.0264739990234375,0.04437255859375,0.0173797607421875,0.027557373046875,0.00418853759765625,0.0007157325744628906,-0.0421142578125,-0.0110626220703125,0.0638427734375,-0.004978179931640625,0.01377105712890625,-0.006801605224609375,-0.029815673828125,0.009185791015625,-0.0243072509765625,-0.004871368408203125,0.0088653564453125,0.06317138671875,0.0015287399291992188,-0.0229034423828125,0.0311431884765625,-0.024444580078125,-0.0212249755859375,-0.00870513916015625,-0.01512908935546875,-0.0308685302734375,-0.002857208251953125,-0.0078582763671875,0.06256103515625,0.017425537109375,0.0294647216796875,0.01280975341796875,-0.0098419189453125,0.0284423828125,-0.0280609130859375,-0.030059814453125,0.01485443115234375,-0.040283203125,-0.0162506103515625,-0.00675201416015625,0.00153350830078125,-0.025726318359375,-0.0242462158203125,-0.0152587890625,-0.01861572265625,0.006305694580078125,0.013824462890625,-0.036163330078125,0.02099609375,-0.0295257568359375,0.01373291015625,0.019683837890625,-0.035064697265625,0.005245208740234375,-0.00032782554626464844,0.00695037841796875,0.0035686492919921875,-0.0163116455078125,0.0181121826171875,-0.01904296875,0.0261077880859375,-0.007396697998046875,-0.01190185546875,-0.015716552734375,0.0013952255249023438,-0.027618408203125,0.0574951171875,-0.02362060546875,-0.0000788569450378418,0.01209259033203125,0.0025615692138671875,-0.01337432861328125,-0.0036907196044921875,0.0034389495849609375,0.002498626708984375,0.01104736328125,-0.041534423828125,-0.00014007091522216797,-0.0013074874877929688,0.003082275390625,-0.00870513916015625,-0.0243377685546875,0.01177978515625,0.0026721954345703125,-0.005035400390625,0.02630615234375,0.01313018798828125,-0.0009069442749023438,-0.01446533203125,-0.051055908203125,-0.005718231201171875,0.0093841552734375,0.0157318115234375,0.0118255615234375,-0.028472900390625,-0.00794219970703125,-0.0130615234375,0.03887939453125,0.020538330078125,0.0005993843078613281,-0.0105743408203125,0.005725860595703125,-0.004848480224609375,0.03228759765625,0.004974365234375,-0.0226287841796875,0.01947021484375,0.01251983642578125,0.0137481689453125,-0.034423828125,-0.0235748291015625,0.0034503936767578125,0.0321044921875,0.0240631103515625,-0.0450439453125,-0.003543853759765625,-0.0318603515625,-0.022369384765625,0.03253173828125,-0.005435943603515625,-0.005374908447265625,-0.011932373046875,0.00786590576171875,-0.005115509033203125,-0.009796142578125,-0.018310546875,-0.038421630859375,-0.006336212158203125,-0.0167694091796875,0.00537109375,-0.00856781005859375,-0.0450439453125,0.04339599609375,-0.01511383056640625,0.001708984375,0.0108184814453125,0.0088348388671875,0.004283905029296875,-0.034942626953125,-0.021575927734375,0.0241851806640625,0.004573822021484375],"index":2}],"model":"text-embedding-3-small","usage":{"prompt_tokens":16,"total_tokens":16}} \ No newline at end of file diff --git a/e2e/scenarios/ai-sdk-instrumentation/__cassettes__/ai-sdk-v7.cassette.json b/e2e/scenarios/ai-sdk-instrumentation/__cassettes__/ai-sdk-v7.cassette.json new file mode 100644 index 000000000..67ea54b0a --- /dev/null +++ b/e2e/scenarios/ai-sdk-instrumentation/__cassettes__/ai-sdk-v7.cassette.json @@ -0,0 +1,2065 @@ +{ + "entries": [ + { + "callIndex": 0, + "id": "7c0e162d6794cf5d", + "matchKey": "POST api.openai.com/v1/responses", + "recordedAt": "2026-06-15T13:08:34.738Z", + "request": { + "body": { + "kind": "json", + "value": { + "input": [ + { + "content": [ + { + "text": "Reply with the single token PARIS and no punctuation.", + "type": "input_text" + } + ], + "role": "user" + } + ], + "max_output_tokens": 24, + "model": "gpt-4o-mini-2024-07-18", + "temperature": 0 + } + }, + "headers": {}, + "method": "POST", + "url": "https://api.openai.com/v1/responses" + }, + "response": { + "body": { + "kind": "json", + "value": { + "background": false, + "billing": { + "payer": "developer" + }, + "completed_at": 1781528914, + "created_at": 1781528913, + "error": null, + "frequency_penalty": 0, + "id": "resp_08e21a27e86c971e006a2ff951c5048192a0af2698bfaf280b", + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 24, + "max_tool_calls": null, + "metadata": {}, + "model": "gpt-4o-mini-2024-07-18", + "moderation": null, + "object": "response", + "output": [ + { + "content": [ + { + "annotations": [], + "logprobs": [], + "text": "PARIS", + "type": "output_text" + } + ], + "id": "msg_08e21a27e86c971e006a2ff952764c8192915880c5d463c15f", + "role": "assistant", + "status": "completed", + "type": "message" + } + ], + "parallel_tool_calls": true, + "presence_penalty": 0, + "previous_response_id": null, + "prompt_cache_key": "[REDACTED]", + "prompt_cache_retention": "in_memory", + "reasoning": { + "context": null, + "effort": null, + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "status": "completed", + "store": true, + "temperature": 0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [], + "top_logprobs": 0, + "top_p": 1, + "truncation": "disabled", + "usage": { + "input_tokens": 18, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 3, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 21 + }, + "user": null + } + }, + "headers": { + "access-control-expose-headers": "X-Request-ID, CF-Ray, CF-Ray", + "alt-svc": "h3=\":443\"; ma=86400", + "cf-cache-status": "DYNAMIC", + "cf-ray": "a0c1cdde08b43249-VIE", + "connection": "keep-alive", + "content-encoding": "gzip", + "content-type": "application/json", + "date": "Mon, 15 Jun 2026 13:08:34 GMT", + "openai-organization": "braintrust-data", + "openai-processing-ms": "1035", + "openai-project": "proj_vsCSXafhhByzWOThMrJcZiw9", + "openai-version": "2020-10-01", + "server": "cloudflare", + "set-cookie": "[REDACTED]", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-ratelimit-limit-requests": "30000", + "x-ratelimit-limit-tokens": "150000000", + "x-ratelimit-remaining-requests": "29999", + "x-ratelimit-remaining-tokens": "149999962", + "x-ratelimit-reset-requests": "2ms", + "x-ratelimit-reset-tokens": "0s", + "x-request-id": "req_c1eb4fa2cddc4c94906c59ce4ec7d77a" + }, + "status": 200, + "statusText": "OK" + } + }, + { + "callIndex": 1, + "id": "f12aff3913439248", + "matchKey": "POST api.openai.com/v1/responses", + "recordedAt": "2026-06-15T13:08:36.241Z", + "request": { + "body": { + "kind": "json", + "value": { + "input": [ + { + "content": [ + { + "text": "Return a short answer for 2 + 2. Keep the answer concise.", + "type": "input_text" + } + ], + "role": "user" + } + ], + "max_output_tokens": 32, + "model": "gpt-4o-mini-2024-07-18", + "temperature": 0, + "text": { + "format": { + "name": "response", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "answer": { + "type": "string" + } + }, + "required": ["answer"], + "type": "object" + }, + "strict": true, + "type": "json_schema" + } + } + } + }, + "headers": {}, + "method": "POST", + "url": "https://api.openai.com/v1/responses" + }, + "response": { + "body": { + "kind": "json", + "value": { + "background": false, + "billing": { + "payer": "developer" + }, + "completed_at": 1781528916, + "created_at": 1781528914, + "error": null, + "frequency_penalty": 0, + "id": "resp_04d2d681e1b09a4a006a2ff952f2bc81a1a73280bae81965e2", + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 32, + "max_tool_calls": null, + "metadata": {}, + "model": "gpt-4o-mini-2024-07-18", + "moderation": null, + "object": "response", + "output": [ + { + "content": [ + { + "annotations": [], + "logprobs": [], + "text": "{\"answer\":\"4\"}", + "type": "output_text" + } + ], + "id": "msg_04d2d681e1b09a4a006a2ff953cd1081a183158139618edb2d", + "role": "assistant", + "status": "completed", + "type": "message" + } + ], + "parallel_tool_calls": true, + "presence_penalty": 0, + "previous_response_id": null, + "prompt_cache_key": "[REDACTED]", + "prompt_cache_retention": "in_memory", + "reasoning": { + "context": null, + "effort": null, + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "status": "completed", + "store": true, + "temperature": 0, + "text": { + "format": { + "description": null, + "name": "response", + "schema": { + "additionalProperties": false, + "properties": { + "answer": { + "type": "string" + } + }, + "required": ["answer"], + "type": "object" + }, + "strict": true, + "type": "json_schema" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [], + "top_logprobs": 0, + "top_p": 1, + "truncation": "disabled", + "usage": { + "input_tokens": 45, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 6, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 51 + }, + "user": null + } + }, + "headers": { + "access-control-expose-headers": "X-Request-ID, CF-Ray, CF-Ray", + "alt-svc": "h3=\":443\"; ma=86400", + "cf-cache-status": "DYNAMIC", + "cf-ray": "a0c1cde5d91d3249-VIE", + "connection": "keep-alive", + "content-encoding": "gzip", + "content-type": "application/json", + "date": "Mon, 15 Jun 2026 13:08:36 GMT", + "openai-organization": "braintrust-data", + "openai-processing-ms": "1325", + "openai-project": "proj_vsCSXafhhByzWOThMrJcZiw9", + "openai-version": "2020-10-01", + "server": "cloudflare", + "set-cookie": "[REDACTED]", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-ratelimit-limit-requests": "30000", + "x-ratelimit-limit-tokens": "150000000", + "x-ratelimit-remaining-requests": "29999", + "x-ratelimit-remaining-tokens": "149999937", + "x-ratelimit-reset-requests": "2ms", + "x-ratelimit-reset-tokens": "0s", + "x-request-id": "req_d2fe9d24b8fe40a0a42eb23029b05c16" + }, + "status": 200, + "statusText": "OK" + } + }, + { + "callIndex": 2, + "id": "5d2312f425df9f2f", + "matchKey": "POST api.openai.com/v1/responses", + "recordedAt": "2026-06-15T13:08:37.546Z", + "request": { + "body": { + "kind": "json", + "value": { + "input": [ + { + "content": [ + { + "text": "Count from 1 to 3 and include the words one two three.", + "type": "input_text" + } + ], + "role": "user" + } + ], + "max_output_tokens": 32, + "model": "gpt-4o-mini-2024-07-18", + "stream": true, + "temperature": 0 + } + }, + "headers": {}, + "method": "POST", + "url": "https://api.openai.com/v1/responses" + }, + "response": { + "body": { + "chunks": [ + "event: response.created\ndata: {\"type\":\"response.created\",\"response\":{\"id\":\"resp_003258bee4145e59006a2ff9548af081a29187e415896a4044\",\"object\":\"response\",\"created_at\":1781528916,\"status\":\"in_progress\",\"background\":false,\"completed_at\":null,\"error\":null,\"frequency_penalty\":0,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":32,\"max_tool_calls\":null,\"model\":\"gpt-4o-mini-2024-07-18\",\"moderation\":null,\"output\":[],\"parallel_tool_calls\":true,\"presence_penalty\":0,\"previous_response_id\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":\"in_memory\",\"reasoning\":{\"context\":null,\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}},\"sequence_number\":0}", + "event: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"resp_003258bee4145e59006a2ff9548af081a29187e415896a4044\",\"object\":\"response\",\"created_at\":1781528916,\"status\":\"in_progress\",\"background\":false,\"completed_at\":null,\"error\":null,\"frequency_penalty\":0,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":32,\"max_tool_calls\":null,\"model\":\"gpt-4o-mini-2024-07-18\",\"moderation\":null,\"output\":[],\"parallel_tool_calls\":true,\"presence_penalty\":0,\"previous_response_id\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":\"in_memory\",\"reasoning\":{\"context\":null,\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}},\"sequence_number\":1}", + "event: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"item\":{\"id\":\"msg_003258bee4145e59006a2ff9552f4081a2bf63b33b370ef0c6\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"},\"output_index\":0,\"sequence_number\":2}", + "event: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"content_index\":0,\"item_id\":\"msg_003258bee4145e59006a2ff9552f4081a2bf63b33b370ef0c6\",\"output_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"},\"sequence_number\":3}", + "event: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"content_index\":0,\"delta\":\"One\",\"item_id\":\"msg_003258bee4145e59006a2ff9552f4081a2bf63b33b370ef0c6\",\"logprobs\":[],\"obfuscation\":\"KhAN5ehZudKpu\",\"output_index\":0,\"sequence_number\":4}", + "event: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"content_index\":0,\"delta\":\",\",\"item_id\":\"msg_003258bee4145e59006a2ff9552f4081a2bf63b33b370ef0c6\",\"logprobs\":[],\"obfuscation\":\"6ypyq0ysbrSz7BX\",\"output_index\":0,\"sequence_number\":5}", + "event: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"content_index\":0,\"delta\":\" two\",\"item_id\":\"msg_003258bee4145e59006a2ff9552f4081a2bf63b33b370ef0c6\",\"logprobs\":[],\"obfuscation\":\"D5nW88UhRzk2\",\"output_index\":0,\"sequence_number\":6}", + "event: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"content_index\":0,\"delta\":\",\",\"item_id\":\"msg_003258bee4145e59006a2ff9552f4081a2bf63b33b370ef0c6\",\"logprobs\":[],\"obfuscation\":\"XTRoBmEEWkvzRVi\",\"output_index\":0,\"sequence_number\":7}", + "event: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"content_index\":0,\"delta\":\" three\",\"item_id\":\"msg_003258bee4145e59006a2ff9552f4081a2bf63b33b370ef0c6\",\"logprobs\":[],\"obfuscation\":\"7YtPHZTD2K\",\"output_index\":0,\"sequence_number\":8}", + "event: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"content_index\":0,\"delta\":\".\",\"item_id\":\"msg_003258bee4145e59006a2ff9552f4081a2bf63b33b370ef0c6\",\"logprobs\":[],\"obfuscation\":\"P2enBKQJmr3WGo7\",\"output_index\":0,\"sequence_number\":9}", + "event: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"content_index\":0,\"item_id\":\"msg_003258bee4145e59006a2ff9552f4081a2bf63b33b370ef0c6\",\"logprobs\":[],\"output_index\":0,\"sequence_number\":10,\"text\":\"One, two, three.\"}", + "event: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"content_index\":0,\"item_id\":\"msg_003258bee4145e59006a2ff9552f4081a2bf63b33b370ef0c6\",\"output_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"One, two, three.\"},\"sequence_number\":11}", + "event: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"item\":{\"id\":\"msg_003258bee4145e59006a2ff9552f4081a2bf63b33b370ef0c6\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"One, two, three.\"}],\"role\":\"assistant\"},\"output_index\":0,\"sequence_number\":12}", + "event: response.completed\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"resp_003258bee4145e59006a2ff9548af081a29187e415896a4044\",\"object\":\"response\",\"created_at\":1781528916,\"status\":\"completed\",\"background\":false,\"completed_at\":1781528917,\"error\":null,\"frequency_penalty\":0,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":32,\"max_tool_calls\":null,\"model\":\"gpt-4o-mini-2024-07-18\",\"moderation\":null,\"output\":[{\"id\":\"msg_003258bee4145e59006a2ff9552f4081a2bf63b33b370ef0c6\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"One, two, three.\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"presence_penalty\":0,\"previous_response_id\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":\"in_memory\",\"reasoning\":{\"context\":null,\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":0,\"text\":{\"format\":{\"type\":\"text\"},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":22,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":7,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":29},\"user\":null,\"metadata\":{}},\"sequence_number\":13}" + ], + "kind": "sse" + }, + "headers": { + "access-control-expose-headers": "X-Request-ID, CF-Ray, CF-Ray", + "alt-svc": "h3=\":443\"; ma=86400", + "cf-cache-status": "DYNAMIC", + "cf-ray": "a0c1cdef39103249-VIE", + "connection": "keep-alive", + "content-type": "text/event-stream; charset=utf-8", + "date": "Mon, 15 Jun 2026 13:08:36 GMT", + "openai-organization": "braintrust-data", + "openai-processing-ms": "312", + "openai-project": "proj_vsCSXafhhByzWOThMrJcZiw9", + "openai-version": "2020-10-01", + "server": "cloudflare", + "set-cookie": "[REDACTED]", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-request-id": "req_68374548a7194c579321e84e19a23da6" + }, + "status": 200, + "statusText": "OK" + } + }, + { + "callIndex": 0, + "id": "7d3c0bb6426e6be4", + "matchKey": "POST api.openai.com/v1/embeddings", + "recordedAt": "2026-06-15T13:08:37.757Z", + "request": { + "body": { + "kind": "json", + "value": { + "encoding_format": "float", + "input": ["Paris is the capital of France."], + "model": "text-embedding-3-small" + } + }, + "headers": {}, + "method": "POST", + "url": "https://api.openai.com/v1/embeddings" + }, + "response": { + "body": { + "kind": "json", + "value": { + "data": [ + { + "embedding": [ + 0.0196075439453125, 0.019073486328125, -0.01314544677734375, + -0.020660400390625, -0.0188140869140625, 0.029632568359375, + -0.0206298828125, 0.0236358642578125, 0.006320953369140625, + -0.01708984375, 0.004039764404296875, 0.0103607177734375, + -0.0289459228515625, 0.0068359375, -0.03192138671875, + 0.0251922607421875, -0.0282745361328125, 0.050262451171875, + 0.0914306640625, -0.02008056640625, 0.0222930908203125, + -0.01297760009765625, -0.0144805908203125, 0.034393310546875, + 0.052734375, -0.0011014938354492188, 0.00817108154296875, + 0.042510986328125, 0.0030460357666015625, 0.05987548828125, + 0.0164642333984375, -0.00787353515625, -0.00244903564453125, + 0.02423095703125, 0.01953125, -0.061065673828125, + -0.013336181640625, -0.03851318359375, 0.0079498291015625, + 0.0276641845703125, 0.0171051025390625, -0.02838134765625, + -0.0286865234375, 0.03277587890625, -0.035919189453125, + -0.047088623046875, -0.00940704345703125, -0.0224761962890625, + 0.02313232421875, -0.0037555694580078125, 0.045654296875, + -0.004848480224609375, 0.02020263671875, 0.00923919677734375, + 0.0044708251953125, 0.02252197265625, 0.03271484375, + 0.0433349609375, 0.0257110595703125, 0.0035400390625, + 0.051788330078125, 0.0206298828125, 0.04046630859375, + 0.01776123046875, -0.00559234619140625, 0.03271484375, + 0.021575927734375, 0.0322265625, 0.050048828125, + 0.02581787109375, 0.0187835693359375, 0.044342041015625, + -0.005947113037109375, 0.006748199462890625, 0.01885986328125, + 0.014678955078125, 0.004638671875, 0.038848876953125, + 0.0173492431640625, -0.03466796875, -0.0016269683837890625, + 0.01055908203125, 0.01372528076171875, -0.02166748046875, + -0.00677490234375, -0.01284027099609375, -0.00388336181640625, + 0.00274658203125, -0.002719879150390625, -0.0220794677734375, + 0.0014619827270507812, -0.01175689697265625, -0.0172119140625, + 0.015655517578125, -0.0308990478515625, 0.00458526611328125, + 0.0211334228515625, -0.04888916015625, -0.058837890625, + 0.02716064453125, 0.027862548828125, 0.001308441162109375, + -0.04681396484375, 0.0316162109375, 0.0155029296875, + -0.01544952392578125, 0.0004296302795410156, + -0.0005507469177246094, 0.01428985595703125, -0.0408935546875, + -0.021759033203125, 0.00412750244140625, -0.00025177001953125, + 0.032440185546875, -0.059783935546875, 0.01093292236328125, + 0.01397705078125, -0.00713348388671875, 0.031005859375, + -0.007572174072265625, -0.006343841552734375, + 0.0026073455810546875, -0.04180908203125, 0.040374755859375, + -0.03387451171875, -0.048248291015625, 0.006519317626953125, + 0.0264739990234375, 0.0227203369140625, -0.00856781005859375, + 0.004657745361328125, -0.044952392578125, 0.016876220703125, + 0.0258941650390625, 0.0506591796875, -0.00958251953125, + 0.033721923828125, -0.0057525634765625, 0.01751708984375, + 0.0177154541015625, -0.01558685302734375, 0.028533935546875, + -0.01058197021484375, 0.036529541015625, -0.0183258056640625, + -0.033843994140625, -0.031402587890625, 0.040069580078125, + 0.01015472412109375, -0.04278564453125, 0.016510009765625, + -0.0212554931640625, 0.00275421142578125, 0.0289459228515625, + -0.0037078857421875, -0.062103271484375, 0.01442718505859375, + -0.0018835067749023438, 0.0384521484375, 0.02569580078125, + -0.036865234375, 0.021331787109375, -0.046173095703125, + -0.016265869140625, -0.0034809112548828125, + 0.0081939697265625, -0.0090179443359375, -0.00542449951171875, + 0.011871337890625, 0.0159454345703125, -0.0235137939453125, + 0.00461578369140625, 0.051116943359375, 0.0389404296875, + 0.0225677490234375, -0.01392364501953125, -0.0185699462890625, + 0.08013916015625, 0.0262603759765625, -0.02142333984375, + -0.01103973388671875, -0.01428985595703125, 0.030731201171875, + -0.01473236083984375, 0.0189361572265625, 0.0250244140625, + -0.0206451416015625, -0.026885986328125, -0.0172882080078125, + 0.05322265625, 0.0615234375, -0.019073486328125, + 0.056396484375, -0.045440673828125, -0.06280517578125, + 0.0241546630859375, 0.0021800994873046875, + 0.006801605224609375, 0.0093231201171875, 0.00798797607421875, + -0.03924560546875, 0.04193115234375, -0.0056304931640625, + -0.00327301025390625, -0.01485443115234375, + 0.0191192626953125, -0.01004791259765625, -0.048309326171875, + 0.0295257568359375, -0.004802703857421875, + -0.0124359130859375, -0.00547027587890625, + -0.0262298583984375, 0.0384521484375, 0.03857421875, + -0.01038360595703125, 0.012908935546875, 0.034027099609375, + 0.0299072265625, -0.00550079345703125, 0.034637451171875, + 0.023406982421875, 0.0113067626953125, -0.01557159423828125, + -0.048919677734375, 0.055419921875, 0.052642822265625, + 0.00609588623046875, -0.044586181640625, 0.002712249755859375, + 0.00432586669921875, -0.028656005859375, -0.0147552490234375, + -0.015411376953125, -0.0269775390625, -0.01922607421875, + 0.003505706787109375, -0.0132598876953125, -0.04779052734375, + 0.019317626953125, -0.0338134765625, 0.01849365234375, + 0.01416015625, 0.0026702880859375, -0.00037384033203125, + 0.0026149749755859375, 0.01383209228515625, 0.037200927734375, + -0.0421142578125, 0.0126953125, 0.043365478515625, + -0.0171966552734375, -0.025360107421875, 0.017303466796875, + -0.03546142578125, 0.035125732421875, 0.006137847900390625, + -0.00630950927734375, -0.047698974609375, -0.0099029541015625, + 0.01043701171875, 0.0198974609375, -0.00995635986328125, + -0.0018243789672851562, -0.00839996337890625, + 0.0192108154296875, -0.0095977783203125, -0.023651123046875, + -0.0224609375, -0.030517578125, 0.03485107421875, + -0.0008287429809570312, -0.0177154541015625, 0.029052734375, + -0.020965576171875, 0.005268096923828125, -0.028167724609375, + 0.0009093284606933594, -0.001140594482421875, + 0.0157928466796875, -0.02178955078125, 0.0443115234375, + -0.01227569580078125, 0.01256561279296875, + -0.0095367431640625, -0.0198211669921875, 0.04046630859375, + 0.06732177734375, -0.032562255859375, 0.052032470703125, + 0.02166748046875, -0.021209716796875, -0.033935546875, + 0.0225982666015625, -0.008056640625, 0.006862640380859375, + 0.035552978515625, 0.0010929107666015625, + 0.006832122802734375, 0.012481689453125, -0.0239105224609375, + -0.0117950439453125, 0.004608154296875, 0.01525115966796875, + -0.049560546875, 0.048431396484375, -0.045501708984375, + 0.0196685791015625, 0.0521240234375, 0.00585174560546875, + -0.054107666015625, -0.036376953125, 0.04632568359375, + -0.06768798828125, -0.01151275634765625, 0.00713348388671875, + -0.0157928466796875, 0.0195770263671875, 0.03448486328125, + 0.01102447509765625, -0.00614166259765625, + 0.01256561279296875, 0.007549285888671875, + 0.0020580291748046875, -0.0272674560546875, 0.031707763671875, + 0.0144805908203125, 0.03839111328125, -0.0278778076171875, + -0.00634765625, 0.0008325576782226562, 0.00878143310546875, + -0.008514404296875, 0.06134033203125, -0.040191650390625, + -0.021484375, 0.003170013427734375, 0.029327392578125, + 0.003055572509765625, -0.00859832763671875, -0.02532958984375, + 0.0270538330078125, -0.035919189453125, 0.0270233154296875, + -0.0033893585205078125, -0.01428985595703125, 0.0377197265625, + 0.001129150390625, -0.005687713623046875, -0.03594970703125, + -0.0191802978515625, -0.0195770263671875, + 0.0004911422729492188, 0.0313720703125, -0.040771484375, + 0.0191802978515625, 0.06414794921875, 0.00946807861328125, + -0.05694580078125, 0.0130462646484375, -0.016510009765625, + -0.052764892578125, -0.0163116455078125, -0.018951416015625, + -0.03668212890625, -0.0084381103515625, + -0.0017042160034179688, -0.00557708740234375, + -0.03851318359375, 0.07061767578125, -0.049896240234375, + -0.0277252197265625, 0.0287322998046875, -0.02880859375, + 0.047088623046875, -0.030364990234375, -0.025054931640625, + -0.008270263671875, -0.04766845703125, -0.02618408203125, + -0.0643310546875, -0.002410888671875, 0.0355224609375, + -0.04705810546875, 0.03204345703125, 0.0369873046875, + 0.043701171875, -0.0550537109375, 0.01226043701171875, + -0.006168365478515625, 0.012237548828125, + 0.004772186279296875, 0.00537872314453125, 0.022552490234375, + -0.03302001953125, -0.0009675025939941406, -0.0103759765625, + -0.00447845458984375, -0.029510498046875, -0.0172576904296875, + 0.0028629302978515625, -0.0390625, 0.01015472412109375, + -0.006866455078125, 0.04296875, 0.028167724609375, + 0.0075225830078125, -0.01715087890625, 0.0215911865234375, + -0.0222625732421875, 0.006572723388671875, -0.037872314453125, + 0.015380859375, -0.003780364990234375, 0.0131683349609375, + 0.0540771484375, 0.0298919677734375, -0.07373046875, + 0.0330810546875, -0.02154541015625, 0.037506103515625, + 0.004802703857421875, -0.058837890625, 0.0113525390625, + 0.0028858184814453125, -0.007354736328125, + -0.01139068603515625, -0.06524658203125, -0.019317626953125, + 0.032623291015625, 0.00508880615234375, 0.021331787109375, + 0.0006260871887207031, -0.008514404296875, + 0.01102447509765625, 0.0150909423828125, 0.0099639892578125, + 0.01019287109375, -0.01428985595703125, 0.00167083740234375, + 0.047515869140625, -0.017364501953125, 0.01197052001953125, + -0.03564453125, -0.0462646484375, -0.017425537109375, + 0.055816650390625, 0.029937744140625, -0.045867919921875, + 0.06005859375, -0.0311737060546875, -0.00281524658203125, + -0.00878143310546875, -0.01318359375, -0.0246124267578125, + 0.0300140380859375, 0.0197296142578125, 0.0699462890625, + 0.00809478759765625, -0.03424072265625, 0.00490570068359375, + 0.046600341796875, -0.00392913818359375, 0.044769287109375, + 0.03271484375, 0.018768310546875, 0.0243072509765625, + 0.019378662109375, -0.038787841796875, -0.03131103515625, + 0.0158538818359375, 0.0335693359375, 0.0224456787109375, + 0.025848388671875, 0.007061004638671875, 0.0049285888671875, + -0.0595703125, 0.038726806640625, -0.0494384765625, + -0.06390380859375, -0.0011005401611328125, 0.0219268798828125, + -0.018798828125, 0.006317138671875, -0.0794677734375, + -0.00662994384765625, 0.00353240966796875, + 0.0020122528076171875, -0.0234527587890625, + 0.0159759521484375, 0.052032470703125, -0.038360595703125, + 0.01372528076171875, -0.00020372867584228516, + 0.021575927734375, -0.00679779052734375, -0.053985595703125, + -0.01056671142578125, -0.0272369384765625, + -0.0236053466796875, 0.023162841796875, 0.00165557861328125, + 0.0499267578125, 0.012908935546875, 0.033233642578125, + 0.08331298828125, 0.01042938232421875, 0.0039825439453125, + 0.00824737548828125, -0.0260772705078125, 0.0299530029296875, + -0.025299072265625, 0.032196044921875, 0.01166534423828125, + -0.010711669921875, -0.00376129150390625, -0.023162841796875, + 0.0157470703125, 0.01163482666015625, 0.002651214599609375, + 0.0198822021484375, 0.0246124267578125, -0.0152740478515625, + 0.004291534423828125, 0.032928466796875, 0.0141143798828125, + -0.024322509765625, -0.007518768310546875, 0.04766845703125, + -0.04901123046875, 0.0227508544921875, -0.0255584716796875, + -0.0141143798828125, -0.01641845703125, 0.0095367431640625, + 0.0183563232421875, 0.0184173583984375, 0.05340576171875, + 0.00008529424667358398, 0.03070068359375, + 0.0038967132568359375, -0.0161285400390625, + -0.006809234619140625, -0.0189361572265625, + -0.01512908935546875, -0.0167999267578125, 0.022003173828125, + -0.027374267578125, -0.03448486328125, -0.016998291015625, + -0.024627685546875, 0.045806884765625, -0.03558349609375, + -0.0439453125, -0.000728607177734375, -0.0036830902099609375, + -0.009368896484375, -0.0039520263671875, 0.026947021484375, + -0.01522064208984375, -0.00968170166015625, 0.06329345703125, + 0.037994384765625, 0.017242431640625, 0.0188751220703125, + 0.036865234375, 0.00426483154296875, 0.01039886474609375, + -0.01483154296875, -0.022216796875, -0.0118408203125, + 0.0484619140625, 0.01296234130859375, 0.0175018310546875, + 0.02081298828125, 0.0182037353515625, 0.010162353515625, + -0.003997802734375, -0.0299224853515625, 0.0654296875, + -0.0054168701171875, 0.01355743408203125, 0.032470703125, + -0.03521728515625, -0.04522705078125, 0.0218353271484375, + 0.0035457611083984375, -0.002376556396484375, -0.0419921875, + -0.0294342041015625, -0.0037860870361328125, + 0.01380157470703125, 0.0174713134765625, -0.0234527587890625, + 0.01428985595703125, 0.0014009475708007812, 0.01141357421875, + 0.0008606910705566406, -0.035858154296875, + -0.01201629638671875, 0.00235748291015625, 0.0251312255859375, + -0.019287109375, -0.0242156982421875, 0.01537322998046875, + -0.036956787109375, 0.00670623779296875, -0.0191650390625, + 0.0223846435546875, -0.007534027099609375, 0.0176849365234375, + -0.0187530517578125, 0.01541900634765625, 0.028289794921875, + -0.005496978759765625, 0.02801513671875, -0.02410888671875, + 0.023956298828125, -0.01284027099609375, -0.00730133056640625, + 0.01430511474609375, 0.03460693359375, -0.031982421875, + 0.0055694580078125, -0.005382537841796875, 0.047088623046875, + 0.0189361572265625, 0.0183868408203125, -0.0099945068359375, + -0.0172576904296875, 0.024444580078125, 0.0141754150390625, + 0.045562744140625, 0.0128021240234375, -0.0233917236328125, + -0.0251007080078125, -0.004085540771484375, + -0.0197906494140625, 0.008392333984375, -0.03021240234375, + 0.041046142578125, 0.0124664306640625, -0.0015897750854492188, + 0.0059967041015625, -0.006702423095703125, 0.0124664306640625, + 0.02105712890625, 0.04742431640625, 0.0295562744140625, + -0.04473876953125, 0.053680419921875, 0.0214385986328125, + -0.01190185546875, 0.003604888916015625, 0.004787445068359375, + 0.03082275390625, -0.00344085693359375, 0.0184173583984375, + -0.0284271240234375, 0.05914306640625, -0.0222625732421875, + -0.0287017822265625, 0.02880859375, -0.035003662109375, + -0.022186279296875, 0.0284881591796875, 0.0223388671875, + 0.0144500732421875, 0.043853759765625, 0.0281829833984375, + -0.047088623046875, -0.03582763671875, 0.04150390625, + 0.003925323486328125, 0.00934600830078125, -0.022003173828125, + -0.004741668701171875, -0.01403045654296875, + -0.04925537109375, -0.0005216598510742188, + -0.0065765380859375, 0.01715087890625, -0.0152130126953125, + 0.0200042724609375, -0.0130615234375, -0.0202484130859375, + -0.0025310516357421875, 0.0059661865234375, + 0.0185699462890625, -0.0101776123046875, -0.021728515625, + -0.01114654541015625, -0.0189361572265625, 0.0223541259765625, + 0.0265960693359375, -0.02960205078125, 0.019287109375, + -0.01416778564453125, 0.0121307373046875, 0.034515380859375, + -0.033782958984375, 0.000728607177734375, -0.03411865234375, + 0.00010061264038085938, 0.0010194778442382812, + 0.0228271484375, 0.009246826171875, -0.0114288330078125, + -0.00408935546875, 0.00986480712890625, -0.016845703125, + -0.039886474609375, -0.00739288330078125, + 0.007213592529296875, 0.0256805419921875, 0.01123809814453125, + 0.009185791015625, -0.03607177734375, 0.0251617431640625, + -0.017852783203125, -0.007503509521484375, -0.037750244140625, + -0.02001953125, -0.01474761962890625, -0.0113372802734375, + 0.0115814208984375, -0.00036406517028808594, + -0.014190673828125, -0.0032482147216796875, + 0.0017681121826171875, -0.0238494873046875, + -0.025299072265625, -0.0113525390625, 0.01398468017578125, + 0.01377105712890625, 0.01200103759765625, 0.00659942626953125, + -0.0007700920104980469, -0.05926513671875, 0.0075531005859375, + -0.033935546875, 0.00881195068359375, 0.002941131591796875, + -0.02313232421875, 0.02215576171875, 0.06939697265625, + -0.0294647216796875, -0.0032405853271484375, + -0.00983428955078125, -0.023223876953125, + -0.00310516357421875, -0.0014495849609375, + 0.01334381103515625, -0.0032253265380859375, 0.033447265625, + -0.0108642578125, 0.020355224609375, 0.0001189112663269043, + -0.0002608299255371094, -0.0404052734375, + 0.0038318634033203125, 0.0113983154296875, + -0.0255584716796875, -0.00572967529296875, 0.0184783935546875, + -0.0272064208984375, 0.01013946533203125, + -0.01021575927734375, -0.0146636962890625, + -0.0161285400390625, -0.022796630859375, 0.026214599609375, + -0.036590576171875, -0.0227813720703125, 0.0120086669921875, + 0.03369140625, -0.04632568359375, -0.012939453125, + -0.03302001953125, -0.035858154296875, 0.0019168853759765625, + -0.006450653076171875, 0.0162506103515625, 0.0193023681640625, + -0.00664520263671875, -0.01361083984375, 0.04168701171875, + -0.047821044921875, 0.011138916015625, -0.0188751220703125, + 0.00011795759201049805, -0.0157470703125, -0.01470947265625, + -0.01255035400390625, 0.0099334716796875, -0.0283355712890625, + 0.053131103515625, -0.02044677734375, -0.027008056640625, + -0.05059814453125, -0.01421356201171875, + 0.0009927749633789062, 0.0079803466796875, 0.0181884765625, + 0.0401611328125, 0.01983642578125, -0.028778076171875, + -0.004673004150390625, 0.0011386871337890625, + 0.0002682209014892578, -0.00746917724609375, + -0.038360595703125, -0.01195526123046875, -0.037689208984375, + 0.039764404296875, -0.0227813720703125, -0.00922393798828125, + -0.038116455078125, 0.0167388916015625, 0.01528167724609375, + -0.0020923614501953125, -0.0123291015625, + -0.007373809814453125, -0.04132080078125, 0.03277587890625, + -0.0265045166015625, 0.033172607421875, 0.0306549072265625, + -0.0022735595703125, 0.0080718994140625, -0.0269317626953125, + 0.0202178955078125, 0.0038299560546875, 0.022674560546875, + 0.00959014892578125, 0.039520263671875, 0.00336456298828125, + -0.0233917236328125, 0.0082855224609375, 0.01971435546875, + -0.035430908203125, 0.05047607421875, 0.006145477294921875, + -0.05767822265625, 0.00943756103515625, -0.005275726318359375, + 0.0142822265625, -0.012359619140625, -0.007305145263671875, + 0.006893157958984375, -0.023101806640625, 0.050323486328125, + -0.0291595458984375, 0.0227203369140625, -0.035614013671875, + 0.0396728515625, 0.00412750244140625, 0.034393310546875, + 0.00354766845703125, -0.032135009765625, -0.0251617431640625, + 0.003032684326171875, -0.0310211181640625, -0.033660888671875, + 0.0011720657348632812, -0.009918212890625, + -0.0187530517578125, -0.038116455078125, -0.0288543701171875, + 0.05987548828125, 0.005603790283203125, -0.032379150390625, + 0.0026187896728515625, 0.01201629638671875, + 0.001361846923828125, 0.0191497802734375, -0.00958251953125, + 0.01006317138671875, -0.01715087890625, -0.0546875, + -0.00728607177734375, 0.0243072509765625, 0.043853759765625, + -0.004398345947265625, -0.0305938720703125, + -0.0135650634765625, -0.0357666015625, -0.01088714599609375, + 0.01580810546875, 0.0311126708984375, 0.01107025146484375, + 0.0009198188781738281, 0.01346588134765625, + -0.00598907470703125, -0.031585693359375, 0.0192718505859375, + -0.0298919677734375, 0.024322509765625, -0.0038299560546875, + -0.03668212890625, -0.03363037109375, 0.01568603515625, + 0.027618408203125, -0.0020351409912109375, 0.029083251953125, + 0.0151824951171875, -0.025604248046875, -0.01169586181640625, + -0.003437042236328125, -0.030426025390625, -0.004547119140625, + -0.027496337890625, -0.017486572265625, 0.016510009765625, + 0.049224853515625, -0.044769287109375, 0.0099945068359375, + 0.03118896484375, -0.033172607421875, 0.018585205078125, + -0.032806396484375, 0.02734375, -0.03875732421875, + -0.05328369140625, 0.0248870849609375, 0.0003790855407714844, + -0.0165863037109375, -0.0008473396301269531, + 0.006267547607421875, -0.0216522216796875, + -0.004703521728515625, 0.0313720703125, -0.004276275634765625, + -0.0088653564453125, -0.01087188720703125, 0.032623291015625, + -0.046142578125, -0.0183563232421875, -0.00930023193359375, + 0.040618896484375, 0.006988525390625, 0.024169921875, + 0.007266998291015625, 0.013397216796875, 0.00238800048828125, + 0.00870513916015625, 0.02020263671875, -0.033050537109375, + 0.054840087890625, 0.023162841796875, -0.0002655982971191406, + -0.050750732421875, -0.023345947265625, -0.01496124267578125, + 0.02587890625, 0.00466156005859375, -0.01174163818359375, + 0.0265960693359375, -0.0006241798400878906, + -0.0022716522216796875, -0.0010480880737304688, + -0.01158905029296875, 0.0088043212890625, 0.01372528076171875, + -0.0122833251953125, 0.0022296905517578125, + -0.0183258056640625, 0.0221405029296875, 0.0283355712890625, + 0.042083740234375, -0.00858306884765625, -0.034881591796875, + 0.0240020751953125, 0.037689208984375, -0.01555633544921875, + -0.039154052734375, 0.05511474609375, 0.01129150390625, + 0.0042266845703125, 0.0019359588623046875, + -0.0081329345703125, 0.01029205322265625, + -0.002567291259765625, -0.0022258758544921875, + -0.0098876953125, -0.013153076171875, -0.035858154296875, + 0.01329803466796875, -0.01081085205078125, 0.0192718505859375, + 0.00901031494140625, 0.00010645389556884766, + 0.0134429931640625, -0.0038509368896484375, 0.01763916015625, + 0.0283355712890625, 0.01259613037109375, 0.00826263427734375, + 0.04632568359375, -0.054901123046875, -0.051239013671875, + 0.030975341796875, 0.0223846435546875, 0.0031890869140625, + -0.01381683349609375, -0.0230712890625, -0.00873565673828125, + 0.036590576171875, -0.010467529296875, -0.03173828125, + -0.004344940185546875, -0.03387451171875, + -0.00930023193359375, 0.0092620849609375, -0.0279541015625, + 0.0113372802734375, 0.0222930908203125, 0.0179901123046875, + -0.006481170654296875, -0.01105499267578125, + -0.005947113037109375, 0.005802154541015625, -0.0125732421875, + -0.00921630859375, -0.0013303756713867188, + -0.0197906494140625, -0.005924224853515625, + -0.0263214111328125, -0.01259613037109375, + -0.005962371826171875, 0.017303466796875, -0.0138397216796875, + -0.042022705078125, 0.0295562744140625, -0.015716552734375, + 0.0291748046875, 0.035552978515625, 0.00788116455078125, + -0.01380157470703125, -0.0011653900146484375, + -0.0090179443359375, -0.001216888427734375, + 0.0025177001953125, 0.0003676414489746094, 0.0197906494140625, + -0.02069091796875, 0.01342010498046875, 0.0030536651611328125, + 0.03173828125, -0.001850128173828125, -0.052215576171875, + -0.023193359375, -0.012176513671875, -0.0166778564453125, + -0.03997802734375, -0.041229248046875, -0.017974853515625, + -0.00385284423828125, 0.005035400390625, + -0.002956390380859375, 0.033843994140625, -0.01116943359375, + 0.0279083251953125, -0.0178070068359375, 0.024627685546875, + 0.032867431640625, 0.003444671630859375, 0.0240478515625, + -0.01445770263671875, 0.040771484375, -0.01230621337890625, + 0.00666046142578125, -0.008087158203125, 0.006805419921875, + -0.004276275634765625, 0.0221405029296875, -0.024749755859375, + 0.0400390625, 0.0138397216796875, 0.0361328125, + -0.0028705596923828125, -0.003787994384765625, + 0.06475830078125, 0.0302886962890625, -0.043304443359375, + -0.04559326171875, 0.020751953125, -0.0275115966796875, + -0.02569580078125, -0.01329803466796875, 0.003986358642578125, + 0.04998779296875, -0.0101776123046875, -0.0172119140625, + 0.048004150390625, 0.014007568359375, -0.0207061767578125, + -0.0168914794921875, 0.0146026611328125, 0.0286712646484375, + 0.03729248046875, -0.0244598388671875, 0.00667572021484375, + -0.0207366943359375, 0.03302001953125, 0.00540924072265625, + -0.0284576416015625, 0.01849365234375, -0.011444091796875, + 0.001476287841796875, -0.005615234375, 0.03778076171875, + 0.02642822265625, 0.01239776611328125, -0.01181793212890625, + 0.03521728515625, 0.013031005859375, 0.01139068603515625, + 0.00672149658203125, 0.024444580078125, 0.0197601318359375, + -0.0177001953125, -0.024200439453125, 0.0216827392578125, + -0.0004317760467529297, 0.00811767578125, -0.0131683349609375, + 0.0012493133544921875, -0.01227569580078125, + 0.0030918121337890625, 0.041107177734375, 0.012481689453125, + -0.029998779296875, -0.0092620849609375, -0.01904296875, + 0.0090484619140625, -0.0301055908203125, -0.00742340087890625, + -0.01364898681640625, 0.0297088623046875, 0.0328369140625, + -0.0116729736328125, 0.00152587890625, 0.045867919921875, + 0.0035400390625, -0.03497314453125, 0.023406982421875, + 0.03289794921875, -0.028076171875, 0.01800537109375, + 0.01024627685546875, -0.004169464111328125, -0.00396728515625, + -0.0245513916015625, -0.01021575927734375, -0.031585693359375, + -0.05474853515625, 0.0168304443359375, 0.026519775390625, + 0.0267333984375, -0.01230621337890625, -0.0149383544921875, + 0.0204620361328125, 0.015380859375, -0.0626220703125, + -0.0162353515625, 0.0220794677734375, -0.0171356201171875, + -0.01561737060546875, -0.035980224609375, 0.0192718505859375, + 0.043701171875, 0.0413818359375, 0.03314208984375, + 0.00016868114471435547, -0.000579833984375, + -0.0177154541015625, -0.037384033203125, 0.0377197265625, + 0.0264739990234375, 0.01340484619140625, 0.02313232421875, + 0.04119873046875, -0.0037288665771484375, -0.0226287841796875, + -0.0005016326904296875, 0.00885772705078125, + -0.0029125213623046875, 0.007633209228515625, 0.00732421875, + -0.0113983154296875, 0.00392913818359375, + -0.00774383544921875, -0.040008544921875, -0.0231781005859375, + 0.007091522216796875, -0.0286865234375, 0.032440185546875, + 0.0177001953125, -0.015167236328125, 0.0082550048828125, + -0.01465606689453125, 0.01073455810546875, + 0.007236480712890625, 0.00146484375, 0.03265380859375, + -0.0084686279296875, 0.0301361083984375, 0.0013427734375, + -0.01102447509765625, -0.0197906494140625, + 0.01364898681640625, -0.031219482421875, -0.0229034423828125, + 0.0275115966796875, 0.0003364086151123047, 0.050811767578125, + 0.0234222412109375, 0.01097869873046875, -0.017974853515625, + -0.0154876708984375, 0.016876220703125, 0.0070037841796875, + 0.00920867919921875, -0.0135040283203125, -0.019073486328125, + 0.028564453125, 0.00928497314453125, 0.030181884765625, + -0.01273345947265625, 0.00492095947265625, + 0.0024242401123046875, -0.06781005859375, -0.00714111328125, + 0.0021343231201171875, 0.003330230712890625, + -0.0007662773132324219, 0.019500732421875, 0.0095062255859375, + -0.0262298583984375, -0.00960540771484375, + 0.006473541259765625, 0.05169677734375, -0.017730712890625, + 0.0238037109375, -0.0214691162109375, 0.0304412841796875, + -0.0126190185546875, -0.03070068359375, -0.037078857421875, + 0.022369384765625, 0.034515380859375, -0.0205841064453125, + 0.004116058349609375, -0.038787841796875, -0.0221710205078125, + -0.024993896484375, -0.021453857421875, + -0.0003190040588378906, 0.0036602020263671875, + 0.0107269287109375, 0.0152435302734375, -0.016265869140625, + -0.0222930908203125, 0.0105133056640625, -0.0185546875, + -0.015045166015625, 0.0134735107421875, 0.002307891845703125, + 0.007579803466796875, -0.0022735595703125, 0.0276336669921875, + 0.0083160400390625, 0.01552581787109375, + -0.007038116455078125, 0.008331298828125, -0.0135955810546875, + 0.020721435546875, 0.050933837890625, 0.0147552490234375, + 0.0205841064453125, -0.00490570068359375, 0.038299560546875, + 0.0301055908203125, 0.05523681640625, 0.00766754150390625, + 0.00782012939453125, -0.00164794921875, 0.0191497802734375, + 0.002674102783203125, -0.017242431640625, 0.02203369140625, + -0.0187835693359375, 0.0350341796875, -0.01007080078125, + -0.04803466796875, 0.01506805419921875, -0.031646728515625, + 0.0182342529296875, 0.0239105224609375, 0.0435791015625, + 0.0156097412109375, -0.0275115966796875, 0.0169525146484375, + -0.0036716461181640625, 0.0154571533203125, + -0.00377655029296875, -0.003070831298828125, + 0.034332275390625, -0.0034275054931640625, + -0.0285797119140625, -0.03607177734375, + -0.0008091926574707031, -0.0127410888671875, -0.036376953125, + -0.007793426513671875, -0.043792724609375, 0.0270538330078125, + -0.058013916015625, -0.01438140869140625, + 0.007251739501953125, 0.045013427734375, 0.00720977783203125, + 0.0254058837890625, 0.054718017578125, 0.0061798095703125, + -0.0198822021484375, 0.010162353515625, -0.035919189453125, + 0.0014743804931640625, -0.0060577392578125, -0.02752685546875, + -0.01453399658203125, -0.0137481689453125, + -0.00218963623046875, -0.0038661956787109375, + 0.006755828857421875, 0.00434112548828125, -0.020294189453125, + 0.0181884765625, -0.004611968994140625, -0.0200042724609375, + 0.034454345703125, -0.0709228515625, -0.028533935546875, + 0.0260772705078125, -0.044677734375, 0.021240234375, + 0.032470703125, 0.0162811279296875, -0.01093292236328125, + -0.01284027099609375, -0.028900146484375, + 0.0009975433349609375, -0.0187835693359375, + 0.0098419189453125, 0.0171966552734375, 0.030670166015625, + 0.00463104248046875, -0.022796630859375, 0.0117950439453125, + -0.028472900390625, -0.021148681640625, -0.039337158203125, + 0.0176544189453125, -0.038238525390625, -0.039581298828125, + 0.002685546875, -0.01483154296875, 0.00533294677734375, + 0.0000928044319152832, 0.01045989990234375, -0.01025390625, + -0.0207061767578125, -0.025665283203125, 0.0222015380859375, + -0.0111083984375, 0.023406982421875, -0.0209197998046875, + -0.0036716461181640625, -0.037689208984375, + 0.0189056396484375, 0.0112457275390625, -0.016204833984375, + 0.0017604827880859375, 0.01241302490234375, + -0.0038776397705078125, -0.00168609619140625, 0.043701171875, + -0.0297698974609375, 0.005054473876953125, + -0.0214385986328125, -0.026611328125, -0.01385498046875, + 0.00682830810546875, -0.0007939338684082031, + 0.030181884765625, 0.051513671875, -0.04296875, + -0.037811279296875, -0.0005049705505371094, + 0.01035308837890625, 0.0136260986328125, 0.025604248046875, + 0.0211334228515625, -0.01605224609375, -0.0228118896484375, + -0.004764556884765625, 0.01377105712890625, + -0.01389312744140625, 0.0256805419921875, + 0.0035343170166015625, -0.026397705078125, + -0.0199737548828125, -0.018646240234375, -0.025054931640625, + 0.02752685546875, 0.01459503173828125, -0.002986907958984375, + 0.038421630859375, -0.0166168212890625, 0.00832366943359375, + 0.06048583984375, 0.0234527587890625, 0.01180267333984375, + 0.00638580322265625, -0.0140838623046875, -0.0074615478515625, + -0.00616455078125, -0.02105712890625, 0.000720977783203125, + -0.01064300537109375, 0.00774383544921875, 0.016632080078125, + 0.0108795166015625, -0.0135498046875, 0.00914764404296875, + 0.034332275390625, -0.01390838623046875, -0.037353515625, + -0.0296173095703125, 0.01849365234375, -0.0230255126953125, + 0.01108551025390625, -0.0214691162109375, 0.0247955322265625, + -0.00872802734375, 0.0184478759765625, 0.00928497314453125, + 0.0202484130859375, 0.0223541259765625, 0.006092071533203125, + 0.035430908203125, -0.035614013671875, -0.0004284381866455078, + -0.0036907196044921875, 0.0053863525390625, + 0.002460479736328125, 0.00722503662109375, + -0.0257110595703125, 0.00926971435546875, 0.00696563720703125, + -0.007740020751953125, 0.01490020751953125, -0.03143310546875, + 0.0160980224609375, -0.0022335052490234375, 0.0146484375, + 0.01129913330078125, 0.019683837890625, -0.0193634033203125, + 0.0092620849609375, 0.01381683349609375, 0.001338958740234375, + 0.01309967041015625, -0.0032100677490234375, + -0.00939178466796875, 0.02569580078125, 0.030731201171875, + 0.023895263671875, 0.0019083023071289062, -0.0124969482421875, + -0.01023101806640625, -0.03558349609375, 0.022857666015625, + -0.000028312206268310547, 0.0123291015625, 0.005157470703125, + -0.01056671142578125, 0.005367279052734375, 0.009490966796875, + 0.005687713623046875, -0.00585174560546875, + 0.01279449462890625, -0.01137542724609375, + 0.005809783935546875, 0.0124359130859375, + -0.006900787353515625, 0.04034423828125, -0.0111083984375, + -0.0012426376342773438, 0.0159454345703125, -0.0450439453125, + -0.01468658447265625, 0.00832366943359375, + -0.01213836669921875, -0.0028018951416015625, + 0.0014476776123046875, -0.00453948974609375, + -0.003498077392578125, -0.0117645263671875, + 0.00293731689453125, -0.0258941650390625, 0.008209228515625, + -0.00203704833984375, 0.0144195556640625, 0.036346435546875, + -0.0119476318359375, -0.03778076171875, 0.0245819091796875, + -0.035858154296875, 0.0084991455078125, 0.01824951171875, + 0.0088653564453125, -0.0467529296875, 0.01412200927734375, + 0.01203155517578125, -0.0232391357421875, + -0.00788116455078125, 0.0123443603515625, -0.031036376953125, + 0.003704071044921875, 0.0136260986328125, + 0.0031147003173828125, 0.0007843971252441406, + 0.00490570068359375 + ], + "index": 0, + "object": "embedding" + } + ], + "model": "text-embedding-3-small", + "object": "list", + "usage": { + "prompt_tokens": 7, + "total_tokens": 7 + } + } + }, + "headers": { + "access-control-expose-headers": "X-Request-ID, CF-Ray, CF-Ray", + "alt-svc": "h3=\":443\"; ma=86400", + "cf-cache-status": "DYNAMIC", + "cf-ray": "a0c1cdf768f93249-VIE", + "connection": "keep-alive", + "content-encoding": "gzip", + "content-type": "application/json", + "date": "Mon, 15 Jun 2026 13:08:37 GMT", + "openai-organization": "braintrust-data", + "openai-processing-ms": "42", + "openai-project": "proj_vsCSXafhhByzWOThMrJcZiw9", + "openai-version": "2020-10-01", + "server": "cloudflare", + "set-cookie": "[REDACTED]", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-openai-proxy-wasm": "v0.1", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "10000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "9999993", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "0s", + "x-request-id": "req_03dbab6160094a719bcbc01a4069874d" + }, + "status": 200, + "statusText": "OK" + } + }, + { + "callIndex": 1, + "id": "43d0f8f8c8d2a679", + "matchKey": "POST api.openai.com/v1/embeddings", + "recordedAt": "2026-06-15T13:08:37.963Z", + "request": { + "body": { + "kind": "json", + "value": { + "encoding_format": "float", + "input": [ + "Paris is in France.", + "Berlin is in Germany.", + "Vienna is in Austria." + ], + "model": "text-embedding-3-small" + } + }, + "headers": {}, + "method": "POST", + "url": "https://api.openai.com/v1/embeddings" + }, + "response": { + "body": { + "contentType": "application/json", + "kind": "binary", + "path": "ai-sdk-v7.cassette.blobs/831ef4f50b23e36798adeddf0314b9154707117acf2e6a8637b8c57a8db961b0.bin", + "sha256": "831ef4f50b23e36798adeddf0314b9154707117acf2e6a8637b8c57a8db961b0" + }, + "headers": { + "access-control-expose-headers": "X-Request-ID, CF-Ray, CF-Ray", + "alt-svc": "h3=\":443\"; ma=86400", + "cf-cache-status": "DYNAMIC", + "cf-ray": "a0c1cdf8a9ec3249-VIE", + "connection": "keep-alive", + "content-encoding": "gzip", + "content-type": "application/json", + "date": "Mon, 15 Jun 2026 13:08:38 GMT", + "openai-organization": "braintrust-data", + "openai-processing-ms": "83", + "openai-project": "proj_vsCSXafhhByzWOThMrJcZiw9", + "openai-version": "2020-10-01", + "server": "cloudflare", + "set-cookie": "[REDACTED]", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-openai-proxy-wasm": "v0.1", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "10000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "9999985", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "0s", + "x-request-id": "req_130d8dd80ff340f3be99289a6f249e78" + }, + "status": 200, + "statusText": "OK" + } + }, + { + "callIndex": 3, + "id": "83cbbf6da482c905", + "matchKey": "POST api.openai.com/v1/responses", + "recordedAt": "2026-06-15T13:08:39.460Z", + "request": { + "body": { + "kind": "json", + "value": { + "input": [ + { + "content": "You must inspect live weather via the provided get_weather tool before responding.", + "role": "system" + }, + { + "content": [ + { + "text": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + "type": "input_text" + } + ], + "role": "user" + } + ], + "max_output_tokens": 128, + "model": "gpt-4o-mini-2024-07-18", + "temperature": 0, + "tool_choice": "required", + "tools": [ + { + "description": "Get the weather for a location", + "name": "get_weather", + "parameters": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "location": { + "description": "The city and country", + "type": "string" + } + }, + "required": ["location"], + "type": "object" + }, + "type": "function" + } + ] + } + }, + "headers": {}, + "method": "POST", + "url": "https://api.openai.com/v1/responses" + }, + "response": { + "body": { + "kind": "json", + "value": { + "background": false, + "billing": { + "payer": "developer" + }, + "completed_at": 1781528919, + "created_at": 1781528918, + "error": null, + "frequency_penalty": 0, + "id": "resp_0b25a1d2d8c902f6006a2ff9562f3881a39ccc1431e249b362", + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 128, + "max_tool_calls": null, + "metadata": {}, + "model": "gpt-4o-mini-2024-07-18", + "moderation": null, + "object": "response", + "output": [ + { + "arguments": "{\"location\":\"Paris, France\"}", + "call_id": "call_AvQX7688fhEaCdlxjn3wmZeZ", + "id": "fc_0b25a1d2d8c902f6006a2ff957358081a38b137a8dbbf2df4e", + "name": "get_weather", + "status": "completed", + "type": "function_call" + } + ], + "parallel_tool_calls": true, + "presence_penalty": 0, + "previous_response_id": null, + "prompt_cache_key": "[REDACTED]", + "prompt_cache_retention": "in_memory", + "reasoning": { + "context": null, + "effort": null, + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "status": "completed", + "store": true, + "temperature": 0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "required", + "tools": [ + { + "description": "Get the weather for a location", + "name": "get_weather", + "parameters": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "location": { + "description": "The city and country", + "type": "string" + } + }, + "required": ["location"], + "type": "object" + }, + "strict": true, + "type": "function" + } + ], + "top_logprobs": 0, + "top_p": 1, + "truncation": "disabled", + "usage": { + "input_tokens": 94, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 102 + }, + "user": null + } + }, + "headers": { + "access-control-expose-headers": "X-Request-ID, CF-Ray, CF-Ray", + "alt-svc": "h3=\":443\"; ma=86400", + "cf-cache-status": "DYNAMIC", + "cf-ray": "a0c1cdf9fb223249-VIE", + "connection": "keep-alive", + "content-encoding": "gzip", + "content-type": "application/json", + "date": "Mon, 15 Jun 2026 13:08:39 GMT", + "openai-organization": "braintrust-data", + "openai-processing-ms": "1309", + "openai-project": "proj_vsCSXafhhByzWOThMrJcZiw9", + "openai-version": "2020-10-01", + "server": "cloudflare", + "set-cookie": "[REDACTED]", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-ratelimit-limit-requests": "30000", + "x-ratelimit-limit-tokens": "150000000", + "x-ratelimit-remaining-requests": "29999", + "x-ratelimit-remaining-tokens": "149999690", + "x-ratelimit-reset-requests": "2ms", + "x-ratelimit-reset-tokens": "0s", + "x-request-id": "req_9c1f789f969d498fb28a0c780f54e9d8" + }, + "status": 200, + "statusText": "OK" + } + }, + { + "callIndex": 4, + "id": "417e64addcf59da7", + "matchKey": "POST api.openai.com/v1/responses", + "recordedAt": "2026-06-15T13:08:41.140Z", + "request": { + "body": { + "kind": "json", + "value": { + "input": [ + { + "content": "You must inspect live weather via the provided get_weather tool before responding.", + "role": "system" + }, + { + "content": [ + { + "text": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + "type": "input_text" + } + ], + "role": "user" + }, + { + "id": "fc_0b25a1d2d8c902f6006a2ff957358081a38b137a8dbbf2df4e", + "type": "item_reference" + }, + { + "call_id": "call_AvQX7688fhEaCdlxjn3wmZeZ", + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "type": "function_call_output" + } + ], + "max_output_tokens": 128, + "model": "gpt-4o-mini-2024-07-18", + "temperature": 0, + "tool_choice": "required", + "tools": [ + { + "description": "Get the weather for a location", + "name": "get_weather", + "parameters": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "location": { + "description": "The city and country", + "type": "string" + } + }, + "required": ["location"], + "type": "object" + }, + "type": "function" + } + ] + } + }, + "headers": {}, + "method": "POST", + "url": "https://api.openai.com/v1/responses" + }, + "response": { + "body": { + "kind": "json", + "value": { + "background": false, + "billing": { + "payer": "developer" + }, + "completed_at": 1781528921, + "created_at": 1781528919, + "error": null, + "frequency_penalty": 0, + "id": "resp_0b25a1d2d8c902f6006a2ff957b31481a3a25543b14b094372", + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 128, + "max_tool_calls": null, + "metadata": {}, + "model": "gpt-4o-mini-2024-07-18", + "moderation": null, + "object": "response", + "output": [ + { + "arguments": "{\"location\":\"Paris, France\"}", + "call_id": "call_XSXU38q42QnVKyDrElH4Obkg", + "id": "fc_0b25a1d2d8c902f6006a2ff958eac481a39747145bfcbd44a9", + "name": "get_weather", + "status": "completed", + "type": "function_call" + } + ], + "parallel_tool_calls": true, + "presence_penalty": 0, + "previous_response_id": null, + "prompt_cache_key": "[REDACTED]", + "prompt_cache_retention": "in_memory", + "reasoning": { + "context": null, + "effort": null, + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "status": "completed", + "store": true, + "temperature": 0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "required", + "tools": [ + { + "description": "Get the weather for a location", + "name": "get_weather", + "parameters": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "location": { + "description": "The city and country", + "type": "string" + } + }, + "required": ["location"], + "type": "object" + }, + "strict": true, + "type": "function" + } + ], + "top_logprobs": 0, + "top_p": 1, + "truncation": "disabled", + "usage": { + "input_tokens": 133, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 141 + }, + "user": null + } + }, + "headers": { + "access-control-expose-headers": "X-Request-ID, CF-Ray, CF-Ray", + "alt-svc": "h3=\":443\"; ma=86400", + "cf-cache-status": "DYNAMIC", + "cf-ray": "a0c1ce034b363249-VIE", + "connection": "keep-alive", + "content-encoding": "gzip", + "content-type": "application/json", + "date": "Mon, 15 Jun 2026 13:08:41 GMT", + "openai-organization": "braintrust-data", + "openai-processing-ms": "1478", + "openai-project": "proj_vsCSXafhhByzWOThMrJcZiw9", + "openai-version": "2020-10-01", + "server": "cloudflare", + "set-cookie": "[REDACTED]", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-ratelimit-limit-requests": "30000", + "x-ratelimit-limit-tokens": "150000000", + "x-ratelimit-remaining-requests": "29999", + "x-ratelimit-remaining-tokens": "149999650", + "x-ratelimit-reset-requests": "2ms", + "x-ratelimit-reset-tokens": "0s", + "x-request-id": "req_72a976cf46384707ba8f41bbc737cf3b" + }, + "status": 200, + "statusText": "OK" + } + }, + { + "callIndex": 5, + "id": "341675a0a1a88c63", + "matchKey": "POST api.openai.com/v1/responses", + "recordedAt": "2026-06-15T13:08:42.343Z", + "request": { + "body": { + "kind": "json", + "value": { + "input": [ + { + "content": "You must inspect live weather via the provided get_weather tool before responding.", + "role": "system" + }, + { + "content": [ + { + "text": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + "type": "input_text" + } + ], + "role": "user" + }, + { + "id": "fc_0b25a1d2d8c902f6006a2ff957358081a38b137a8dbbf2df4e", + "type": "item_reference" + }, + { + "call_id": "call_AvQX7688fhEaCdlxjn3wmZeZ", + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "type": "function_call_output" + }, + { + "id": "fc_0b25a1d2d8c902f6006a2ff958eac481a39747145bfcbd44a9", + "type": "item_reference" + }, + { + "call_id": "call_XSXU38q42QnVKyDrElH4Obkg", + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "type": "function_call_output" + } + ], + "max_output_tokens": 128, + "model": "gpt-4o-mini-2024-07-18", + "temperature": 0, + "tool_choice": "required", + "tools": [ + { + "description": "Get the weather for a location", + "name": "get_weather", + "parameters": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "location": { + "description": "The city and country", + "type": "string" + } + }, + "required": ["location"], + "type": "object" + }, + "type": "function" + } + ] + } + }, + "headers": {}, + "method": "POST", + "url": "https://api.openai.com/v1/responses" + }, + "response": { + "body": { + "kind": "json", + "value": { + "background": false, + "billing": { + "payer": "developer" + }, + "completed_at": 1781528922, + "created_at": 1781528921, + "error": null, + "frequency_penalty": 0, + "id": "resp_0b25a1d2d8c902f6006a2ff9595f2081a38f8aa915715e7646", + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 128, + "max_tool_calls": null, + "metadata": {}, + "model": "gpt-4o-mini-2024-07-18", + "moderation": null, + "object": "response", + "output": [ + { + "arguments": "{\"location\":\"Paris, France\"}", + "call_id": "call_of374lHpH3YYQpti3LoZMJz8", + "id": "fc_0b25a1d2d8c902f6006a2ff95a165481a3959ecf69f5beea46", + "name": "get_weather", + "status": "completed", + "type": "function_call" + } + ], + "parallel_tool_calls": true, + "presence_penalty": 0, + "previous_response_id": null, + "prompt_cache_key": "[REDACTED]", + "prompt_cache_retention": "in_memory", + "reasoning": { + "context": null, + "effort": null, + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "status": "completed", + "store": true, + "temperature": 0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "required", + "tools": [ + { + "description": "Get the weather for a location", + "name": "get_weather", + "parameters": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "location": { + "description": "The city and country", + "type": "string" + } + }, + "required": ["location"], + "type": "object" + }, + "strict": true, + "type": "function" + } + ], + "top_logprobs": 0, + "top_p": 1, + "truncation": "disabled", + "usage": { + "input_tokens": 172, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 180 + }, + "user": null + } + }, + "headers": { + "access-control-expose-headers": "X-Request-ID, CF-Ray, CF-Ray", + "alt-svc": "h3=\":443\"; ma=86400", + "cf-cache-status": "DYNAMIC", + "cf-ray": "a0c1ce0dcc613249-VIE", + "connection": "keep-alive", + "content-encoding": "gzip", + "content-type": "application/json", + "date": "Mon, 15 Jun 2026 13:08:42 GMT", + "openai-organization": "braintrust-data", + "openai-processing-ms": "1035", + "openai-project": "proj_vsCSXafhhByzWOThMrJcZiw9", + "openai-version": "2020-10-01", + "server": "cloudflare", + "set-cookie": "[REDACTED]", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-ratelimit-limit-requests": "30000", + "x-ratelimit-limit-tokens": "150000000", + "x-ratelimit-remaining-requests": "29999", + "x-ratelimit-remaining-tokens": "149999612", + "x-ratelimit-reset-requests": "2ms", + "x-ratelimit-reset-tokens": "0s", + "x-request-id": "req_49d7920b1bae4f0da8fa87a9331efed2" + }, + "status": 200, + "statusText": "OK" + } + }, + { + "callIndex": 6, + "id": "cbb9070d68f84d1b", + "matchKey": "POST api.openai.com/v1/responses", + "recordedAt": "2026-06-15T13:08:43.548Z", + "request": { + "body": { + "kind": "json", + "value": { + "input": [ + { + "content": "You must inspect live weather via the provided get_weather tool before responding.", + "role": "system" + }, + { + "content": [ + { + "text": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + "type": "input_text" + } + ], + "role": "user" + }, + { + "id": "fc_0b25a1d2d8c902f6006a2ff957358081a38b137a8dbbf2df4e", + "type": "item_reference" + }, + { + "call_id": "call_AvQX7688fhEaCdlxjn3wmZeZ", + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "type": "function_call_output" + }, + { + "id": "fc_0b25a1d2d8c902f6006a2ff958eac481a39747145bfcbd44a9", + "type": "item_reference" + }, + { + "call_id": "call_XSXU38q42QnVKyDrElH4Obkg", + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "type": "function_call_output" + }, + { + "id": "fc_0b25a1d2d8c902f6006a2ff95a165481a3959ecf69f5beea46", + "type": "item_reference" + }, + { + "call_id": "call_of374lHpH3YYQpti3LoZMJz8", + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "type": "function_call_output" + } + ], + "max_output_tokens": 128, + "model": "gpt-4o-mini-2024-07-18", + "temperature": 0, + "tool_choice": "required", + "tools": [ + { + "description": "Get the weather for a location", + "name": "get_weather", + "parameters": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "location": { + "description": "The city and country", + "type": "string" + } + }, + "required": ["location"], + "type": "object" + }, + "type": "function" + } + ] + } + }, + "headers": {}, + "method": "POST", + "url": "https://api.openai.com/v1/responses" + }, + "response": { + "body": { + "kind": "json", + "value": { + "background": false, + "billing": { + "payer": "developer" + }, + "completed_at": 1781528923, + "created_at": 1781528922, + "error": null, + "frequency_penalty": 0, + "id": "resp_0b25a1d2d8c902f6006a2ff95a8dd481a3847100dca2e05e64", + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 128, + "max_tool_calls": null, + "metadata": {}, + "model": "gpt-4o-mini-2024-07-18", + "moderation": null, + "object": "response", + "output": [ + { + "arguments": "{\"location\":\"Paris, France\"}", + "call_id": "call_nfHRx6yknrL5pAQPlKeRYu8d", + "id": "fc_0b25a1d2d8c902f6006a2ff95b435c81a39123ec9099a17d27", + "name": "get_weather", + "status": "completed", + "type": "function_call" + } + ], + "parallel_tool_calls": true, + "presence_penalty": 0, + "previous_response_id": null, + "prompt_cache_key": "[REDACTED]", + "prompt_cache_retention": "in_memory", + "reasoning": { + "context": null, + "effort": null, + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "status": "completed", + "store": true, + "temperature": 0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "required", + "tools": [ + { + "description": "Get the weather for a location", + "name": "get_weather", + "parameters": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "location": { + "description": "The city and country", + "type": "string" + } + }, + "required": ["location"], + "type": "object" + }, + "strict": true, + "type": "function" + } + ], + "top_logprobs": 0, + "top_p": 1, + "truncation": "disabled", + "usage": { + "input_tokens": 211, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 219 + }, + "user": null + } + }, + "headers": { + "access-control-expose-headers": "X-Request-ID, CF-Ray, CF-Ray", + "alt-svc": "h3=\":443\"; ma=86400", + "cf-cache-status": "DYNAMIC", + "cf-ray": "a0c1ce154acb3249-VIE", + "connection": "keep-alive", + "content-encoding": "gzip", + "content-type": "application/json", + "date": "Mon, 15 Jun 2026 13:08:43 GMT", + "openai-organization": "braintrust-data", + "openai-processing-ms": "1029", + "openai-project": "proj_vsCSXafhhByzWOThMrJcZiw9", + "openai-version": "2020-10-01", + "server": "cloudflare", + "set-cookie": "[REDACTED]", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-ratelimit-limit-requests": "30000", + "x-ratelimit-limit-tokens": "150000000", + "x-ratelimit-remaining-requests": "29999", + "x-ratelimit-remaining-tokens": "149999572", + "x-ratelimit-reset-requests": "2ms", + "x-ratelimit-reset-tokens": "0s", + "x-request-id": "req_eec9413044834713a0935560ff057d17" + }, + "status": 200, + "statusText": "OK" + } + }, + { + "callIndex": 7, + "id": "bccc54d212e2503d", + "matchKey": "POST api.openai.com/v1/responses", + "recordedAt": "2026-06-15T13:08:44.902Z", + "request": { + "body": { + "kind": "json", + "value": { + "input": [ + { + "content": [ + { + "text": "Return JSON with {\"city\":\"Paris\"}.", + "type": "input_text" + } + ], + "role": "user" + } + ], + "max_output_tokens": 32, + "model": "gpt-4o-mini-2024-07-18", + "temperature": 0, + "text": { + "format": { + "name": "response", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "city": { + "type": "string" + } + }, + "required": ["city"], + "type": "object" + }, + "strict": true, + "type": "json_schema" + } + } + } + }, + "headers": {}, + "method": "POST", + "url": "https://api.openai.com/v1/responses" + }, + "response": { + "body": { + "kind": "json", + "value": { + "background": false, + "billing": { + "payer": "developer" + }, + "completed_at": 1781528924, + "created_at": 1781528923, + "error": null, + "frequency_penalty": 0, + "id": "resp_0edc151d34749c0a006a2ff95bc61c8192830a0789e2952249", + "incomplete_details": null, + "instructions": null, + "max_output_tokens": 32, + "max_tool_calls": null, + "metadata": {}, + "model": "gpt-4o-mini-2024-07-18", + "moderation": null, + "object": "response", + "output": [ + { + "content": [ + { + "annotations": [], + "logprobs": [], + "text": "{\"city\":\"Paris\"}", + "type": "output_text" + } + ], + "id": "msg_0edc151d34749c0a006a2ff95cae188192bd080dc85e574076", + "role": "assistant", + "status": "completed", + "type": "message" + } + ], + "parallel_tool_calls": true, + "presence_penalty": 0, + "previous_response_id": null, + "prompt_cache_key": "[REDACTED]", + "prompt_cache_retention": "in_memory", + "reasoning": { + "context": null, + "effort": null, + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "status": "completed", + "store": true, + "temperature": 0, + "text": { + "format": { + "description": null, + "name": "response", + "schema": { + "additionalProperties": false, + "properties": { + "city": { + "type": "string" + } + }, + "required": ["city"], + "type": "object" + }, + "strict": true, + "type": "json_schema" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [], + "top_logprobs": 0, + "top_p": 1, + "truncation": "disabled", + "usage": { + "input_tokens": 38, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 6, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 44 + }, + "user": null + } + }, + "headers": { + "access-control-expose-headers": "X-Request-ID, CF-Ray, CF-Ray", + "alt-svc": "h3=\":443\"; ma=86400", + "cf-cache-status": "DYNAMIC", + "cf-ray": "a0c1ce1ce95c3249-VIE", + "connection": "keep-alive", + "content-encoding": "gzip", + "content-type": "application/json", + "date": "Mon, 15 Jun 2026 13:08:44 GMT", + "openai-organization": "braintrust-data", + "openai-processing-ms": "1173", + "openai-project": "proj_vsCSXafhhByzWOThMrJcZiw9", + "openai-version": "2020-10-01", + "server": "cloudflare", + "set-cookie": "[REDACTED]", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-ratelimit-limit-requests": "30000", + "x-ratelimit-limit-tokens": "150000000", + "x-ratelimit-remaining-requests": "29999", + "x-ratelimit-remaining-tokens": "149999942", + "x-ratelimit-reset-requests": "2ms", + "x-ratelimit-reset-tokens": "0s", + "x-request-id": "req_f88919222bd54f849db8d5d44579efa8" + }, + "status": 200, + "statusText": "OK" + } + }, + { + "callIndex": 8, + "id": "8eec740c1be01c5c", + "matchKey": "POST api.openai.com/v1/responses", + "recordedAt": "2026-06-15T13:08:45.904Z", + "request": { + "body": { + "kind": "json", + "value": { + "input": [ + { + "content": [ + { + "text": "Stream JSON with {\"city\":\"Paris\"}.", + "type": "input_text" + } + ], + "role": "user" + } + ], + "max_output_tokens": 32, + "model": "gpt-4o-mini-2024-07-18", + "stream": true, + "temperature": 0, + "text": { + "format": { + "name": "response", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "city": { + "type": "string" + } + }, + "required": ["city"], + "type": "object" + }, + "strict": true, + "type": "json_schema" + } + } + } + }, + "headers": {}, + "method": "POST", + "url": "https://api.openai.com/v1/responses" + }, + "response": { + "body": { + "chunks": [ + "event: response.created\ndata: {\"type\":\"response.created\",\"response\":{\"id\":\"resp_0418ddb09e120f3d006a2ff95d20048192bb64d14000f93e29\",\"object\":\"response\",\"created_at\":1781528925,\"status\":\"in_progress\",\"background\":false,\"completed_at\":null,\"error\":null,\"frequency_penalty\":0,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":32,\"max_tool_calls\":null,\"model\":\"gpt-4o-mini-2024-07-18\",\"moderation\":null,\"output\":[],\"parallel_tool_calls\":true,\"presence_penalty\":0,\"previous_response_id\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":\"in_memory\",\"reasoning\":{\"context\":null,\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":true},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}},\"sequence_number\":0}", + "event: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"response\":{\"id\":\"resp_0418ddb09e120f3d006a2ff95d20048192bb64d14000f93e29\",\"object\":\"response\",\"created_at\":1781528925,\"status\":\"in_progress\",\"background\":false,\"completed_at\":null,\"error\":null,\"frequency_penalty\":0,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":32,\"max_tool_calls\":null,\"model\":\"gpt-4o-mini-2024-07-18\",\"moderation\":null,\"output\":[],\"parallel_tool_calls\":true,\"presence_penalty\":0,\"previous_response_id\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":\"in_memory\",\"reasoning\":{\"context\":null,\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"auto\",\"store\":true,\"temperature\":0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":true},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1,\"truncation\":\"disabled\",\"usage\":null,\"user\":null,\"metadata\":{}},\"sequence_number\":1}", + "event: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"item\":{\"id\":\"msg_0418ddb09e120f3d006a2ff95d96548192a0f5f1a115863f8e\",\"type\":\"message\",\"status\":\"in_progress\",\"content\":[],\"role\":\"assistant\"},\"output_index\":0,\"sequence_number\":2}", + "event: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"content_index\":0,\"item_id\":\"msg_0418ddb09e120f3d006a2ff95d96548192a0f5f1a115863f8e\",\"output_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"\"},\"sequence_number\":3}", + "event: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"content_index\":0,\"delta\":\"{\\\"\",\"item_id\":\"msg_0418ddb09e120f3d006a2ff95d96548192a0f5f1a115863f8e\",\"logprobs\":[],\"obfuscation\":\"aNMhy7LXjxBJqr\",\"output_index\":0,\"sequence_number\":4}", + "event: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"content_index\":0,\"delta\":\"city\",\"item_id\":\"msg_0418ddb09e120f3d006a2ff95d96548192a0f5f1a115863f8e\",\"logprobs\":[],\"obfuscation\":\"qHh2rTbrslig\",\"output_index\":0,\"sequence_number\":5}", + "event: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"content_index\":0,\"delta\":\"\\\":\\\"\",\"item_id\":\"msg_0418ddb09e120f3d006a2ff95d96548192a0f5f1a115863f8e\",\"logprobs\":[],\"obfuscation\":\"QEBmKUnMLL31l\",\"output_index\":0,\"sequence_number\":6}", + "event: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"content_index\":0,\"delta\":\"Paris\",\"item_id\":\"msg_0418ddb09e120f3d006a2ff95d96548192a0f5f1a115863f8e\",\"logprobs\":[],\"obfuscation\":\"qdHMOPoZeY2\",\"output_index\":0,\"sequence_number\":7}", + "event: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"content_index\":0,\"delta\":\"\\\"}\",\"item_id\":\"msg_0418ddb09e120f3d006a2ff95d96548192a0f5f1a115863f8e\",\"logprobs\":[],\"obfuscation\":\"40TvwA19dzdkKS\",\"output_index\":0,\"sequence_number\":8}", + "event: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"content_index\":0,\"item_id\":\"msg_0418ddb09e120f3d006a2ff95d96548192a0f5f1a115863f8e\",\"logprobs\":[],\"output_index\":0,\"sequence_number\":9,\"text\":\"{\\\"city\\\":\\\"Paris\\\"}\"}", + "event: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"content_index\":0,\"item_id\":\"msg_0418ddb09e120f3d006a2ff95d96548192a0f5f1a115863f8e\",\"output_index\":0,\"part\":{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"city\\\":\\\"Paris\\\"}\"},\"sequence_number\":10}", + "event: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"item\":{\"id\":\"msg_0418ddb09e120f3d006a2ff95d96548192a0f5f1a115863f8e\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"city\\\":\\\"Paris\\\"}\"}],\"role\":\"assistant\"},\"output_index\":0,\"sequence_number\":11}", + "event: response.completed\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"resp_0418ddb09e120f3d006a2ff95d20048192bb64d14000f93e29\",\"object\":\"response\",\"created_at\":1781528925,\"status\":\"completed\",\"background\":false,\"completed_at\":1781528925,\"error\":null,\"frequency_penalty\":0,\"incomplete_details\":null,\"instructions\":null,\"max_output_tokens\":32,\"max_tool_calls\":null,\"model\":\"gpt-4o-mini-2024-07-18\",\"moderation\":null,\"output\":[{\"id\":\"msg_0418ddb09e120f3d006a2ff95d96548192a0f5f1a115863f8e\",\"type\":\"message\",\"status\":\"completed\",\"content\":[{\"type\":\"output_text\",\"annotations\":[],\"logprobs\":[],\"text\":\"{\\\"city\\\":\\\"Paris\\\"}\"}],\"role\":\"assistant\"}],\"parallel_tool_calls\":true,\"presence_penalty\":0,\"previous_response_id\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":\"in_memory\",\"reasoning\":{\"context\":null,\"effort\":null,\"summary\":null},\"safety_identifier\":null,\"service_tier\":\"default\",\"store\":true,\"temperature\":0,\"text\":{\"format\":{\"type\":\"json_schema\",\"description\":null,\"name\":\"response\",\"schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":true},\"verbosity\":\"medium\"},\"tool_choice\":\"auto\",\"tools\":[],\"top_logprobs\":0,\"top_p\":1,\"truncation\":\"disabled\",\"usage\":{\"input_tokens\":38,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens\":6,\"output_tokens_details\":{\"reasoning_tokens\":0},\"total_tokens\":44},\"user\":null,\"metadata\":{}},\"sequence_number\":12}" + ], + "kind": "sse" + }, + "headers": { + "access-control-expose-headers": "X-Request-ID, CF-Ray, CF-Ray", + "alt-svc": "h3=\":443\"; ma=86400", + "cf-cache-status": "DYNAMIC", + "cf-ray": "a0c1ce2559313249-VIE", + "connection": "keep-alive", + "content-type": "text/event-stream; charset=utf-8", + "date": "Mon, 15 Jun 2026 13:08:45 GMT", + "openai-organization": "braintrust-data", + "openai-processing-ms": "192", + "openai-project": "proj_vsCSXafhhByzWOThMrJcZiw9", + "openai-version": "2020-10-01", + "server": "cloudflare", + "set-cookie": "[REDACTED]", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "transfer-encoding": "chunked", + "x-content-type-options": "nosniff", + "x-request-id": "req_944fa722f10441f99d1f4c15b4907561" + }, + "status": 200, + "statusText": "OK" + } + } + ], + "meta": { + "createdAt": "2026-06-15T13:08:33.188Z" + } +} diff --git a/e2e/scenarios/ai-sdk-instrumentation/__snapshots__/ai-sdk-v7-auto-hook.span-tree.json b/e2e/scenarios/ai-sdk-instrumentation/__snapshots__/ai-sdk-v7-auto-hook.span-tree.json new file mode 100644 index 000000000..b3e163de7 --- /dev/null +++ b/e2e/scenarios/ai-sdk-instrumentation/__snapshots__/ai-sdk-v7-auto-hook.span-tree.json @@ -0,0 +1,3113 @@ +{ + "span_tree": [ + { + "name": "ai-sdk-instrumentation-root", + "type": "task", + "children": [ + { + "name": "ai-sdk-generate-operation", + "children": [ + { + "name": "generateText", + "type": "function", + "children": [ + { + "name": "doGenerate", + "type": "llm", + "children": [], + "input": { + "maxOutputTokens": 24, + "messages": [ + { + "content": "Reply with the single token PARIS and no punctuation.", + "role": "user" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "temperature": 0 + }, + "output": { + "content": [ + { + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "text": "PARIS", + "type": "text" + } + ], + "finishReason": "stop", + "response": { + "id": "" + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 18 + }, + "inputTokens": 18, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 3 + }, + "outputTokens": 3, + "raw": { + "input_tokens": 18, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 3, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 21 + } + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "metrics": { + "completion_reasoning_tokens": 0, + "completion_tokens": 3, + "prompt_cached_tokens": 0, + "prompt_tokens": 18, + "reasoning_tokens": 0, + "tokens": 21 + } + } + ], + "input": { + "headers": { + "user-agent": "ai/7.0.0-beta.116" + }, + "maxOutputTokens": 24, + "maxRetries": 2, + "messages": [ + { + "content": "Reply with the single token PARIS and no punctuation.", + "role": "user" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "temperature": 0 + }, + "output": { + "content": [ + { + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "text": "PARIS", + "type": "text" + } + ], + "finishReason": "stop", + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "text": "PARIS", + "type": "text" + } + ], + "role": "assistant" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "steps": [ + { + "callId": "", + "content": [ + { + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "text": "PARIS", + "type": "text" + } + ], + "finishReason": "stop", + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "text": "PARIS", + "type": "text" + } + ], + "role": "assistant" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "runtimeContext": {}, + "stepNumber": 0, + "toolsContext": {}, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 18 + }, + "inputTokens": 18, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 3 + }, + "outputTokens": 3, + "raw": { + "input_tokens": 18, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 3, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 21 + }, + "warnings": [] + } + ], + "text": "PARIS", + "toolCalls": [], + "toolResults": [], + "totalUsage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 18 + }, + "inputTokens": 18, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 3 + }, + "outputTokens": 3, + "reasoningTokens": 0, + "totalTokens": 21 + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 18 + }, + "inputTokens": 18, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 3 + }, + "outputTokens": 3, + "raw": { + "input_tokens": 18, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 3, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 21 + }, + "warnings": [] + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + } + } + ], + "metadata": { + "operation": "generate", + "testRunId": "" + } + }, + { + "name": "ai-sdk-output-object-response-format-operation", + "children": [], + "metadata": { + "operation": "output-object-response-format", + "testRunId": "" + } + }, + { + "name": "ai-sdk-output-object-operation", + "children": [ + { + "name": "generateText", + "type": "function", + "children": [ + { + "name": "doGenerate", + "type": "llm", + "children": [], + "input": { + "maxOutputTokens": 32, + "messages": [ + { + "content": "Return a short answer for 2 + 2. Keep the answer concise.", + "role": "user" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "temperature": 0 + }, + "output": { + "content": [ + { + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "text": "{\"answer\":\"4\"}", + "type": "text" + } + ], + "finishReason": "stop", + "response": { + "id": "" + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 45 + }, + "inputTokens": 45, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 6 + }, + "outputTokens": 6, + "raw": { + "input_tokens": 45, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 6, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 51 + } + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "metrics": { + "completion_reasoning_tokens": 0, + "completion_tokens": 6, + "prompt_cached_tokens": 0, + "prompt_tokens": 45, + "reasoning_tokens": 0, + "tokens": 51 + } + } + ], + "input": { + "headers": { + "user-agent": "ai/7.0.0-beta.116" + }, + "maxOutputTokens": 32, + "maxRetries": 2, + "messages": [ + { + "content": "Return a short answer for 2 + 2. Keep the answer concise.", + "role": "user" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "output": { + "response_format": { + "schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "answer": { + "type": "string" + } + }, + "required": [ + "answer" + ], + "type": "object" + }, + "type": "json" + } + }, + "temperature": 0 + }, + "output": { + "content": [ + { + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "text": "{\"answer\":\"4\"}", + "type": "text" + } + ], + "finishReason": "stop", + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "text": "{\"answer\":\"4\"}", + "type": "text" + } + ], + "role": "assistant" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "steps": [ + { + "callId": "", + "content": [ + { + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "text": "{\"answer\":\"4\"}", + "type": "text" + } + ], + "finishReason": "stop", + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "text": "{\"answer\":\"4\"}", + "type": "text" + } + ], + "role": "assistant" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "runtimeContext": {}, + "stepNumber": 0, + "toolsContext": {}, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 45 + }, + "inputTokens": 45, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 6 + }, + "outputTokens": 6, + "raw": { + "input_tokens": 45, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 6, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 51 + }, + "warnings": [] + } + ], + "text": "{\"answer\":\"4\"}", + "toolCalls": [], + "toolResults": [], + "totalUsage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 45 + }, + "inputTokens": 45, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 6 + }, + "outputTokens": 6, + "reasoningTokens": 0, + "totalTokens": 51 + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 45 + }, + "inputTokens": 45, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 6 + }, + "outputTokens": 6, + "raw": { + "input_tokens": 45, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 6, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 51 + }, + "warnings": [] + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + } + } + ], + "metadata": { + "operation": "output-object", + "testRunId": "" + } + }, + { + "name": "ai-sdk-stream-operation", + "children": [ + { + "name": "streamText", + "type": "function", + "children": [ + { + "name": "doStream", + "type": "llm", + "children": [], + "input": { + "maxOutputTokens": 32, + "messages": [ + { + "content": "Count from 1 to 3 and include the words one two three.", + "role": "user" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "temperature": 0 + }, + "output": { + "content": [ + { + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "text": "One, two, three.", + "type": "text" + } + ], + "finishReason": "stop", + "response": { + "id": "" + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 22 + }, + "inputTokens": 22, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 7 + }, + "outputTokens": 7, + "raw": { + "input_tokens": 22, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 7, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 29 + } + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "metrics": { + "completion_reasoning_tokens": 0, + "completion_tokens": 7, + "prompt_cached_tokens": 0, + "prompt_tokens": 22, + "reasoning_tokens": 0, + "tokens": 29 + } + } + ], + "input": { + "maxOutputTokens": 32, + "maxRetries": 2, + "messages": [ + { + "content": "Count from 1 to 3 and include the words one two three.", + "role": "user" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "temperature": 0 + }, + "output": { + "content": [ + { + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "text": "One, two, three.", + "type": "text" + } + ], + "finishReason": "stop", + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "text": "One, two, three.", + "type": "text" + } + ], + "role": "assistant" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "steps": [ + { + "callId": "", + "content": [ + { + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "text": "One, two, three.", + "type": "text" + } + ], + "finishReason": "stop", + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "text": "One, two, three.", + "type": "text" + } + ], + "role": "assistant" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "runtimeContext": {}, + "stepNumber": 0, + "toolsContext": {}, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 22 + }, + "inputTokens": 22, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 7 + }, + "outputTokens": 7, + "raw": { + "input_tokens": 22, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 7, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 29 + }, + "warnings": [] + } + ], + "text": "One, two, three.", + "toolCalls": [], + "toolResults": [], + "totalUsage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 22 + }, + "inputTokens": 22, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 7 + }, + "outputTokens": 7, + "reasoningTokens": 0, + "totalTokens": 29 + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 22 + }, + "inputTokens": 22, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 7 + }, + "outputTokens": 7, + "raw": { + "input_tokens": 22, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 7, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 29 + }, + "warnings": [] + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "metrics": { + "time_to_first_token": 0 + } + } + ], + "metadata": { + "operation": "stream", + "testRunId": "" + } + }, + { + "name": "ai-sdk-embed-operation", + "children": [ + { + "name": "embed", + "type": "function", + "children": [ + { + "name": "doEmbed", + "type": "llm", + "children": [], + "input": { + "values": [ + "Paris is the capital of France." + ] + }, + "output": { + "embedding_count": 1, + "embedding_length": 1536, + "usage": { + "tokens": 7 + } + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "text-embedding-3-small", + "provider": "openai.embedding" + }, + "metrics": { + "tokens": 7 + } + } + ], + "input": { + "model": { + "modelId": "text-embedding-3-small", + "provider": "openai.embedding" + }, + "value": "Paris is the capital of France." + }, + "output": { + "embedding_length": 1536, + "usage": { + "tokens": 7 + }, + "warnings": [] + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "text-embedding-3-small", + "provider": "openai.embedding" + } + } + ], + "metadata": { + "operation": "embed", + "testRunId": "" + } + }, + { + "name": "ai-sdk-embed-many-operation", + "children": [ + { + "name": "embedMany", + "type": "function", + "children": [ + { + "name": "doEmbed", + "type": "llm", + "children": [], + "input": { + "values": [ + "Paris is in France.", + "Berlin is in Germany.", + "Vienna is in Austria." + ] + }, + "output": { + "embedding_count": 3, + "embedding_length": 1536, + "usage": { + "tokens": 16 + } + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "text-embedding-3-small", + "provider": "openai.embedding" + }, + "metrics": { + "tokens": 16 + } + } + ], + "input": { + "model": { + "modelId": "text-embedding-3-small", + "provider": "openai.embedding" + }, + "values": [ + "Paris is in France.", + "Berlin is in Germany.", + "Vienna is in Austria." + ] + }, + "output": { + "embedding_count": 3, + "embedding_length": 1536, + "usage": { + "tokens": 16 + }, + "warnings": [] + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "text-embedding-3-small", + "provider": "openai.embedding" + } + } + ], + "metadata": { + "operation": "embed-many", + "testRunId": "" + } + }, + { + "name": "ai-sdk-tool-operation", + "children": [ + { + "name": "generateText", + "type": "function", + "children": [ + { + "name": "doGenerate", + "type": "llm", + "children": [], + "input": { + "maxOutputTokens": 128, + "messages": [ + { + "content": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + "role": "user" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "system": "You must inspect live weather via the provided get_weather tool before responding.", + "temperature": 0, + "tools": [ + { + "description": "Get the weather for a location", + "inputSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "location": { + "description": "The city and country", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + }, + "name": "get_weather", + "type": "function" + } + ] + }, + "output": { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "finishReason": "tool-calls", + "response": { + "id": "" + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 94 + }, + "inputTokens": 94, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 8 + }, + "outputTokens": 8, + "raw": { + "input_tokens": 94, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 102 + } + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "metrics": { + "completion_reasoning_tokens": 0, + "completion_tokens": 8, + "prompt_cached_tokens": 0, + "prompt_tokens": 94, + "reasoning_tokens": 0, + "tokens": 102 + } + }, + { + "name": "get_weather", + "type": "tool", + "children": [], + "input": { + "location": "Paris, France" + }, + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "toolCallId": "", + "toolName": "get_weather" + }, + "metrics": { + "duration_ms": 0 + } + }, + { + "name": "doGenerate", + "type": "llm", + "children": [], + "input": { + "maxOutputTokens": 128, + "messages": [ + { + "content": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + "role": "user" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "system": "You must inspect live weather via the provided get_weather tool before responding.", + "temperature": 0, + "tools": [ + { + "description": "Get the weather for a location", + "inputSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "location": { + "description": "The city and country", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + }, + "name": "get_weather", + "type": "function" + } + ] + }, + "output": { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "finishReason": "tool-calls", + "response": { + "id": "" + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 133 + }, + "inputTokens": 133, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 8 + }, + "outputTokens": 8, + "raw": { + "input_tokens": 133, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 141 + } + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "metrics": { + "completion_reasoning_tokens": 0, + "completion_tokens": 8, + "prompt_cached_tokens": 0, + "prompt_tokens": 133, + "reasoning_tokens": 0, + "tokens": 141 + } + }, + { + "name": "get_weather", + "type": "tool", + "children": [], + "input": { + "location": "Paris, France" + }, + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "toolCallId": "", + "toolName": "get_weather" + }, + "metrics": { + "duration_ms": 0 + } + }, + { + "name": "doGenerate", + "type": "llm", + "children": [], + "input": { + "maxOutputTokens": 128, + "messages": [ + { + "content": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + "role": "user" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "system": "You must inspect live weather via the provided get_weather tool before responding.", + "temperature": 0, + "tools": [ + { + "description": "Get the weather for a location", + "inputSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "location": { + "description": "The city and country", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + }, + "name": "get_weather", + "type": "function" + } + ] + }, + "output": { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "finishReason": "tool-calls", + "response": { + "id": "" + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 172 + }, + "inputTokens": 172, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 8 + }, + "outputTokens": 8, + "raw": { + "input_tokens": 172, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 180 + } + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "metrics": { + "completion_reasoning_tokens": 0, + "completion_tokens": 8, + "prompt_cached_tokens": 0, + "prompt_tokens": 172, + "reasoning_tokens": 0, + "tokens": 180 + } + }, + { + "name": "get_weather", + "type": "tool", + "children": [], + "input": { + "location": "Paris, France" + }, + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "toolCallId": "", + "toolName": "get_weather" + }, + "metrics": { + "duration_ms": 0 + } + }, + { + "name": "doGenerate", + "type": "llm", + "children": [], + "input": { + "maxOutputTokens": 128, + "messages": [ + { + "content": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + "role": "user" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "system": "You must inspect live weather via the provided get_weather tool before responding.", + "temperature": 0, + "tools": [ + { + "description": "Get the weather for a location", + "inputSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "location": { + "description": "The city and country", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + }, + "name": "get_weather", + "type": "function" + } + ] + }, + "output": { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "finishReason": "tool-calls", + "response": { + "id": "" + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 211 + }, + "inputTokens": 211, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 8 + }, + "outputTokens": 8, + "raw": { + "input_tokens": 211, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 219 + } + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "metrics": { + "completion_reasoning_tokens": 0, + "completion_tokens": 8, + "prompt_cached_tokens": 0, + "prompt_tokens": 211, + "reasoning_tokens": 0, + "tokens": 219 + } + }, + { + "name": "get_weather", + "type": "tool", + "children": [], + "input": { + "location": "Paris, France" + }, + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "toolCallId": "", + "toolName": "get_weather" + }, + "metrics": { + "duration_ms": 0 + } + } + ], + "input": { + "headers": { + "user-agent": "ai/7.0.0-beta.116" + }, + "maxOutputTokens": 128, + "maxRetries": 2, + "messages": [ + { + "content": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + "role": "user" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "system": "You must inspect live weather via the provided get_weather tool before responding.", + "temperature": 0, + "toolChoice": "required", + "tools": { + "get_weather": { + "description": "Get the weather for a location", + "inputSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "location": { + "description": "The city and country", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + } + } + } + }, + "output": { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + }, + { + "dynamic": false, + "input": { + "location": "Paris, France" + }, + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "finishReason": "tool-calls", + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "steps": [ + { + "callId": "", + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + }, + { + "dynamic": false, + "input": { + "location": "Paris, France" + }, + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "finishReason": "tool-calls", + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "runtimeContext": {}, + "stepNumber": 0, + "toolsContext": {}, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 94 + }, + "inputTokens": 94, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 8 + }, + "outputTokens": 8, + "raw": { + "input_tokens": 94, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 102 + }, + "warnings": [] + }, + { + "callId": "", + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + }, + { + "dynamic": false, + "input": { + "location": "Paris, France" + }, + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "finishReason": "tool-calls", + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "runtimeContext": {}, + "stepNumber": 1, + "toolsContext": {}, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 133 + }, + "inputTokens": 133, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 8 + }, + "outputTokens": 8, + "raw": { + "input_tokens": 133, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 141 + }, + "warnings": [] + }, + { + "callId": "", + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + }, + { + "dynamic": false, + "input": { + "location": "Paris, France" + }, + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "finishReason": "tool-calls", + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "runtimeContext": {}, + "stepNumber": 2, + "toolsContext": {}, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 172 + }, + "inputTokens": 172, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 8 + }, + "outputTokens": 8, + "raw": { + "input_tokens": 172, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 180 + }, + "warnings": [] + }, + { + "callId": "", + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + }, + { + "dynamic": false, + "input": { + "location": "Paris, France" + }, + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "finishReason": "tool-calls", + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "runtimeContext": {}, + "stepNumber": 3, + "toolsContext": {}, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 211 + }, + "inputTokens": 211, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 8 + }, + "outputTokens": 8, + "raw": { + "input_tokens": 211, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 219 + }, + "warnings": [] + } + ], + "text": "", + "toolCalls": [ + { + "input": { + "location": "Paris, France" + }, + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "toolResults": [ + { + "dynamic": false, + "input": { + "location": "Paris, France" + }, + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "totalUsage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 610 + }, + "inputTokens": 610, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 32 + }, + "outputTokens": 32, + "reasoningTokens": 0, + "totalTokens": 642 + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 211 + }, + "inputTokens": 211, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 8 + }, + "outputTokens": 8, + "raw": { + "input_tokens": 211, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 219 + }, + "warnings": [] + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + } + } + ], + "metadata": { + "operation": "tool", + "testRunId": "" + } + }, + { + "name": "ai-sdk-generate-object-operation", + "children": [ + { + "name": "generateObject", + "type": "function", + "children": [ + { + "name": "doGenerate", + "type": "llm", + "children": [], + "input": { + "prompt": [ + { + "content": [ + { + "text": "Return JSON with {\"city\":\"Paris\"}.", + "type": "text" + } + ], + "role": "user" + } + ] + }, + "output": { + "finishReason": "stop", + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "text": "{\"city\":\"Paris\"}", + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 38 + }, + "inputTokens": 38, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 6 + }, + "outputTokens": 6, + "raw": { + "input_tokens": 38, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 6, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 44 + }, + "warnings": [] + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "metrics": { + "completion_reasoning_tokens": 0, + "completion_tokens": 6, + "prompt_cached_tokens": 0, + "prompt_tokens": 38, + "reasoning_tokens": 0, + "tokens": 44 + } + } + ], + "input": { + "headers": { + "user-agent": "ai/7.0.0-beta.116" + }, + "maxOutputTokens": 32, + "maxRetries": 2, + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "output": "object", + "prompt": "Return JSON with {\"city\":\"Paris\"}.", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + }, + "temperature": 0 + }, + "output": { + "finishReason": "stop", + "object": { + "city": "Paris" + }, + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 38 + }, + "inputTokens": 38, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 6 + }, + "outputTokens": 6, + "raw": { + "input_tokens": 38, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 6, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 44 + }, + "warnings": [] + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + } + } + ], + "metadata": { + "operation": "generate-object", + "testRunId": "" + } + }, + { + "name": "ai-sdk-stream-object-operation", + "children": [ + { + "name": "streamObject", + "type": "function", + "children": [ + { + "name": "doStream", + "type": "llm", + "children": [], + "input": { + "prompt": [ + { + "content": [ + { + "text": "Stream JSON with {\"city\":\"Paris\"}.", + "type": "text" + } + ], + "role": "user" + } + ] + }, + "output": { + "finishReason": "stop", + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "headers": "", + "id": "", + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "text": "{\"city\":\"Paris\"}", + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 38 + }, + "inputTokens": 38, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 6 + }, + "outputTokens": 6, + "raw": { + "input_tokens": 38, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 6, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 44 + }, + "warnings": [] + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "metrics": { + "completion_reasoning_tokens": 0, + "completion_tokens": 6, + "prompt_cached_tokens": 0, + "prompt_tokens": 38, + "reasoning_tokens": 0, + "tokens": 44 + } + } + ], + "input": { + "maxOutputTokens": 32, + "maxRetries": 2, + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "output": "object", + "prompt": "Stream JSON with {\"city\":\"Paris\"}.", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + }, + "temperature": 0 + }, + "output": { + "finishReason": "stop", + "object": { + "city": "Paris" + }, + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "headers": "", + "id": "", + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 38 + }, + "inputTokens": 38, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 6 + }, + "outputTokens": 6, + "raw": { + "input_tokens": 38, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 6, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 44 + }, + "warnings": [] + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + } + } + ], + "metadata": { + "operation": "stream-object", + "testRunId": "" + } + } + ], + "metadata": { + "aiSdkVersion": "7.0.0-beta.116", + "scenario": "ai-sdk-instrumentation", + "testRunId": "" + } + } + ] +} diff --git a/e2e/scenarios/ai-sdk-instrumentation/__snapshots__/ai-sdk-v7-auto-hook.span-tree.txt b/e2e/scenarios/ai-sdk-instrumentation/__snapshots__/ai-sdk-v7-auto-hook.span-tree.txt new file mode 100644 index 000000000..ab4486dc0 --- /dev/null +++ b/e2e/scenarios/ai-sdk-instrumentation/__snapshots__/ai-sdk-v7-auto-hook.span-tree.txt @@ -0,0 +1,2970 @@ +span_tree: +└── ai-sdk-instrumentation-root [task] + metadata: { + "aiSdkVersion": "7.0.0-beta.116", + "scenario": "ai-sdk-instrumentation", + "testRunId": "" + } + ├── ai-sdk-generate-operation + │ metadata: { + │ "operation": "generate", + │ "testRunId": "" + │ } + │ └── generateText [function] + │ input: { + │ "headers": { + │ "user-agent": "ai/7.0.0-beta.116" + │ }, + │ "maxOutputTokens": 24, + │ "maxRetries": 2, + │ "messages": [ + │ { + │ "content": "Reply with the single token PARIS and no punctuation.", + │ "role": "user" + │ } + │ ], + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "temperature": 0 + │ } + │ output: { + │ "content": [ + │ { + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "PARIS", + │ "type": "text" + │ } + │ ], + │ "finishReason": "stop", + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "PARIS", + │ "type": "text" + │ } + │ ], + │ "role": "assistant" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "steps": [ + │ { + │ "callId": "", + │ "content": [ + │ { + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "PARIS", + │ "type": "text" + │ } + │ ], + │ "finishReason": "stop", + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "PARIS", + │ "type": "text" + │ } + │ ], + │ "role": "assistant" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "runtimeContext": {}, + │ "stepNumber": 0, + │ "toolsContext": {}, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 18 + │ }, + │ "inputTokens": 18, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 3 + │ }, + │ "outputTokens": 3, + │ "raw": { + │ "input_tokens": 18, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 3, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 21 + │ }, + │ "warnings": [] + │ } + │ ], + │ "text": "PARIS", + │ "toolCalls": [], + │ "toolResults": [], + │ "totalUsage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 18 + │ }, + │ "inputTokens": 18, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 3 + │ }, + │ "outputTokens": 3, + │ "reasoningTokens": 0, + │ "totalTokens": 21 + │ }, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 18 + │ }, + │ "inputTokens": 18, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 3 + │ }, + │ "outputTokens": 3, + │ "raw": { + │ "input_tokens": 18, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 3, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 21 + │ }, + │ "warnings": [] + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ } + │ └── doGenerate [llm] + │ input: { + │ "maxOutputTokens": 24, + │ "messages": [ + │ { + │ "content": "Reply with the single token PARIS and no punctuation.", + │ "role": "user" + │ } + │ ], + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "temperature": 0 + │ } + │ output: { + │ "content": [ + │ { + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "PARIS", + │ "type": "text" + │ } + │ ], + │ "finishReason": "stop", + │ "response": { + │ "id": "" + │ }, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 18 + │ }, + │ "inputTokens": 18, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 3 + │ }, + │ "outputTokens": 3, + │ "raw": { + │ "input_tokens": 18, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 3, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 21 + │ } + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ } + │ metrics: { + │ "completion_reasoning_tokens": 0, + │ "completion_tokens": 3, + │ "prompt_cached_tokens": 0, + │ "prompt_tokens": 18, + │ "reasoning_tokens": 0, + │ "tokens": 21 + │ } + ├── ai-sdk-output-object-response-format-operation + │ metadata: { + │ "operation": "output-object-response-format", + │ "testRunId": "" + │ } + ├── ai-sdk-output-object-operation + │ metadata: { + │ "operation": "output-object", + │ "testRunId": "" + │ } + │ └── generateText [function] + │ input: { + │ "headers": { + │ "user-agent": "ai/7.0.0-beta.116" + │ }, + │ "maxOutputTokens": 32, + │ "maxRetries": 2, + │ "messages": [ + │ { + │ "content": "Return a short answer for 2 + 2. Keep the answer concise.", + │ "role": "user" + │ } + │ ], + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "output": { + │ "response_format": { + │ "schema": { + │ "$schema": "http://json-schema.org/draft-07/schema#", + │ "additionalProperties": false, + │ "properties": { + │ "answer": { + │ "type": "string" + │ } + │ }, + │ "required": [ + │ "answer" + │ ], + │ "type": "object" + │ }, + │ "type": "json" + │ } + │ }, + │ "temperature": 0 + │ } + │ output: { + │ "content": [ + │ { + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "{\"answer\":\"4\"}", + │ "type": "text" + │ } + │ ], + │ "finishReason": "stop", + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "{\"answer\":\"4\"}", + │ "type": "text" + │ } + │ ], + │ "role": "assistant" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "steps": [ + │ { + │ "callId": "", + │ "content": [ + │ { + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "{\"answer\":\"4\"}", + │ "type": "text" + │ } + │ ], + │ "finishReason": "stop", + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "{\"answer\":\"4\"}", + │ "type": "text" + │ } + │ ], + │ "role": "assistant" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "runtimeContext": {}, + │ "stepNumber": 0, + │ "toolsContext": {}, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 45 + │ }, + │ "inputTokens": 45, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 6 + │ }, + │ "outputTokens": 6, + │ "raw": { + │ "input_tokens": 45, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 6, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 51 + │ }, + │ "warnings": [] + │ } + │ ], + │ "text": "{\"answer\":\"4\"}", + │ "toolCalls": [], + │ "toolResults": [], + │ "totalUsage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 45 + │ }, + │ "inputTokens": 45, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 6 + │ }, + │ "outputTokens": 6, + │ "reasoningTokens": 0, + │ "totalTokens": 51 + │ }, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 45 + │ }, + │ "inputTokens": 45, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 6 + │ }, + │ "outputTokens": 6, + │ "raw": { + │ "input_tokens": 45, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 6, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 51 + │ }, + │ "warnings": [] + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ } + │ └── doGenerate [llm] + │ input: { + │ "maxOutputTokens": 32, + │ "messages": [ + │ { + │ "content": "Return a short answer for 2 + 2. Keep the answer concise.", + │ "role": "user" + │ } + │ ], + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "temperature": 0 + │ } + │ output: { + │ "content": [ + │ { + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "{\"answer\":\"4\"}", + │ "type": "text" + │ } + │ ], + │ "finishReason": "stop", + │ "response": { + │ "id": "" + │ }, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 45 + │ }, + │ "inputTokens": 45, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 6 + │ }, + │ "outputTokens": 6, + │ "raw": { + │ "input_tokens": 45, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 6, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 51 + │ } + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ } + │ metrics: { + │ "completion_reasoning_tokens": 0, + │ "completion_tokens": 6, + │ "prompt_cached_tokens": 0, + │ "prompt_tokens": 45, + │ "reasoning_tokens": 0, + │ "tokens": 51 + │ } + ├── ai-sdk-stream-operation + │ metadata: { + │ "operation": "stream", + │ "testRunId": "" + │ } + │ └── streamText [function] + │ input: { + │ "maxOutputTokens": 32, + │ "maxRetries": 2, + │ "messages": [ + │ { + │ "content": "Count from 1 to 3 and include the words one two three.", + │ "role": "user" + │ } + │ ], + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "temperature": 0 + │ } + │ output: { + │ "content": [ + │ { + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "One, two, three.", + │ "type": "text" + │ } + │ ], + │ "finishReason": "stop", + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "One, two, three.", + │ "type": "text" + │ } + │ ], + │ "role": "assistant" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "steps": [ + │ { + │ "callId": "", + │ "content": [ + │ { + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "One, two, three.", + │ "type": "text" + │ } + │ ], + │ "finishReason": "stop", + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "One, two, three.", + │ "type": "text" + │ } + │ ], + │ "role": "assistant" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "runtimeContext": {}, + │ "stepNumber": 0, + │ "toolsContext": {}, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 22 + │ }, + │ "inputTokens": 22, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 7 + │ }, + │ "outputTokens": 7, + │ "raw": { + │ "input_tokens": 22, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 7, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 29 + │ }, + │ "warnings": [] + │ } + │ ], + │ "text": "One, two, three.", + │ "toolCalls": [], + │ "toolResults": [], + │ "totalUsage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 22 + │ }, + │ "inputTokens": 22, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 7 + │ }, + │ "outputTokens": 7, + │ "reasoningTokens": 0, + │ "totalTokens": 29 + │ }, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 22 + │ }, + │ "inputTokens": 22, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 7 + │ }, + │ "outputTokens": 7, + │ "raw": { + │ "input_tokens": 22, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 7, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 29 + │ }, + │ "warnings": [] + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ } + │ metrics: { + │ "time_to_first_token": 0 + │ } + │ └── doStream [llm] + │ input: { + │ "maxOutputTokens": 32, + │ "messages": [ + │ { + │ "content": "Count from 1 to 3 and include the words one two three.", + │ "role": "user" + │ } + │ ], + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "temperature": 0 + │ } + │ output: { + │ "content": [ + │ { + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "One, two, three.", + │ "type": "text" + │ } + │ ], + │ "finishReason": "stop", + │ "response": { + │ "id": "" + │ }, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 22 + │ }, + │ "inputTokens": 22, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 7 + │ }, + │ "outputTokens": 7, + │ "raw": { + │ "input_tokens": 22, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 7, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 29 + │ } + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ } + │ metrics: { + │ "completion_reasoning_tokens": 0, + │ "completion_tokens": 7, + │ "prompt_cached_tokens": 0, + │ "prompt_tokens": 22, + │ "reasoning_tokens": 0, + │ "tokens": 29 + │ } + ├── ai-sdk-embed-operation + │ metadata: { + │ "operation": "embed", + │ "testRunId": "" + │ } + │ └── embed [function] + │ input: { + │ "model": { + │ "modelId": "text-embedding-3-small", + │ "provider": "openai.embedding" + │ }, + │ "value": "Paris is the capital of France." + │ } + │ output: { + │ "embedding_length": 1536, + │ "usage": { + │ "tokens": 7 + │ }, + │ "warnings": [] + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "text-embedding-3-small", + │ "provider": "openai.embedding" + │ } + │ └── doEmbed [llm] + │ input: { + │ "values": [ + │ "Paris is the capital of France." + │ ] + │ } + │ output: { + │ "embedding_count": 1, + │ "embedding_length": 1536, + │ "usage": { + │ "tokens": 7 + │ } + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "text-embedding-3-small", + │ "provider": "openai.embedding" + │ } + │ metrics: { + │ "tokens": 7 + │ } + ├── ai-sdk-embed-many-operation + │ metadata: { + │ "operation": "embed-many", + │ "testRunId": "" + │ } + │ └── embedMany [function] + │ input: { + │ "model": { + │ "modelId": "text-embedding-3-small", + │ "provider": "openai.embedding" + │ }, + │ "values": [ + │ "Paris is in France.", + │ "Berlin is in Germany.", + │ "Vienna is in Austria." + │ ] + │ } + │ output: { + │ "embedding_count": 3, + │ "embedding_length": 1536, + │ "usage": { + │ "tokens": 16 + │ }, + │ "warnings": [] + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "text-embedding-3-small", + │ "provider": "openai.embedding" + │ } + │ └── doEmbed [llm] + │ input: { + │ "values": [ + │ "Paris is in France.", + │ "Berlin is in Germany.", + │ "Vienna is in Austria." + │ ] + │ } + │ output: { + │ "embedding_count": 3, + │ "embedding_length": 1536, + │ "usage": { + │ "tokens": 16 + │ } + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "text-embedding-3-small", + │ "provider": "openai.embedding" + │ } + │ metrics: { + │ "tokens": 16 + │ } + ├── ai-sdk-tool-operation + │ metadata: { + │ "operation": "tool", + │ "testRunId": "" + │ } + │ └── generateText [function] + │ input: { + │ "headers": { + │ "user-agent": "ai/7.0.0-beta.116" + │ }, + │ "maxOutputTokens": 128, + │ "maxRetries": 2, + │ "messages": [ + │ { + │ "content": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + │ "role": "user" + │ } + │ ], + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "system": "You must inspect live weather via the provided get_weather tool before responding.", + │ "temperature": 0, + │ "toolChoice": "required", + │ "tools": { + │ "get_weather": { + │ "description": "Get the weather for a location", + │ "inputSchema": { + │ "$schema": "http://json-schema.org/draft-07/schema#", + │ "additionalProperties": false, + │ "properties": { + │ "location": { + │ "description": "The city and country", + │ "type": "string" + │ } + │ }, + │ "required": [ + │ "location" + │ ], + │ "type": "object" + │ } + │ } + │ } + │ } + │ output: { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ }, + │ { + │ "dynamic": false, + │ "input": { + │ "location": "Paris, France" + │ }, + │ "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "finishReason": "tool-calls", + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ }, + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ }, + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ }, + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "steps": [ + │ { + │ "callId": "", + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ }, + │ { + │ "dynamic": false, + │ "input": { + │ "location": "Paris, France" + │ }, + │ "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "finishReason": "tool-calls", + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "runtimeContext": {}, + │ "stepNumber": 0, + │ "toolsContext": {}, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 94 + │ }, + │ "inputTokens": 94, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 8 + │ }, + │ "outputTokens": 8, + │ "raw": { + │ "input_tokens": 94, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 8, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 102 + │ }, + │ "warnings": [] + │ }, + │ { + │ "callId": "", + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ }, + │ { + │ "dynamic": false, + │ "input": { + │ "location": "Paris, France" + │ }, + │ "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "finishReason": "tool-calls", + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ }, + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "runtimeContext": {}, + │ "stepNumber": 1, + │ "toolsContext": {}, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 133 + │ }, + │ "inputTokens": 133, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 8 + │ }, + │ "outputTokens": 8, + │ "raw": { + │ "input_tokens": 133, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 8, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 141 + │ }, + │ "warnings": [] + │ }, + │ { + │ "callId": "", + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ }, + │ { + │ "dynamic": false, + │ "input": { + │ "location": "Paris, France" + │ }, + │ "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "finishReason": "tool-calls", + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ }, + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ }, + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "runtimeContext": {}, + │ "stepNumber": 2, + │ "toolsContext": {}, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 172 + │ }, + │ "inputTokens": 172, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 8 + │ }, + │ "outputTokens": 8, + │ "raw": { + │ "input_tokens": 172, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 8, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 180 + │ }, + │ "warnings": [] + │ }, + │ { + │ "callId": "", + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ }, + │ { + │ "dynamic": false, + │ "input": { + │ "location": "Paris, France" + │ }, + │ "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "finishReason": "tool-calls", + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ }, + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ }, + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ }, + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "runtimeContext": {}, + │ "stepNumber": 3, + │ "toolsContext": {}, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 211 + │ }, + │ "inputTokens": 211, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 8 + │ }, + │ "outputTokens": 8, + │ "raw": { + │ "input_tokens": 211, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 8, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 219 + │ }, + │ "warnings": [] + │ } + │ ], + │ "text": "", + │ "toolCalls": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "toolResults": [ + │ { + │ "dynamic": false, + │ "input": { + │ "location": "Paris, France" + │ }, + │ "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "totalUsage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 610 + │ }, + │ "inputTokens": 610, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 32 + │ }, + │ "outputTokens": 32, + │ "reasoningTokens": 0, + │ "totalTokens": 642 + │ }, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 211 + │ }, + │ "inputTokens": 211, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 8 + │ }, + │ "outputTokens": 8, + │ "raw": { + │ "input_tokens": 211, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 8, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 219 + │ }, + │ "warnings": [] + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ } + │ ├── doGenerate [llm] + │ │ input: { + │ │ "maxOutputTokens": 128, + │ │ "messages": [ + │ │ { + │ │ "content": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + │ │ "role": "user" + │ │ } + │ │ ], + │ │ "model": { + │ │ "modelId": "gpt-4o-mini-2024-07-18", + │ │ "provider": "openai.responses" + │ │ }, + │ │ "system": "You must inspect live weather via the provided get_weather tool before responding.", + │ │ "temperature": 0, + │ │ "tools": [ + │ │ { + │ │ "description": "Get the weather for a location", + │ │ "inputSchema": { + │ │ "$schema": "http://json-schema.org/draft-07/schema#", + │ │ "additionalProperties": false, + │ │ "properties": { + │ │ "location": { + │ │ "description": "The city and country", + │ │ "type": "string" + │ │ } + │ │ }, + │ │ "required": [ + │ │ "location" + │ │ ], + │ │ "type": "object" + │ │ }, + │ │ "name": "get_weather", + │ │ "type": "function" + │ │ } + │ │ ] + │ │ } + │ │ output: { + │ │ "content": [ + │ │ { + │ │ "input": { + │ │ "location": "Paris, France" + │ │ }, + │ │ "providerMetadata": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-call" + │ │ } + │ │ ], + │ │ "finishReason": "tool-calls", + │ │ "response": { + │ │ "id": "" + │ │ }, + │ │ "usage": { + │ │ "cachedInputTokens": 0, + │ │ "inputTokenDetails": { + │ │ "cacheReadTokens": 0, + │ │ "noCacheTokens": 94 + │ │ }, + │ │ "inputTokens": 94, + │ │ "outputTokenDetails": { + │ │ "reasoningTokens": 0, + │ │ "textTokens": 8 + │ │ }, + │ │ "outputTokens": 8, + │ │ "raw": { + │ │ "input_tokens": 94, + │ │ "input_tokens_details": { + │ │ "cached_tokens": 0 + │ │ }, + │ │ "output_tokens": 8, + │ │ "output_tokens_details": { + │ │ "reasoning_tokens": 0 + │ │ } + │ │ }, + │ │ "reasoningTokens": 0, + │ │ "totalTokens": 102 + │ │ } + │ │ } + │ │ metadata: { + │ │ "braintrust": { + │ │ "integration_name": "ai-sdk", + │ │ "sdk_language": "typescript" + │ │ }, + │ │ "model": "gpt-4o-mini-2024-07-18", + │ │ "provider": "openai.responses" + │ │ } + │ │ metrics: { + │ │ "completion_reasoning_tokens": 0, + │ │ "completion_tokens": 8, + │ │ "prompt_cached_tokens": 0, + │ │ "prompt_tokens": 94, + │ │ "reasoning_tokens": 0, + │ │ "tokens": 102 + │ │ } + │ ├── get_weather [tool] + │ │ input: { + │ │ "location": "Paris, France" + │ │ } + │ │ output: "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ │ metadata: { + │ │ "braintrust": { + │ │ "integration_name": "ai-sdk", + │ │ "sdk_language": "typescript" + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather" + │ │ } + │ │ metrics: { + │ │ "duration_ms": 0 + │ │ } + │ ├── doGenerate [llm] + │ │ input: { + │ │ "maxOutputTokens": 128, + │ │ "messages": [ + │ │ { + │ │ "content": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + │ │ "role": "user" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "input": { + │ │ "location": "Paris, France" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-call" + │ │ } + │ │ ], + │ │ "role": "assistant" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "output": { + │ │ "type": "text", + │ │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-result" + │ │ } + │ │ ], + │ │ "role": "tool" + │ │ } + │ │ ], + │ │ "model": { + │ │ "modelId": "gpt-4o-mini-2024-07-18", + │ │ "provider": "openai.responses" + │ │ }, + │ │ "system": "You must inspect live weather via the provided get_weather tool before responding.", + │ │ "temperature": 0, + │ │ "tools": [ + │ │ { + │ │ "description": "Get the weather for a location", + │ │ "inputSchema": { + │ │ "$schema": "http://json-schema.org/draft-07/schema#", + │ │ "additionalProperties": false, + │ │ "properties": { + │ │ "location": { + │ │ "description": "The city and country", + │ │ "type": "string" + │ │ } + │ │ }, + │ │ "required": [ + │ │ "location" + │ │ ], + │ │ "type": "object" + │ │ }, + │ │ "name": "get_weather", + │ │ "type": "function" + │ │ } + │ │ ] + │ │ } + │ │ output: { + │ │ "content": [ + │ │ { + │ │ "input": { + │ │ "location": "Paris, France" + │ │ }, + │ │ "providerMetadata": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-call" + │ │ } + │ │ ], + │ │ "finishReason": "tool-calls", + │ │ "response": { + │ │ "id": "" + │ │ }, + │ │ "usage": { + │ │ "cachedInputTokens": 0, + │ │ "inputTokenDetails": { + │ │ "cacheReadTokens": 0, + │ │ "noCacheTokens": 133 + │ │ }, + │ │ "inputTokens": 133, + │ │ "outputTokenDetails": { + │ │ "reasoningTokens": 0, + │ │ "textTokens": 8 + │ │ }, + │ │ "outputTokens": 8, + │ │ "raw": { + │ │ "input_tokens": 133, + │ │ "input_tokens_details": { + │ │ "cached_tokens": 0 + │ │ }, + │ │ "output_tokens": 8, + │ │ "output_tokens_details": { + │ │ "reasoning_tokens": 0 + │ │ } + │ │ }, + │ │ "reasoningTokens": 0, + │ │ "totalTokens": 141 + │ │ } + │ │ } + │ │ metadata: { + │ │ "braintrust": { + │ │ "integration_name": "ai-sdk", + │ │ "sdk_language": "typescript" + │ │ }, + │ │ "model": "gpt-4o-mini-2024-07-18", + │ │ "provider": "openai.responses" + │ │ } + │ │ metrics: { + │ │ "completion_reasoning_tokens": 0, + │ │ "completion_tokens": 8, + │ │ "prompt_cached_tokens": 0, + │ │ "prompt_tokens": 133, + │ │ "reasoning_tokens": 0, + │ │ "tokens": 141 + │ │ } + │ ├── get_weather [tool] + │ │ input: { + │ │ "location": "Paris, France" + │ │ } + │ │ output: "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ │ metadata: { + │ │ "braintrust": { + │ │ "integration_name": "ai-sdk", + │ │ "sdk_language": "typescript" + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather" + │ │ } + │ │ metrics: { + │ │ "duration_ms": 0 + │ │ } + │ ├── doGenerate [llm] + │ │ input: { + │ │ "maxOutputTokens": 128, + │ │ "messages": [ + │ │ { + │ │ "content": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + │ │ "role": "user" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "input": { + │ │ "location": "Paris, France" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-call" + │ │ } + │ │ ], + │ │ "role": "assistant" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "output": { + │ │ "type": "text", + │ │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-result" + │ │ } + │ │ ], + │ │ "role": "tool" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "input": { + │ │ "location": "Paris, France" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-call" + │ │ } + │ │ ], + │ │ "role": "assistant" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "output": { + │ │ "type": "text", + │ │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-result" + │ │ } + │ │ ], + │ │ "role": "tool" + │ │ } + │ │ ], + │ │ "model": { + │ │ "modelId": "gpt-4o-mini-2024-07-18", + │ │ "provider": "openai.responses" + │ │ }, + │ │ "system": "You must inspect live weather via the provided get_weather tool before responding.", + │ │ "temperature": 0, + │ │ "tools": [ + │ │ { + │ │ "description": "Get the weather for a location", + │ │ "inputSchema": { + │ │ "$schema": "http://json-schema.org/draft-07/schema#", + │ │ "additionalProperties": false, + │ │ "properties": { + │ │ "location": { + │ │ "description": "The city and country", + │ │ "type": "string" + │ │ } + │ │ }, + │ │ "required": [ + │ │ "location" + │ │ ], + │ │ "type": "object" + │ │ }, + │ │ "name": "get_weather", + │ │ "type": "function" + │ │ } + │ │ ] + │ │ } + │ │ output: { + │ │ "content": [ + │ │ { + │ │ "input": { + │ │ "location": "Paris, France" + │ │ }, + │ │ "providerMetadata": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-call" + │ │ } + │ │ ], + │ │ "finishReason": "tool-calls", + │ │ "response": { + │ │ "id": "" + │ │ }, + │ │ "usage": { + │ │ "cachedInputTokens": 0, + │ │ "inputTokenDetails": { + │ │ "cacheReadTokens": 0, + │ │ "noCacheTokens": 172 + │ │ }, + │ │ "inputTokens": 172, + │ │ "outputTokenDetails": { + │ │ "reasoningTokens": 0, + │ │ "textTokens": 8 + │ │ }, + │ │ "outputTokens": 8, + │ │ "raw": { + │ │ "input_tokens": 172, + │ │ "input_tokens_details": { + │ │ "cached_tokens": 0 + │ │ }, + │ │ "output_tokens": 8, + │ │ "output_tokens_details": { + │ │ "reasoning_tokens": 0 + │ │ } + │ │ }, + │ │ "reasoningTokens": 0, + │ │ "totalTokens": 180 + │ │ } + │ │ } + │ │ metadata: { + │ │ "braintrust": { + │ │ "integration_name": "ai-sdk", + │ │ "sdk_language": "typescript" + │ │ }, + │ │ "model": "gpt-4o-mini-2024-07-18", + │ │ "provider": "openai.responses" + │ │ } + │ │ metrics: { + │ │ "completion_reasoning_tokens": 0, + │ │ "completion_tokens": 8, + │ │ "prompt_cached_tokens": 0, + │ │ "prompt_tokens": 172, + │ │ "reasoning_tokens": 0, + │ │ "tokens": 180 + │ │ } + │ ├── get_weather [tool] + │ │ input: { + │ │ "location": "Paris, France" + │ │ } + │ │ output: "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ │ metadata: { + │ │ "braintrust": { + │ │ "integration_name": "ai-sdk", + │ │ "sdk_language": "typescript" + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather" + │ │ } + │ │ metrics: { + │ │ "duration_ms": 0 + │ │ } + │ ├── doGenerate [llm] + │ │ input: { + │ │ "maxOutputTokens": 128, + │ │ "messages": [ + │ │ { + │ │ "content": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + │ │ "role": "user" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "input": { + │ │ "location": "Paris, France" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-call" + │ │ } + │ │ ], + │ │ "role": "assistant" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "output": { + │ │ "type": "text", + │ │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-result" + │ │ } + │ │ ], + │ │ "role": "tool" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "input": { + │ │ "location": "Paris, France" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-call" + │ │ } + │ │ ], + │ │ "role": "assistant" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "output": { + │ │ "type": "text", + │ │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-result" + │ │ } + │ │ ], + │ │ "role": "tool" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "input": { + │ │ "location": "Paris, France" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-call" + │ │ } + │ │ ], + │ │ "role": "assistant" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "output": { + │ │ "type": "text", + │ │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-result" + │ │ } + │ │ ], + │ │ "role": "tool" + │ │ } + │ │ ], + │ │ "model": { + │ │ "modelId": "gpt-4o-mini-2024-07-18", + │ │ "provider": "openai.responses" + │ │ }, + │ │ "system": "You must inspect live weather via the provided get_weather tool before responding.", + │ │ "temperature": 0, + │ │ "tools": [ + │ │ { + │ │ "description": "Get the weather for a location", + │ │ "inputSchema": { + │ │ "$schema": "http://json-schema.org/draft-07/schema#", + │ │ "additionalProperties": false, + │ │ "properties": { + │ │ "location": { + │ │ "description": "The city and country", + │ │ "type": "string" + │ │ } + │ │ }, + │ │ "required": [ + │ │ "location" + │ │ ], + │ │ "type": "object" + │ │ }, + │ │ "name": "get_weather", + │ │ "type": "function" + │ │ } + │ │ ] + │ │ } + │ │ output: { + │ │ "content": [ + │ │ { + │ │ "input": { + │ │ "location": "Paris, France" + │ │ }, + │ │ "providerMetadata": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-call" + │ │ } + │ │ ], + │ │ "finishReason": "tool-calls", + │ │ "response": { + │ │ "id": "" + │ │ }, + │ │ "usage": { + │ │ "cachedInputTokens": 0, + │ │ "inputTokenDetails": { + │ │ "cacheReadTokens": 0, + │ │ "noCacheTokens": 211 + │ │ }, + │ │ "inputTokens": 211, + │ │ "outputTokenDetails": { + │ │ "reasoningTokens": 0, + │ │ "textTokens": 8 + │ │ }, + │ │ "outputTokens": 8, + │ │ "raw": { + │ │ "input_tokens": 211, + │ │ "input_tokens_details": { + │ │ "cached_tokens": 0 + │ │ }, + │ │ "output_tokens": 8, + │ │ "output_tokens_details": { + │ │ "reasoning_tokens": 0 + │ │ } + │ │ }, + │ │ "reasoningTokens": 0, + │ │ "totalTokens": 219 + │ │ } + │ │ } + │ │ metadata: { + │ │ "braintrust": { + │ │ "integration_name": "ai-sdk", + │ │ "sdk_language": "typescript" + │ │ }, + │ │ "model": "gpt-4o-mini-2024-07-18", + │ │ "provider": "openai.responses" + │ │ } + │ │ metrics: { + │ │ "completion_reasoning_tokens": 0, + │ │ "completion_tokens": 8, + │ │ "prompt_cached_tokens": 0, + │ │ "prompt_tokens": 211, + │ │ "reasoning_tokens": 0, + │ │ "tokens": 219 + │ │ } + │ └── get_weather [tool] + │ input: { + │ "location": "Paris, France" + │ } + │ output: "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather" + │ } + │ metrics: { + │ "duration_ms": 0 + │ } + ├── ai-sdk-generate-object-operation + │ metadata: { + │ "operation": "generate-object", + │ "testRunId": "" + │ } + │ └── generateObject [function] + │ input: { + │ "headers": { + │ "user-agent": "ai/7.0.0-beta.116" + │ }, + │ "maxOutputTokens": 32, + │ "maxRetries": 2, + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "output": "object", + │ "prompt": "Return JSON with {\"city\":\"Paris\"}.", + │ "schema": { + │ "$schema": "http://json-schema.org/draft-07/schema#", + │ "additionalProperties": false, + │ "properties": { + │ "city": { + │ "type": "string" + │ } + │ }, + │ "required": [ + │ "city" + │ ], + │ "type": "object" + │ }, + │ "temperature": 0 + │ } + │ output: { + │ "finishReason": "stop", + │ "object": { + │ "city": "Paris" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 38 + │ }, + │ "inputTokens": 38, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 6 + │ }, + │ "outputTokens": 6, + │ "raw": { + │ "input_tokens": 38, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 6, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 44 + │ }, + │ "warnings": [] + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ } + │ └── doGenerate [llm] + │ input: { + │ "prompt": [ + │ { + │ "content": [ + │ { + │ "text": "Return JSON with {\"city\":\"Paris\"}.", + │ "type": "text" + │ } + │ ], + │ "role": "user" + │ } + │ ] + │ } + │ output: { + │ "finishReason": "stop", + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "text": "{\"city\":\"Paris\"}", + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 38 + │ }, + │ "inputTokens": 38, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 6 + │ }, + │ "outputTokens": 6, + │ "raw": { + │ "input_tokens": 38, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 6, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 44 + │ }, + │ "warnings": [] + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ } + │ metrics: { + │ "completion_reasoning_tokens": 0, + │ "completion_tokens": 6, + │ "prompt_cached_tokens": 0, + │ "prompt_tokens": 38, + │ "reasoning_tokens": 0, + │ "tokens": 44 + │ } + └── ai-sdk-stream-object-operation + metadata: { + "operation": "stream-object", + "testRunId": "" + } + └── streamObject [function] + input: { + "maxOutputTokens": 32, + "maxRetries": 2, + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "output": "object", + "prompt": "Stream JSON with {\"city\":\"Paris\"}.", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + }, + "temperature": 0 + } + output: { + "finishReason": "stop", + "object": { + "city": "Paris" + }, + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "headers": "", + "id": "", + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 38 + }, + "inputTokens": 38, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 6 + }, + "outputTokens": 6, + "raw": { + "input_tokens": 38, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 6, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 44 + }, + "warnings": [] + } + metadata: { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + } + └── doStream [llm] + input: { + "prompt": [ + { + "content": [ + { + "text": "Stream JSON with {\"city\":\"Paris\"}.", + "type": "text" + } + ], + "role": "user" + } + ] + } + output: { + "finishReason": "stop", + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "headers": "", + "id": "", + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "text": "{\"city\":\"Paris\"}", + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 38 + }, + "inputTokens": 38, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 6 + }, + "outputTokens": 6, + "raw": { + "input_tokens": 38, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 6, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 44 + }, + "warnings": [] + } + metadata: { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + } + metrics: { + "completion_reasoning_tokens": 0, + "completion_tokens": 6, + "prompt_cached_tokens": 0, + "prompt_tokens": 38, + "reasoning_tokens": 0, + "tokens": 44 + } diff --git a/e2e/scenarios/ai-sdk-instrumentation/__snapshots__/ai-sdk-v7-explicit.span-tree.json b/e2e/scenarios/ai-sdk-instrumentation/__snapshots__/ai-sdk-v7-explicit.span-tree.json new file mode 100644 index 000000000..b3e163de7 --- /dev/null +++ b/e2e/scenarios/ai-sdk-instrumentation/__snapshots__/ai-sdk-v7-explicit.span-tree.json @@ -0,0 +1,3113 @@ +{ + "span_tree": [ + { + "name": "ai-sdk-instrumentation-root", + "type": "task", + "children": [ + { + "name": "ai-sdk-generate-operation", + "children": [ + { + "name": "generateText", + "type": "function", + "children": [ + { + "name": "doGenerate", + "type": "llm", + "children": [], + "input": { + "maxOutputTokens": 24, + "messages": [ + { + "content": "Reply with the single token PARIS and no punctuation.", + "role": "user" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "temperature": 0 + }, + "output": { + "content": [ + { + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "text": "PARIS", + "type": "text" + } + ], + "finishReason": "stop", + "response": { + "id": "" + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 18 + }, + "inputTokens": 18, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 3 + }, + "outputTokens": 3, + "raw": { + "input_tokens": 18, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 3, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 21 + } + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "metrics": { + "completion_reasoning_tokens": 0, + "completion_tokens": 3, + "prompt_cached_tokens": 0, + "prompt_tokens": 18, + "reasoning_tokens": 0, + "tokens": 21 + } + } + ], + "input": { + "headers": { + "user-agent": "ai/7.0.0-beta.116" + }, + "maxOutputTokens": 24, + "maxRetries": 2, + "messages": [ + { + "content": "Reply with the single token PARIS and no punctuation.", + "role": "user" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "temperature": 0 + }, + "output": { + "content": [ + { + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "text": "PARIS", + "type": "text" + } + ], + "finishReason": "stop", + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "text": "PARIS", + "type": "text" + } + ], + "role": "assistant" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "steps": [ + { + "callId": "", + "content": [ + { + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "text": "PARIS", + "type": "text" + } + ], + "finishReason": "stop", + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "text": "PARIS", + "type": "text" + } + ], + "role": "assistant" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "runtimeContext": {}, + "stepNumber": 0, + "toolsContext": {}, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 18 + }, + "inputTokens": 18, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 3 + }, + "outputTokens": 3, + "raw": { + "input_tokens": 18, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 3, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 21 + }, + "warnings": [] + } + ], + "text": "PARIS", + "toolCalls": [], + "toolResults": [], + "totalUsage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 18 + }, + "inputTokens": 18, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 3 + }, + "outputTokens": 3, + "reasoningTokens": 0, + "totalTokens": 21 + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 18 + }, + "inputTokens": 18, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 3 + }, + "outputTokens": 3, + "raw": { + "input_tokens": 18, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 3, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 21 + }, + "warnings": [] + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + } + } + ], + "metadata": { + "operation": "generate", + "testRunId": "" + } + }, + { + "name": "ai-sdk-output-object-response-format-operation", + "children": [], + "metadata": { + "operation": "output-object-response-format", + "testRunId": "" + } + }, + { + "name": "ai-sdk-output-object-operation", + "children": [ + { + "name": "generateText", + "type": "function", + "children": [ + { + "name": "doGenerate", + "type": "llm", + "children": [], + "input": { + "maxOutputTokens": 32, + "messages": [ + { + "content": "Return a short answer for 2 + 2. Keep the answer concise.", + "role": "user" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "temperature": 0 + }, + "output": { + "content": [ + { + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "text": "{\"answer\":\"4\"}", + "type": "text" + } + ], + "finishReason": "stop", + "response": { + "id": "" + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 45 + }, + "inputTokens": 45, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 6 + }, + "outputTokens": 6, + "raw": { + "input_tokens": 45, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 6, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 51 + } + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "metrics": { + "completion_reasoning_tokens": 0, + "completion_tokens": 6, + "prompt_cached_tokens": 0, + "prompt_tokens": 45, + "reasoning_tokens": 0, + "tokens": 51 + } + } + ], + "input": { + "headers": { + "user-agent": "ai/7.0.0-beta.116" + }, + "maxOutputTokens": 32, + "maxRetries": 2, + "messages": [ + { + "content": "Return a short answer for 2 + 2. Keep the answer concise.", + "role": "user" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "output": { + "response_format": { + "schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "answer": { + "type": "string" + } + }, + "required": [ + "answer" + ], + "type": "object" + }, + "type": "json" + } + }, + "temperature": 0 + }, + "output": { + "content": [ + { + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "text": "{\"answer\":\"4\"}", + "type": "text" + } + ], + "finishReason": "stop", + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "text": "{\"answer\":\"4\"}", + "type": "text" + } + ], + "role": "assistant" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "steps": [ + { + "callId": "", + "content": [ + { + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "text": "{\"answer\":\"4\"}", + "type": "text" + } + ], + "finishReason": "stop", + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "text": "{\"answer\":\"4\"}", + "type": "text" + } + ], + "role": "assistant" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "runtimeContext": {}, + "stepNumber": 0, + "toolsContext": {}, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 45 + }, + "inputTokens": 45, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 6 + }, + "outputTokens": 6, + "raw": { + "input_tokens": 45, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 6, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 51 + }, + "warnings": [] + } + ], + "text": "{\"answer\":\"4\"}", + "toolCalls": [], + "toolResults": [], + "totalUsage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 45 + }, + "inputTokens": 45, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 6 + }, + "outputTokens": 6, + "reasoningTokens": 0, + "totalTokens": 51 + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 45 + }, + "inputTokens": 45, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 6 + }, + "outputTokens": 6, + "raw": { + "input_tokens": 45, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 6, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 51 + }, + "warnings": [] + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + } + } + ], + "metadata": { + "operation": "output-object", + "testRunId": "" + } + }, + { + "name": "ai-sdk-stream-operation", + "children": [ + { + "name": "streamText", + "type": "function", + "children": [ + { + "name": "doStream", + "type": "llm", + "children": [], + "input": { + "maxOutputTokens": 32, + "messages": [ + { + "content": "Count from 1 to 3 and include the words one two three.", + "role": "user" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "temperature": 0 + }, + "output": { + "content": [ + { + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "text": "One, two, three.", + "type": "text" + } + ], + "finishReason": "stop", + "response": { + "id": "" + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 22 + }, + "inputTokens": 22, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 7 + }, + "outputTokens": 7, + "raw": { + "input_tokens": 22, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 7, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 29 + } + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "metrics": { + "completion_reasoning_tokens": 0, + "completion_tokens": 7, + "prompt_cached_tokens": 0, + "prompt_tokens": 22, + "reasoning_tokens": 0, + "tokens": 29 + } + } + ], + "input": { + "maxOutputTokens": 32, + "maxRetries": 2, + "messages": [ + { + "content": "Count from 1 to 3 and include the words one two three.", + "role": "user" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "temperature": 0 + }, + "output": { + "content": [ + { + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "text": "One, two, three.", + "type": "text" + } + ], + "finishReason": "stop", + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "text": "One, two, three.", + "type": "text" + } + ], + "role": "assistant" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "steps": [ + { + "callId": "", + "content": [ + { + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "text": "One, two, three.", + "type": "text" + } + ], + "finishReason": "stop", + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "text": "One, two, three.", + "type": "text" + } + ], + "role": "assistant" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "runtimeContext": {}, + "stepNumber": 0, + "toolsContext": {}, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 22 + }, + "inputTokens": 22, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 7 + }, + "outputTokens": 7, + "raw": { + "input_tokens": 22, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 7, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 29 + }, + "warnings": [] + } + ], + "text": "One, two, three.", + "toolCalls": [], + "toolResults": [], + "totalUsage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 22 + }, + "inputTokens": 22, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 7 + }, + "outputTokens": 7, + "reasoningTokens": 0, + "totalTokens": 29 + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 22 + }, + "inputTokens": 22, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 7 + }, + "outputTokens": 7, + "raw": { + "input_tokens": 22, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 7, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 29 + }, + "warnings": [] + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "metrics": { + "time_to_first_token": 0 + } + } + ], + "metadata": { + "operation": "stream", + "testRunId": "" + } + }, + { + "name": "ai-sdk-embed-operation", + "children": [ + { + "name": "embed", + "type": "function", + "children": [ + { + "name": "doEmbed", + "type": "llm", + "children": [], + "input": { + "values": [ + "Paris is the capital of France." + ] + }, + "output": { + "embedding_count": 1, + "embedding_length": 1536, + "usage": { + "tokens": 7 + } + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "text-embedding-3-small", + "provider": "openai.embedding" + }, + "metrics": { + "tokens": 7 + } + } + ], + "input": { + "model": { + "modelId": "text-embedding-3-small", + "provider": "openai.embedding" + }, + "value": "Paris is the capital of France." + }, + "output": { + "embedding_length": 1536, + "usage": { + "tokens": 7 + }, + "warnings": [] + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "text-embedding-3-small", + "provider": "openai.embedding" + } + } + ], + "metadata": { + "operation": "embed", + "testRunId": "" + } + }, + { + "name": "ai-sdk-embed-many-operation", + "children": [ + { + "name": "embedMany", + "type": "function", + "children": [ + { + "name": "doEmbed", + "type": "llm", + "children": [], + "input": { + "values": [ + "Paris is in France.", + "Berlin is in Germany.", + "Vienna is in Austria." + ] + }, + "output": { + "embedding_count": 3, + "embedding_length": 1536, + "usage": { + "tokens": 16 + } + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "text-embedding-3-small", + "provider": "openai.embedding" + }, + "metrics": { + "tokens": 16 + } + } + ], + "input": { + "model": { + "modelId": "text-embedding-3-small", + "provider": "openai.embedding" + }, + "values": [ + "Paris is in France.", + "Berlin is in Germany.", + "Vienna is in Austria." + ] + }, + "output": { + "embedding_count": 3, + "embedding_length": 1536, + "usage": { + "tokens": 16 + }, + "warnings": [] + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "text-embedding-3-small", + "provider": "openai.embedding" + } + } + ], + "metadata": { + "operation": "embed-many", + "testRunId": "" + } + }, + { + "name": "ai-sdk-tool-operation", + "children": [ + { + "name": "generateText", + "type": "function", + "children": [ + { + "name": "doGenerate", + "type": "llm", + "children": [], + "input": { + "maxOutputTokens": 128, + "messages": [ + { + "content": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + "role": "user" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "system": "You must inspect live weather via the provided get_weather tool before responding.", + "temperature": 0, + "tools": [ + { + "description": "Get the weather for a location", + "inputSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "location": { + "description": "The city and country", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + }, + "name": "get_weather", + "type": "function" + } + ] + }, + "output": { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "finishReason": "tool-calls", + "response": { + "id": "" + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 94 + }, + "inputTokens": 94, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 8 + }, + "outputTokens": 8, + "raw": { + "input_tokens": 94, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 102 + } + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "metrics": { + "completion_reasoning_tokens": 0, + "completion_tokens": 8, + "prompt_cached_tokens": 0, + "prompt_tokens": 94, + "reasoning_tokens": 0, + "tokens": 102 + } + }, + { + "name": "get_weather", + "type": "tool", + "children": [], + "input": { + "location": "Paris, France" + }, + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "toolCallId": "", + "toolName": "get_weather" + }, + "metrics": { + "duration_ms": 0 + } + }, + { + "name": "doGenerate", + "type": "llm", + "children": [], + "input": { + "maxOutputTokens": 128, + "messages": [ + { + "content": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + "role": "user" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "system": "You must inspect live weather via the provided get_weather tool before responding.", + "temperature": 0, + "tools": [ + { + "description": "Get the weather for a location", + "inputSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "location": { + "description": "The city and country", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + }, + "name": "get_weather", + "type": "function" + } + ] + }, + "output": { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "finishReason": "tool-calls", + "response": { + "id": "" + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 133 + }, + "inputTokens": 133, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 8 + }, + "outputTokens": 8, + "raw": { + "input_tokens": 133, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 141 + } + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "metrics": { + "completion_reasoning_tokens": 0, + "completion_tokens": 8, + "prompt_cached_tokens": 0, + "prompt_tokens": 133, + "reasoning_tokens": 0, + "tokens": 141 + } + }, + { + "name": "get_weather", + "type": "tool", + "children": [], + "input": { + "location": "Paris, France" + }, + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "toolCallId": "", + "toolName": "get_weather" + }, + "metrics": { + "duration_ms": 0 + } + }, + { + "name": "doGenerate", + "type": "llm", + "children": [], + "input": { + "maxOutputTokens": 128, + "messages": [ + { + "content": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + "role": "user" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "system": "You must inspect live weather via the provided get_weather tool before responding.", + "temperature": 0, + "tools": [ + { + "description": "Get the weather for a location", + "inputSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "location": { + "description": "The city and country", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + }, + "name": "get_weather", + "type": "function" + } + ] + }, + "output": { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "finishReason": "tool-calls", + "response": { + "id": "" + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 172 + }, + "inputTokens": 172, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 8 + }, + "outputTokens": 8, + "raw": { + "input_tokens": 172, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 180 + } + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "metrics": { + "completion_reasoning_tokens": 0, + "completion_tokens": 8, + "prompt_cached_tokens": 0, + "prompt_tokens": 172, + "reasoning_tokens": 0, + "tokens": 180 + } + }, + { + "name": "get_weather", + "type": "tool", + "children": [], + "input": { + "location": "Paris, France" + }, + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "toolCallId": "", + "toolName": "get_weather" + }, + "metrics": { + "duration_ms": 0 + } + }, + { + "name": "doGenerate", + "type": "llm", + "children": [], + "input": { + "maxOutputTokens": 128, + "messages": [ + { + "content": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + "role": "user" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "system": "You must inspect live weather via the provided get_weather tool before responding.", + "temperature": 0, + "tools": [ + { + "description": "Get the weather for a location", + "inputSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "location": { + "description": "The city and country", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + }, + "name": "get_weather", + "type": "function" + } + ] + }, + "output": { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "finishReason": "tool-calls", + "response": { + "id": "" + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 211 + }, + "inputTokens": 211, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 8 + }, + "outputTokens": 8, + "raw": { + "input_tokens": 211, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 219 + } + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "metrics": { + "completion_reasoning_tokens": 0, + "completion_tokens": 8, + "prompt_cached_tokens": 0, + "prompt_tokens": 211, + "reasoning_tokens": 0, + "tokens": 219 + } + }, + { + "name": "get_weather", + "type": "tool", + "children": [], + "input": { + "location": "Paris, France" + }, + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "toolCallId": "", + "toolName": "get_weather" + }, + "metrics": { + "duration_ms": 0 + } + } + ], + "input": { + "headers": { + "user-agent": "ai/7.0.0-beta.116" + }, + "maxOutputTokens": 128, + "maxRetries": 2, + "messages": [ + { + "content": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + "role": "user" + } + ], + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "system": "You must inspect live weather via the provided get_weather tool before responding.", + "temperature": 0, + "toolChoice": "required", + "tools": { + "get_weather": { + "description": "Get the weather for a location", + "inputSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "location": { + "description": "The city and country", + "type": "string" + } + }, + "required": [ + "location" + ], + "type": "object" + } + } + } + }, + "output": { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + }, + { + "dynamic": false, + "input": { + "location": "Paris, France" + }, + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "finishReason": "tool-calls", + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "steps": [ + { + "callId": "", + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + }, + { + "dynamic": false, + "input": { + "location": "Paris, France" + }, + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "finishReason": "tool-calls", + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "runtimeContext": {}, + "stepNumber": 0, + "toolsContext": {}, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 94 + }, + "inputTokens": 94, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 8 + }, + "outputTokens": 8, + "raw": { + "input_tokens": 94, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 102 + }, + "warnings": [] + }, + { + "callId": "", + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + }, + { + "dynamic": false, + "input": { + "location": "Paris, France" + }, + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "finishReason": "tool-calls", + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "runtimeContext": {}, + "stepNumber": 1, + "toolsContext": {}, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 133 + }, + "inputTokens": 133, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 8 + }, + "outputTokens": 8, + "raw": { + "input_tokens": 133, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 141 + }, + "warnings": [] + }, + { + "callId": "", + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + }, + { + "dynamic": false, + "input": { + "location": "Paris, France" + }, + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "finishReason": "tool-calls", + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "runtimeContext": {}, + "stepNumber": 2, + "toolsContext": {}, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 172 + }, + "inputTokens": 172, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 8 + }, + "outputTokens": 8, + "raw": { + "input_tokens": 172, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 180 + }, + "warnings": [] + }, + { + "callId": "", + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + }, + { + "dynamic": false, + "input": { + "location": "Paris, France" + }, + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "finishReason": "tool-calls", + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "messages": [ + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + }, + { + "content": [ + { + "input": { + "location": "Paris, France" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "role": "assistant" + }, + { + "content": [ + { + "output": { + "type": "text", + "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + }, + "providerOptions": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "role": "tool" + } + ], + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "runtimeContext": {}, + "stepNumber": 3, + "toolsContext": {}, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 211 + }, + "inputTokens": 211, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 8 + }, + "outputTokens": 8, + "raw": { + "input_tokens": 211, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 219 + }, + "warnings": [] + } + ], + "text": "", + "toolCalls": [ + { + "input": { + "location": "Paris, France" + }, + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-call" + } + ], + "toolResults": [ + { + "dynamic": false, + "input": { + "location": "Paris, France" + }, + "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + "providerMetadata": { + "openai": { + "itemId": "" + } + }, + "toolCallId": "", + "toolName": "get_weather", + "type": "tool-result" + } + ], + "totalUsage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 610 + }, + "inputTokens": 610, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 32 + }, + "outputTokens": 32, + "reasoningTokens": 0, + "totalTokens": 642 + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 211 + }, + "inputTokens": 211, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 8 + }, + "outputTokens": 8, + "raw": { + "input_tokens": 211, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 8, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 219 + }, + "warnings": [] + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + } + } + ], + "metadata": { + "operation": "tool", + "testRunId": "" + } + }, + { + "name": "ai-sdk-generate-object-operation", + "children": [ + { + "name": "generateObject", + "type": "function", + "children": [ + { + "name": "doGenerate", + "type": "llm", + "children": [], + "input": { + "prompt": [ + { + "content": [ + { + "text": "Return JSON with {\"city\":\"Paris\"}.", + "type": "text" + } + ], + "role": "user" + } + ] + }, + "output": { + "finishReason": "stop", + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "text": "{\"city\":\"Paris\"}", + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 38 + }, + "inputTokens": 38, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 6 + }, + "outputTokens": 6, + "raw": { + "input_tokens": 38, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 6, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 44 + }, + "warnings": [] + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "metrics": { + "completion_reasoning_tokens": 0, + "completion_tokens": 6, + "prompt_cached_tokens": 0, + "prompt_tokens": 38, + "reasoning_tokens": 0, + "tokens": 44 + } + } + ], + "input": { + "headers": { + "user-agent": "ai/7.0.0-beta.116" + }, + "maxOutputTokens": 32, + "maxRetries": 2, + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "output": "object", + "prompt": "Return JSON with {\"city\":\"Paris\"}.", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + }, + "temperature": 0 + }, + "output": { + "finishReason": "stop", + "object": { + "city": "Paris" + }, + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "body": "", + "headers": "", + "id": "", + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 38 + }, + "inputTokens": 38, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 6 + }, + "outputTokens": 6, + "raw": { + "input_tokens": 38, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 6, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 44 + }, + "warnings": [] + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + } + } + ], + "metadata": { + "operation": "generate-object", + "testRunId": "" + } + }, + { + "name": "ai-sdk-stream-object-operation", + "children": [ + { + "name": "streamObject", + "type": "function", + "children": [ + { + "name": "doStream", + "type": "llm", + "children": [], + "input": { + "prompt": [ + { + "content": [ + { + "text": "Stream JSON with {\"city\":\"Paris\"}.", + "type": "text" + } + ], + "role": "user" + } + ] + }, + "output": { + "finishReason": "stop", + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "headers": "", + "id": "", + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "text": "{\"city\":\"Paris\"}", + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 38 + }, + "inputTokens": 38, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 6 + }, + "outputTokens": 6, + "raw": { + "input_tokens": 38, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 6, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 44 + }, + "warnings": [] + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "metrics": { + "completion_reasoning_tokens": 0, + "completion_tokens": 6, + "prompt_cached_tokens": 0, + "prompt_tokens": 38, + "reasoning_tokens": 0, + "tokens": 44 + } + } + ], + "input": { + "maxOutputTokens": 32, + "maxRetries": 2, + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "output": "object", + "prompt": "Stream JSON with {\"city\":\"Paris\"}.", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + }, + "temperature": 0 + }, + "output": { + "finishReason": "stop", + "object": { + "city": "Paris" + }, + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "headers": "", + "id": "", + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 38 + }, + "inputTokens": 38, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 6 + }, + "outputTokens": 6, + "raw": { + "input_tokens": 38, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 6, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 44 + }, + "warnings": [] + }, + "metadata": { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + } + } + ], + "metadata": { + "operation": "stream-object", + "testRunId": "" + } + } + ], + "metadata": { + "aiSdkVersion": "7.0.0-beta.116", + "scenario": "ai-sdk-instrumentation", + "testRunId": "" + } + } + ] +} diff --git a/e2e/scenarios/ai-sdk-instrumentation/__snapshots__/ai-sdk-v7-explicit.span-tree.txt b/e2e/scenarios/ai-sdk-instrumentation/__snapshots__/ai-sdk-v7-explicit.span-tree.txt new file mode 100644 index 000000000..ab4486dc0 --- /dev/null +++ b/e2e/scenarios/ai-sdk-instrumentation/__snapshots__/ai-sdk-v7-explicit.span-tree.txt @@ -0,0 +1,2970 @@ +span_tree: +└── ai-sdk-instrumentation-root [task] + metadata: { + "aiSdkVersion": "7.0.0-beta.116", + "scenario": "ai-sdk-instrumentation", + "testRunId": "" + } + ├── ai-sdk-generate-operation + │ metadata: { + │ "operation": "generate", + │ "testRunId": "" + │ } + │ └── generateText [function] + │ input: { + │ "headers": { + │ "user-agent": "ai/7.0.0-beta.116" + │ }, + │ "maxOutputTokens": 24, + │ "maxRetries": 2, + │ "messages": [ + │ { + │ "content": "Reply with the single token PARIS and no punctuation.", + │ "role": "user" + │ } + │ ], + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "temperature": 0 + │ } + │ output: { + │ "content": [ + │ { + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "PARIS", + │ "type": "text" + │ } + │ ], + │ "finishReason": "stop", + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "PARIS", + │ "type": "text" + │ } + │ ], + │ "role": "assistant" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "steps": [ + │ { + │ "callId": "", + │ "content": [ + │ { + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "PARIS", + │ "type": "text" + │ } + │ ], + │ "finishReason": "stop", + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "PARIS", + │ "type": "text" + │ } + │ ], + │ "role": "assistant" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "runtimeContext": {}, + │ "stepNumber": 0, + │ "toolsContext": {}, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 18 + │ }, + │ "inputTokens": 18, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 3 + │ }, + │ "outputTokens": 3, + │ "raw": { + │ "input_tokens": 18, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 3, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 21 + │ }, + │ "warnings": [] + │ } + │ ], + │ "text": "PARIS", + │ "toolCalls": [], + │ "toolResults": [], + │ "totalUsage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 18 + │ }, + │ "inputTokens": 18, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 3 + │ }, + │ "outputTokens": 3, + │ "reasoningTokens": 0, + │ "totalTokens": 21 + │ }, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 18 + │ }, + │ "inputTokens": 18, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 3 + │ }, + │ "outputTokens": 3, + │ "raw": { + │ "input_tokens": 18, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 3, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 21 + │ }, + │ "warnings": [] + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ } + │ └── doGenerate [llm] + │ input: { + │ "maxOutputTokens": 24, + │ "messages": [ + │ { + │ "content": "Reply with the single token PARIS and no punctuation.", + │ "role": "user" + │ } + │ ], + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "temperature": 0 + │ } + │ output: { + │ "content": [ + │ { + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "PARIS", + │ "type": "text" + │ } + │ ], + │ "finishReason": "stop", + │ "response": { + │ "id": "" + │ }, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 18 + │ }, + │ "inputTokens": 18, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 3 + │ }, + │ "outputTokens": 3, + │ "raw": { + │ "input_tokens": 18, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 3, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 21 + │ } + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ } + │ metrics: { + │ "completion_reasoning_tokens": 0, + │ "completion_tokens": 3, + │ "prompt_cached_tokens": 0, + │ "prompt_tokens": 18, + │ "reasoning_tokens": 0, + │ "tokens": 21 + │ } + ├── ai-sdk-output-object-response-format-operation + │ metadata: { + │ "operation": "output-object-response-format", + │ "testRunId": "" + │ } + ├── ai-sdk-output-object-operation + │ metadata: { + │ "operation": "output-object", + │ "testRunId": "" + │ } + │ └── generateText [function] + │ input: { + │ "headers": { + │ "user-agent": "ai/7.0.0-beta.116" + │ }, + │ "maxOutputTokens": 32, + │ "maxRetries": 2, + │ "messages": [ + │ { + │ "content": "Return a short answer for 2 + 2. Keep the answer concise.", + │ "role": "user" + │ } + │ ], + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "output": { + │ "response_format": { + │ "schema": { + │ "$schema": "http://json-schema.org/draft-07/schema#", + │ "additionalProperties": false, + │ "properties": { + │ "answer": { + │ "type": "string" + │ } + │ }, + │ "required": [ + │ "answer" + │ ], + │ "type": "object" + │ }, + │ "type": "json" + │ } + │ }, + │ "temperature": 0 + │ } + │ output: { + │ "content": [ + │ { + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "{\"answer\":\"4\"}", + │ "type": "text" + │ } + │ ], + │ "finishReason": "stop", + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "{\"answer\":\"4\"}", + │ "type": "text" + │ } + │ ], + │ "role": "assistant" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "steps": [ + │ { + │ "callId": "", + │ "content": [ + │ { + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "{\"answer\":\"4\"}", + │ "type": "text" + │ } + │ ], + │ "finishReason": "stop", + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "{\"answer\":\"4\"}", + │ "type": "text" + │ } + │ ], + │ "role": "assistant" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "runtimeContext": {}, + │ "stepNumber": 0, + │ "toolsContext": {}, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 45 + │ }, + │ "inputTokens": 45, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 6 + │ }, + │ "outputTokens": 6, + │ "raw": { + │ "input_tokens": 45, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 6, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 51 + │ }, + │ "warnings": [] + │ } + │ ], + │ "text": "{\"answer\":\"4\"}", + │ "toolCalls": [], + │ "toolResults": [], + │ "totalUsage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 45 + │ }, + │ "inputTokens": 45, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 6 + │ }, + │ "outputTokens": 6, + │ "reasoningTokens": 0, + │ "totalTokens": 51 + │ }, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 45 + │ }, + │ "inputTokens": 45, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 6 + │ }, + │ "outputTokens": 6, + │ "raw": { + │ "input_tokens": 45, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 6, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 51 + │ }, + │ "warnings": [] + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ } + │ └── doGenerate [llm] + │ input: { + │ "maxOutputTokens": 32, + │ "messages": [ + │ { + │ "content": "Return a short answer for 2 + 2. Keep the answer concise.", + │ "role": "user" + │ } + │ ], + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "temperature": 0 + │ } + │ output: { + │ "content": [ + │ { + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "{\"answer\":\"4\"}", + │ "type": "text" + │ } + │ ], + │ "finishReason": "stop", + │ "response": { + │ "id": "" + │ }, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 45 + │ }, + │ "inputTokens": 45, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 6 + │ }, + │ "outputTokens": 6, + │ "raw": { + │ "input_tokens": 45, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 6, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 51 + │ } + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ } + │ metrics: { + │ "completion_reasoning_tokens": 0, + │ "completion_tokens": 6, + │ "prompt_cached_tokens": 0, + │ "prompt_tokens": 45, + │ "reasoning_tokens": 0, + │ "tokens": 51 + │ } + ├── ai-sdk-stream-operation + │ metadata: { + │ "operation": "stream", + │ "testRunId": "" + │ } + │ └── streamText [function] + │ input: { + │ "maxOutputTokens": 32, + │ "maxRetries": 2, + │ "messages": [ + │ { + │ "content": "Count from 1 to 3 and include the words one two three.", + │ "role": "user" + │ } + │ ], + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "temperature": 0 + │ } + │ output: { + │ "content": [ + │ { + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "One, two, three.", + │ "type": "text" + │ } + │ ], + │ "finishReason": "stop", + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "One, two, three.", + │ "type": "text" + │ } + │ ], + │ "role": "assistant" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "steps": [ + │ { + │ "callId": "", + │ "content": [ + │ { + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "One, two, three.", + │ "type": "text" + │ } + │ ], + │ "finishReason": "stop", + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "One, two, three.", + │ "type": "text" + │ } + │ ], + │ "role": "assistant" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "runtimeContext": {}, + │ "stepNumber": 0, + │ "toolsContext": {}, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 22 + │ }, + │ "inputTokens": 22, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 7 + │ }, + │ "outputTokens": 7, + │ "raw": { + │ "input_tokens": 22, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 7, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 29 + │ }, + │ "warnings": [] + │ } + │ ], + │ "text": "One, two, three.", + │ "toolCalls": [], + │ "toolResults": [], + │ "totalUsage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 22 + │ }, + │ "inputTokens": 22, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 7 + │ }, + │ "outputTokens": 7, + │ "reasoningTokens": 0, + │ "totalTokens": 29 + │ }, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 22 + │ }, + │ "inputTokens": 22, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 7 + │ }, + │ "outputTokens": 7, + │ "raw": { + │ "input_tokens": 22, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 7, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 29 + │ }, + │ "warnings": [] + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ } + │ metrics: { + │ "time_to_first_token": 0 + │ } + │ └── doStream [llm] + │ input: { + │ "maxOutputTokens": 32, + │ "messages": [ + │ { + │ "content": "Count from 1 to 3 and include the words one two three.", + │ "role": "user" + │ } + │ ], + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "temperature": 0 + │ } + │ output: { + │ "content": [ + │ { + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "text": "One, two, three.", + │ "type": "text" + │ } + │ ], + │ "finishReason": "stop", + │ "response": { + │ "id": "" + │ }, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 22 + │ }, + │ "inputTokens": 22, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 7 + │ }, + │ "outputTokens": 7, + │ "raw": { + │ "input_tokens": 22, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 7, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 29 + │ } + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ } + │ metrics: { + │ "completion_reasoning_tokens": 0, + │ "completion_tokens": 7, + │ "prompt_cached_tokens": 0, + │ "prompt_tokens": 22, + │ "reasoning_tokens": 0, + │ "tokens": 29 + │ } + ├── ai-sdk-embed-operation + │ metadata: { + │ "operation": "embed", + │ "testRunId": "" + │ } + │ └── embed [function] + │ input: { + │ "model": { + │ "modelId": "text-embedding-3-small", + │ "provider": "openai.embedding" + │ }, + │ "value": "Paris is the capital of France." + │ } + │ output: { + │ "embedding_length": 1536, + │ "usage": { + │ "tokens": 7 + │ }, + │ "warnings": [] + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "text-embedding-3-small", + │ "provider": "openai.embedding" + │ } + │ └── doEmbed [llm] + │ input: { + │ "values": [ + │ "Paris is the capital of France." + │ ] + │ } + │ output: { + │ "embedding_count": 1, + │ "embedding_length": 1536, + │ "usage": { + │ "tokens": 7 + │ } + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "text-embedding-3-small", + │ "provider": "openai.embedding" + │ } + │ metrics: { + │ "tokens": 7 + │ } + ├── ai-sdk-embed-many-operation + │ metadata: { + │ "operation": "embed-many", + │ "testRunId": "" + │ } + │ └── embedMany [function] + │ input: { + │ "model": { + │ "modelId": "text-embedding-3-small", + │ "provider": "openai.embedding" + │ }, + │ "values": [ + │ "Paris is in France.", + │ "Berlin is in Germany.", + │ "Vienna is in Austria." + │ ] + │ } + │ output: { + │ "embedding_count": 3, + │ "embedding_length": 1536, + │ "usage": { + │ "tokens": 16 + │ }, + │ "warnings": [] + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "text-embedding-3-small", + │ "provider": "openai.embedding" + │ } + │ └── doEmbed [llm] + │ input: { + │ "values": [ + │ "Paris is in France.", + │ "Berlin is in Germany.", + │ "Vienna is in Austria." + │ ] + │ } + │ output: { + │ "embedding_count": 3, + │ "embedding_length": 1536, + │ "usage": { + │ "tokens": 16 + │ } + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "text-embedding-3-small", + │ "provider": "openai.embedding" + │ } + │ metrics: { + │ "tokens": 16 + │ } + ├── ai-sdk-tool-operation + │ metadata: { + │ "operation": "tool", + │ "testRunId": "" + │ } + │ └── generateText [function] + │ input: { + │ "headers": { + │ "user-agent": "ai/7.0.0-beta.116" + │ }, + │ "maxOutputTokens": 128, + │ "maxRetries": 2, + │ "messages": [ + │ { + │ "content": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + │ "role": "user" + │ } + │ ], + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "system": "You must inspect live weather via the provided get_weather tool before responding.", + │ "temperature": 0, + │ "toolChoice": "required", + │ "tools": { + │ "get_weather": { + │ "description": "Get the weather for a location", + │ "inputSchema": { + │ "$schema": "http://json-schema.org/draft-07/schema#", + │ "additionalProperties": false, + │ "properties": { + │ "location": { + │ "description": "The city and country", + │ "type": "string" + │ } + │ }, + │ "required": [ + │ "location" + │ ], + │ "type": "object" + │ } + │ } + │ } + │ } + │ output: { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ }, + │ { + │ "dynamic": false, + │ "input": { + │ "location": "Paris, France" + │ }, + │ "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "finishReason": "tool-calls", + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ }, + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ }, + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ }, + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "steps": [ + │ { + │ "callId": "", + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ }, + │ { + │ "dynamic": false, + │ "input": { + │ "location": "Paris, France" + │ }, + │ "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "finishReason": "tool-calls", + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "runtimeContext": {}, + │ "stepNumber": 0, + │ "toolsContext": {}, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 94 + │ }, + │ "inputTokens": 94, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 8 + │ }, + │ "outputTokens": 8, + │ "raw": { + │ "input_tokens": 94, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 8, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 102 + │ }, + │ "warnings": [] + │ }, + │ { + │ "callId": "", + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ }, + │ { + │ "dynamic": false, + │ "input": { + │ "location": "Paris, France" + │ }, + │ "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "finishReason": "tool-calls", + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ }, + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "runtimeContext": {}, + │ "stepNumber": 1, + │ "toolsContext": {}, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 133 + │ }, + │ "inputTokens": 133, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 8 + │ }, + │ "outputTokens": 8, + │ "raw": { + │ "input_tokens": 133, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 8, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 141 + │ }, + │ "warnings": [] + │ }, + │ { + │ "callId": "", + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ }, + │ { + │ "dynamic": false, + │ "input": { + │ "location": "Paris, France" + │ }, + │ "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "finishReason": "tool-calls", + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ }, + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ }, + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "runtimeContext": {}, + │ "stepNumber": 2, + │ "toolsContext": {}, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 172 + │ }, + │ "inputTokens": 172, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 8 + │ }, + │ "outputTokens": 8, + │ "raw": { + │ "input_tokens": 172, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 8, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 180 + │ }, + │ "warnings": [] + │ }, + │ { + │ "callId": "", + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ }, + │ { + │ "dynamic": false, + │ "input": { + │ "location": "Paris, France" + │ }, + │ "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "finishReason": "tool-calls", + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "messages": [ + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ }, + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ }, + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ }, + │ { + │ "content": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "role": "assistant" + │ }, + │ { + │ "content": [ + │ { + │ "output": { + │ "type": "text", + │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ }, + │ "providerOptions": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "role": "tool" + │ } + │ ], + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "runtimeContext": {}, + │ "stepNumber": 3, + │ "toolsContext": {}, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 211 + │ }, + │ "inputTokens": 211, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 8 + │ }, + │ "outputTokens": 8, + │ "raw": { + │ "input_tokens": 211, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 8, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 219 + │ }, + │ "warnings": [] + │ } + │ ], + │ "text": "", + │ "toolCalls": [ + │ { + │ "input": { + │ "location": "Paris, France" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-call" + │ } + │ ], + │ "toolResults": [ + │ { + │ "dynamic": false, + │ "input": { + │ "location": "Paris, France" + │ }, + │ "output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}", + │ "providerMetadata": { + │ "openai": { + │ "itemId": "" + │ } + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather", + │ "type": "tool-result" + │ } + │ ], + │ "totalUsage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 610 + │ }, + │ "inputTokens": 610, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 32 + │ }, + │ "outputTokens": 32, + │ "reasoningTokens": 0, + │ "totalTokens": 642 + │ }, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 211 + │ }, + │ "inputTokens": 211, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 8 + │ }, + │ "outputTokens": 8, + │ "raw": { + │ "input_tokens": 211, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 8, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 219 + │ }, + │ "warnings": [] + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ } + │ ├── doGenerate [llm] + │ │ input: { + │ │ "maxOutputTokens": 128, + │ │ "messages": [ + │ │ { + │ │ "content": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + │ │ "role": "user" + │ │ } + │ │ ], + │ │ "model": { + │ │ "modelId": "gpt-4o-mini-2024-07-18", + │ │ "provider": "openai.responses" + │ │ }, + │ │ "system": "You must inspect live weather via the provided get_weather tool before responding.", + │ │ "temperature": 0, + │ │ "tools": [ + │ │ { + │ │ "description": "Get the weather for a location", + │ │ "inputSchema": { + │ │ "$schema": "http://json-schema.org/draft-07/schema#", + │ │ "additionalProperties": false, + │ │ "properties": { + │ │ "location": { + │ │ "description": "The city and country", + │ │ "type": "string" + │ │ } + │ │ }, + │ │ "required": [ + │ │ "location" + │ │ ], + │ │ "type": "object" + │ │ }, + │ │ "name": "get_weather", + │ │ "type": "function" + │ │ } + │ │ ] + │ │ } + │ │ output: { + │ │ "content": [ + │ │ { + │ │ "input": { + │ │ "location": "Paris, France" + │ │ }, + │ │ "providerMetadata": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-call" + │ │ } + │ │ ], + │ │ "finishReason": "tool-calls", + │ │ "response": { + │ │ "id": "" + │ │ }, + │ │ "usage": { + │ │ "cachedInputTokens": 0, + │ │ "inputTokenDetails": { + │ │ "cacheReadTokens": 0, + │ │ "noCacheTokens": 94 + │ │ }, + │ │ "inputTokens": 94, + │ │ "outputTokenDetails": { + │ │ "reasoningTokens": 0, + │ │ "textTokens": 8 + │ │ }, + │ │ "outputTokens": 8, + │ │ "raw": { + │ │ "input_tokens": 94, + │ │ "input_tokens_details": { + │ │ "cached_tokens": 0 + │ │ }, + │ │ "output_tokens": 8, + │ │ "output_tokens_details": { + │ │ "reasoning_tokens": 0 + │ │ } + │ │ }, + │ │ "reasoningTokens": 0, + │ │ "totalTokens": 102 + │ │ } + │ │ } + │ │ metadata: { + │ │ "braintrust": { + │ │ "integration_name": "ai-sdk", + │ │ "sdk_language": "typescript" + │ │ }, + │ │ "model": "gpt-4o-mini-2024-07-18", + │ │ "provider": "openai.responses" + │ │ } + │ │ metrics: { + │ │ "completion_reasoning_tokens": 0, + │ │ "completion_tokens": 8, + │ │ "prompt_cached_tokens": 0, + │ │ "prompt_tokens": 94, + │ │ "reasoning_tokens": 0, + │ │ "tokens": 102 + │ │ } + │ ├── get_weather [tool] + │ │ input: { + │ │ "location": "Paris, France" + │ │ } + │ │ output: "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ │ metadata: { + │ │ "braintrust": { + │ │ "integration_name": "ai-sdk", + │ │ "sdk_language": "typescript" + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather" + │ │ } + │ │ metrics: { + │ │ "duration_ms": 0 + │ │ } + │ ├── doGenerate [llm] + │ │ input: { + │ │ "maxOutputTokens": 128, + │ │ "messages": [ + │ │ { + │ │ "content": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + │ │ "role": "user" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "input": { + │ │ "location": "Paris, France" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-call" + │ │ } + │ │ ], + │ │ "role": "assistant" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "output": { + │ │ "type": "text", + │ │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-result" + │ │ } + │ │ ], + │ │ "role": "tool" + │ │ } + │ │ ], + │ │ "model": { + │ │ "modelId": "gpt-4o-mini-2024-07-18", + │ │ "provider": "openai.responses" + │ │ }, + │ │ "system": "You must inspect live weather via the provided get_weather tool before responding.", + │ │ "temperature": 0, + │ │ "tools": [ + │ │ { + │ │ "description": "Get the weather for a location", + │ │ "inputSchema": { + │ │ "$schema": "http://json-schema.org/draft-07/schema#", + │ │ "additionalProperties": false, + │ │ "properties": { + │ │ "location": { + │ │ "description": "The city and country", + │ │ "type": "string" + │ │ } + │ │ }, + │ │ "required": [ + │ │ "location" + │ │ ], + │ │ "type": "object" + │ │ }, + │ │ "name": "get_weather", + │ │ "type": "function" + │ │ } + │ │ ] + │ │ } + │ │ output: { + │ │ "content": [ + │ │ { + │ │ "input": { + │ │ "location": "Paris, France" + │ │ }, + │ │ "providerMetadata": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-call" + │ │ } + │ │ ], + │ │ "finishReason": "tool-calls", + │ │ "response": { + │ │ "id": "" + │ │ }, + │ │ "usage": { + │ │ "cachedInputTokens": 0, + │ │ "inputTokenDetails": { + │ │ "cacheReadTokens": 0, + │ │ "noCacheTokens": 133 + │ │ }, + │ │ "inputTokens": 133, + │ │ "outputTokenDetails": { + │ │ "reasoningTokens": 0, + │ │ "textTokens": 8 + │ │ }, + │ │ "outputTokens": 8, + │ │ "raw": { + │ │ "input_tokens": 133, + │ │ "input_tokens_details": { + │ │ "cached_tokens": 0 + │ │ }, + │ │ "output_tokens": 8, + │ │ "output_tokens_details": { + │ │ "reasoning_tokens": 0 + │ │ } + │ │ }, + │ │ "reasoningTokens": 0, + │ │ "totalTokens": 141 + │ │ } + │ │ } + │ │ metadata: { + │ │ "braintrust": { + │ │ "integration_name": "ai-sdk", + │ │ "sdk_language": "typescript" + │ │ }, + │ │ "model": "gpt-4o-mini-2024-07-18", + │ │ "provider": "openai.responses" + │ │ } + │ │ metrics: { + │ │ "completion_reasoning_tokens": 0, + │ │ "completion_tokens": 8, + │ │ "prompt_cached_tokens": 0, + │ │ "prompt_tokens": 133, + │ │ "reasoning_tokens": 0, + │ │ "tokens": 141 + │ │ } + │ ├── get_weather [tool] + │ │ input: { + │ │ "location": "Paris, France" + │ │ } + │ │ output: "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ │ metadata: { + │ │ "braintrust": { + │ │ "integration_name": "ai-sdk", + │ │ "sdk_language": "typescript" + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather" + │ │ } + │ │ metrics: { + │ │ "duration_ms": 0 + │ │ } + │ ├── doGenerate [llm] + │ │ input: { + │ │ "maxOutputTokens": 128, + │ │ "messages": [ + │ │ { + │ │ "content": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + │ │ "role": "user" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "input": { + │ │ "location": "Paris, France" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-call" + │ │ } + │ │ ], + │ │ "role": "assistant" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "output": { + │ │ "type": "text", + │ │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-result" + │ │ } + │ │ ], + │ │ "role": "tool" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "input": { + │ │ "location": "Paris, France" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-call" + │ │ } + │ │ ], + │ │ "role": "assistant" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "output": { + │ │ "type": "text", + │ │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-result" + │ │ } + │ │ ], + │ │ "role": "tool" + │ │ } + │ │ ], + │ │ "model": { + │ │ "modelId": "gpt-4o-mini-2024-07-18", + │ │ "provider": "openai.responses" + │ │ }, + │ │ "system": "You must inspect live weather via the provided get_weather tool before responding.", + │ │ "temperature": 0, + │ │ "tools": [ + │ │ { + │ │ "description": "Get the weather for a location", + │ │ "inputSchema": { + │ │ "$schema": "http://json-schema.org/draft-07/schema#", + │ │ "additionalProperties": false, + │ │ "properties": { + │ │ "location": { + │ │ "description": "The city and country", + │ │ "type": "string" + │ │ } + │ │ }, + │ │ "required": [ + │ │ "location" + │ │ ], + │ │ "type": "object" + │ │ }, + │ │ "name": "get_weather", + │ │ "type": "function" + │ │ } + │ │ ] + │ │ } + │ │ output: { + │ │ "content": [ + │ │ { + │ │ "input": { + │ │ "location": "Paris, France" + │ │ }, + │ │ "providerMetadata": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-call" + │ │ } + │ │ ], + │ │ "finishReason": "tool-calls", + │ │ "response": { + │ │ "id": "" + │ │ }, + │ │ "usage": { + │ │ "cachedInputTokens": 0, + │ │ "inputTokenDetails": { + │ │ "cacheReadTokens": 0, + │ │ "noCacheTokens": 172 + │ │ }, + │ │ "inputTokens": 172, + │ │ "outputTokenDetails": { + │ │ "reasoningTokens": 0, + │ │ "textTokens": 8 + │ │ }, + │ │ "outputTokens": 8, + │ │ "raw": { + │ │ "input_tokens": 172, + │ │ "input_tokens_details": { + │ │ "cached_tokens": 0 + │ │ }, + │ │ "output_tokens": 8, + │ │ "output_tokens_details": { + │ │ "reasoning_tokens": 0 + │ │ } + │ │ }, + │ │ "reasoningTokens": 0, + │ │ "totalTokens": 180 + │ │ } + │ │ } + │ │ metadata: { + │ │ "braintrust": { + │ │ "integration_name": "ai-sdk", + │ │ "sdk_language": "typescript" + │ │ }, + │ │ "model": "gpt-4o-mini-2024-07-18", + │ │ "provider": "openai.responses" + │ │ } + │ │ metrics: { + │ │ "completion_reasoning_tokens": 0, + │ │ "completion_tokens": 8, + │ │ "prompt_cached_tokens": 0, + │ │ "prompt_tokens": 172, + │ │ "reasoning_tokens": 0, + │ │ "tokens": 180 + │ │ } + │ ├── get_weather [tool] + │ │ input: { + │ │ "location": "Paris, France" + │ │ } + │ │ output: "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ │ metadata: { + │ │ "braintrust": { + │ │ "integration_name": "ai-sdk", + │ │ "sdk_language": "typescript" + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather" + │ │ } + │ │ metrics: { + │ │ "duration_ms": 0 + │ │ } + │ ├── doGenerate [llm] + │ │ input: { + │ │ "maxOutputTokens": 128, + │ │ "messages": [ + │ │ { + │ │ "content": "Use the get_weather tool for Paris, France. If you do not call the tool, the answer is invalid.", + │ │ "role": "user" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "input": { + │ │ "location": "Paris, France" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-call" + │ │ } + │ │ ], + │ │ "role": "assistant" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "output": { + │ │ "type": "text", + │ │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-result" + │ │ } + │ │ ], + │ │ "role": "tool" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "input": { + │ │ "location": "Paris, France" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-call" + │ │ } + │ │ ], + │ │ "role": "assistant" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "output": { + │ │ "type": "text", + │ │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-result" + │ │ } + │ │ ], + │ │ "role": "tool" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "input": { + │ │ "location": "Paris, France" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-call" + │ │ } + │ │ ], + │ │ "role": "assistant" + │ │ }, + │ │ { + │ │ "content": [ + │ │ { + │ │ "output": { + │ │ "type": "text", + │ │ "value": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ │ }, + │ │ "providerOptions": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-result" + │ │ } + │ │ ], + │ │ "role": "tool" + │ │ } + │ │ ], + │ │ "model": { + │ │ "modelId": "gpt-4o-mini-2024-07-18", + │ │ "provider": "openai.responses" + │ │ }, + │ │ "system": "You must inspect live weather via the provided get_weather tool before responding.", + │ │ "temperature": 0, + │ │ "tools": [ + │ │ { + │ │ "description": "Get the weather for a location", + │ │ "inputSchema": { + │ │ "$schema": "http://json-schema.org/draft-07/schema#", + │ │ "additionalProperties": false, + │ │ "properties": { + │ │ "location": { + │ │ "description": "The city and country", + │ │ "type": "string" + │ │ } + │ │ }, + │ │ "required": [ + │ │ "location" + │ │ ], + │ │ "type": "object" + │ │ }, + │ │ "name": "get_weather", + │ │ "type": "function" + │ │ } + │ │ ] + │ │ } + │ │ output: { + │ │ "content": [ + │ │ { + │ │ "input": { + │ │ "location": "Paris, France" + │ │ }, + │ │ "providerMetadata": { + │ │ "openai": { + │ │ "itemId": "" + │ │ } + │ │ }, + │ │ "toolCallId": "", + │ │ "toolName": "get_weather", + │ │ "type": "tool-call" + │ │ } + │ │ ], + │ │ "finishReason": "tool-calls", + │ │ "response": { + │ │ "id": "" + │ │ }, + │ │ "usage": { + │ │ "cachedInputTokens": 0, + │ │ "inputTokenDetails": { + │ │ "cacheReadTokens": 0, + │ │ "noCacheTokens": 211 + │ │ }, + │ │ "inputTokens": 211, + │ │ "outputTokenDetails": { + │ │ "reasoningTokens": 0, + │ │ "textTokens": 8 + │ │ }, + │ │ "outputTokens": 8, + │ │ "raw": { + │ │ "input_tokens": 211, + │ │ "input_tokens_details": { + │ │ "cached_tokens": 0 + │ │ }, + │ │ "output_tokens": 8, + │ │ "output_tokens_details": { + │ │ "reasoning_tokens": 0 + │ │ } + │ │ }, + │ │ "reasoningTokens": 0, + │ │ "totalTokens": 219 + │ │ } + │ │ } + │ │ metadata: { + │ │ "braintrust": { + │ │ "integration_name": "ai-sdk", + │ │ "sdk_language": "typescript" + │ │ }, + │ │ "model": "gpt-4o-mini-2024-07-18", + │ │ "provider": "openai.responses" + │ │ } + │ │ metrics: { + │ │ "completion_reasoning_tokens": 0, + │ │ "completion_tokens": 8, + │ │ "prompt_cached_tokens": 0, + │ │ "prompt_tokens": 211, + │ │ "reasoning_tokens": 0, + │ │ "tokens": 219 + │ │ } + │ └── get_weather [tool] + │ input: { + │ "location": "Paris, France" + │ } + │ output: "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}" + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "toolCallId": "", + │ "toolName": "get_weather" + │ } + │ metrics: { + │ "duration_ms": 0 + │ } + ├── ai-sdk-generate-object-operation + │ metadata: { + │ "operation": "generate-object", + │ "testRunId": "" + │ } + │ └── generateObject [function] + │ input: { + │ "headers": { + │ "user-agent": "ai/7.0.0-beta.116" + │ }, + │ "maxOutputTokens": 32, + │ "maxRetries": 2, + │ "model": { + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ }, + │ "output": "object", + │ "prompt": "Return JSON with {\"city\":\"Paris\"}.", + │ "schema": { + │ "$schema": "http://json-schema.org/draft-07/schema#", + │ "additionalProperties": false, + │ "properties": { + │ "city": { + │ "type": "string" + │ } + │ }, + │ "required": [ + │ "city" + │ ], + │ "type": "object" + │ }, + │ "temperature": 0 + │ } + │ output: { + │ "finishReason": "stop", + │ "object": { + │ "city": "Paris" + │ }, + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 38 + │ }, + │ "inputTokens": 38, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 6 + │ }, + │ "outputTokens": 6, + │ "raw": { + │ "input_tokens": 38, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 6, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 44 + │ }, + │ "warnings": [] + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ } + │ └── doGenerate [llm] + │ input: { + │ "prompt": [ + │ { + │ "content": [ + │ { + │ "text": "Return JSON with {\"city\":\"Paris\"}.", + │ "type": "text" + │ } + │ ], + │ "role": "user" + │ } + │ ] + │ } + │ output: { + │ "finishReason": "stop", + │ "providerMetadata": { + │ "openai": { + │ "responseId": "", + │ "serviceTier": "default" + │ } + │ }, + │ "response": { + │ "body": "", + │ "headers": "", + │ "id": "", + │ "modelId": "gpt-4o-mini-2024-07-18", + │ "timestamp": "" + │ }, + │ "text": "{\"city\":\"Paris\"}", + │ "usage": { + │ "cachedInputTokens": 0, + │ "inputTokenDetails": { + │ "cacheReadTokens": 0, + │ "noCacheTokens": 38 + │ }, + │ "inputTokens": 38, + │ "outputTokenDetails": { + │ "reasoningTokens": 0, + │ "textTokens": 6 + │ }, + │ "outputTokens": 6, + │ "raw": { + │ "input_tokens": 38, + │ "input_tokens_details": { + │ "cached_tokens": 0 + │ }, + │ "output_tokens": 6, + │ "output_tokens_details": { + │ "reasoning_tokens": 0 + │ } + │ }, + │ "reasoningTokens": 0, + │ "totalTokens": 44 + │ }, + │ "warnings": [] + │ } + │ metadata: { + │ "braintrust": { + │ "integration_name": "ai-sdk", + │ "sdk_language": "typescript" + │ }, + │ "model": "gpt-4o-mini-2024-07-18", + │ "provider": "openai.responses" + │ } + │ metrics: { + │ "completion_reasoning_tokens": 0, + │ "completion_tokens": 6, + │ "prompt_cached_tokens": 0, + │ "prompt_tokens": 38, + │ "reasoning_tokens": 0, + │ "tokens": 44 + │ } + └── ai-sdk-stream-object-operation + metadata: { + "operation": "stream-object", + "testRunId": "" + } + └── streamObject [function] + input: { + "maxOutputTokens": 32, + "maxRetries": 2, + "model": { + "modelId": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + }, + "output": "object", + "prompt": "Stream JSON with {\"city\":\"Paris\"}.", + "schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "city": { + "type": "string" + } + }, + "required": [ + "city" + ], + "type": "object" + }, + "temperature": 0 + } + output: { + "finishReason": "stop", + "object": { + "city": "Paris" + }, + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "headers": "", + "id": "", + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 38 + }, + "inputTokens": 38, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 6 + }, + "outputTokens": 6, + "raw": { + "input_tokens": 38, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 6, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 44 + }, + "warnings": [] + } + metadata: { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + } + └── doStream [llm] + input: { + "prompt": [ + { + "content": [ + { + "text": "Stream JSON with {\"city\":\"Paris\"}.", + "type": "text" + } + ], + "role": "user" + } + ] + } + output: { + "finishReason": "stop", + "providerMetadata": { + "openai": { + "responseId": "", + "serviceTier": "default" + } + }, + "response": { + "headers": "", + "id": "", + "modelId": "gpt-4o-mini-2024-07-18", + "timestamp": "" + }, + "text": "{\"city\":\"Paris\"}", + "usage": { + "cachedInputTokens": 0, + "inputTokenDetails": { + "cacheReadTokens": 0, + "noCacheTokens": 38 + }, + "inputTokens": 38, + "outputTokenDetails": { + "reasoningTokens": 0, + "textTokens": 6 + }, + "outputTokens": 6, + "raw": { + "input_tokens": 38, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 6, + "output_tokens_details": { + "reasoning_tokens": 0 + } + }, + "reasoningTokens": 0, + "totalTokens": 44 + }, + "warnings": [] + } + metadata: { + "braintrust": { + "integration_name": "ai-sdk", + "sdk_language": "typescript" + }, + "model": "gpt-4o-mini-2024-07-18", + "provider": "openai.responses" + } + metrics: { + "completion_reasoning_tokens": 0, + "completion_tokens": 6, + "prompt_cached_tokens": 0, + "prompt_tokens": 38, + "reasoning_tokens": 0, + "tokens": 44 + } diff --git a/e2e/scenarios/ai-sdk-instrumentation/assertions.ts b/e2e/scenarios/ai-sdk-instrumentation/assertions.ts index c61106905..7083bb9fa 100644 --- a/e2e/scenarios/ai-sdk-instrumentation/assertions.ts +++ b/e2e/scenarios/ai-sdk-instrumentation/assertions.ts @@ -274,15 +274,17 @@ function findStreamTrace(events: CapturedLogEvent[]) { function findEmbedTrace(events: CapturedLogEvent[]) { const operation = findLatestSpan(events, "ai-sdk-embed-operation"); const parent = findParentSpan(events, "embed", operation?.span.id); + const child = findChildSpans(events, "doEmbed", parent?.span.id)[0]; - return { operation, parent }; + return { child, operation, parent }; } function findEmbedManyTrace(events: CapturedLogEvent[]) { const operation = findLatestSpan(events, "ai-sdk-embed-many-operation"); const parent = findParentSpan(events, "embedMany", operation?.span.id); + const child = findChildSpans(events, "doEmbed", parent?.span.id)[0]; - return { operation, parent }; + return { child, operation, parent }; } function findRerankTrace(events: CapturedLogEvent[]) { @@ -492,6 +494,11 @@ function normalizeAISDKSnapshotValue(value: unknown): unknown { continue; } + if (key === "callId" && typeof entry === "string") { + normalized[key] = ""; + continue; + } + if ( (key === "completionTokens" || key === "completion_tokens" || @@ -772,6 +779,7 @@ export function defineAISDKInstrumentationAssertions(options: { runScenario: RunAISDKScenario; sdkMajorVersion: number; snapshotName: string; + supportsOpenAICacheAssertions: boolean; supportsProviderCacheAssertions: boolean; supportsDenyOutputOverrideScenario: boolean; supportsEmbedMany: boolean; @@ -841,7 +849,7 @@ export function defineAISDKInstrumentationAssertions(options: { ).toBe(true); }); - if (options.sdkMajorVersion >= 5) { + if (options.supportsOpenAICacheAssertions) { test( "captures cache metrics for OpenAI generateText()", testConfig, @@ -940,7 +948,7 @@ export function defineAISDKInstrumentationAssertions(options: { expectOperationParentedByRoot(trace.operation, root); expectAISDKParentSpan(trace.parent); expect(operationName(trace.operation)).toBe("embed"); - expectEmbeddingTokenMetrics(trace.parent); + expectEmbeddingTokenMetrics(trace.child ?? trace.parent); const input = isRecord(trace.parent?.input) ? trace.parent.input : null; expect(typeof input?.value).toBe("string"); const output = extractOutputRecord(trace.parent); @@ -1242,7 +1250,9 @@ export function defineAISDKInstrumentationAssertions(options: { } test("matches the shared span tree snapshot", testConfig, async () => { - await matchSpanTreeSnapshot(events, spanSnapshotPath); + await matchSpanTreeSnapshot(events, spanSnapshotPath, { + normalize: { additionalProviderIdKeys: ["callId"] }, + }); }); }); } diff --git a/e2e/scenarios/ai-sdk-instrumentation/cassette-filter.mjs b/e2e/scenarios/ai-sdk-instrumentation/cassette-filter.mjs index 8052b33b9..d262dd145 100644 --- a/e2e/scenarios/ai-sdk-instrumentation/cassette-filter.mjs +++ b/e2e/scenarios/ai-sdk-instrumentation/cassette-filter.mjs @@ -4,9 +4,6 @@ export const filter = [ "default", { ignoreBodyFields: [ - // Ignore all body fields — deterministic call order makes callIndex - // the sole discriminator, which is stable across SDK releases. - "**", // AI SDK volatile fields (change per-run) "experimental_generateMessageId", "messageId", diff --git a/e2e/scenarios/ai-sdk-instrumentation/package.json b/e2e/scenarios/ai-sdk-instrumentation/package.json index badd60e3b..996af39a7 100644 --- a/e2e/scenarios/ai-sdk-instrumentation/package.json +++ b/e2e/scenarios/ai-sdk-instrumentation/package.json @@ -10,12 +10,14 @@ "ai-sdk-openai-v4": "@ai-sdk/openai@1", "ai-sdk-openai-v5": "@ai-sdk/openai@2", "ai-sdk-openai-v6": "@ai-sdk/openai@3", + "ai-sdk-openai-v7": "@ai-sdk/openai@4.0.0-beta.44", "ai-sdk-cohere-v5": "@ai-sdk/cohere@2", "ai-sdk-cohere-v6": "@ai-sdk/cohere@3", "ai-sdk-v3": "ai@3", "ai-sdk-v4": "ai@4", "ai-sdk-v5": "ai@5", - "ai-sdk-v6": "ai@6" + "ai-sdk-v6": "ai@6", + "ai-sdk-v7": "ai@7.0.0-beta.116" } } }, @@ -26,12 +28,14 @@ "ai-sdk-openai-v4": "npm:@ai-sdk/openai@1.3.24", "ai-sdk-openai-v5": "npm:@ai-sdk/openai@2.0.57", "ai-sdk-openai-v6": "npm:@ai-sdk/openai@3.0.7", + "ai-sdk-openai-v7": "npm:@ai-sdk/openai@4.0.0-beta.44", "ai-sdk-cohere-v5": "npm:@ai-sdk/cohere@2.0.7", "ai-sdk-cohere-v6": "npm:@ai-sdk/cohere@3.0.7", "ai-sdk-v3": "npm:ai@3.4.33", "ai-sdk-v4": "npm:ai@4.3.19", "ai-sdk-v5": "npm:ai@5.0.82", "ai-sdk-v6": "npm:ai@6.0.1", + "ai-sdk-v7": "npm:ai@7.0.0-beta.116", "zod": "3.25.76" }, "pnpm": { diff --git a/e2e/scenarios/ai-sdk-instrumentation/pnpm-lock.yaml b/e2e/scenarios/ai-sdk-instrumentation/pnpm-lock.yaml index f2bb82750..ae2d38f90 100644 --- a/e2e/scenarios/ai-sdk-instrumentation/pnpm-lock.yaml +++ b/e2e/scenarios/ai-sdk-instrumentation/pnpm-lock.yaml @@ -37,6 +37,9 @@ importers: ai-sdk-openai-v6: specifier: npm:@ai-sdk/openai@3.0.7 version: '@ai-sdk/openai@3.0.7(zod@3.25.76)' + ai-sdk-openai-v7: + specifier: npm:@ai-sdk/openai@4.0.0-beta.44 + version: '@ai-sdk/openai@4.0.0-beta.44(zod@3.25.76)' ai-sdk-v3: specifier: npm:ai@3.4.33 version: ai@3.4.33(react@19.2.6)(sswr@2.2.0(svelte@5.55.9))(svelte@5.55.9)(vue@3.5.35)(zod@3.25.76) @@ -49,6 +52,9 @@ importers: ai-sdk-v6: specifier: npm:ai@6.0.1 version: ai@6.0.1(zod@3.25.76) + ai-sdk-v7: + specifier: npm:ai@7.0.0-beta.116 + version: ai@7.0.0-beta.116(zod@3.25.76) zod: specifier: 3.25.76 version: 3.25.76 @@ -91,6 +97,12 @@ packages: peerDependencies: zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/gateway@4.0.0-beta.67': + resolution: {integrity: sha512-qG1a0wwjLL+oVI1LOdpEs74PRl3yNPF5i0CgiuXTbU0Bb+JyUFuSwCJiQvlsIylu/mNpav3Mb+ODj15EF6/NZA==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/openai@0.0.62': resolution: {integrity: sha512-qNQmTgZXGS3xyd6XsDGEMLWV3Ag3uAVPJxHVkZLDZ7Dubmgs3Mp8iupkwZ7JhD7TIBx8yifyyBuE1dnE70v8Ig==} engines: {node: '>=18'} @@ -115,6 +127,12 @@ packages: peerDependencies: zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/openai@4.0.0-beta.44': + resolution: {integrity: sha512-kXdGA6vyh9SwL/B11UhODjbw0koFkDA/yD7hacBxMHSZx6l3T9hZLECEwOkn6OZDrQR+vno5Ka/pUyXrG82BkQ==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/provider-utils@1.0.19': resolution: {integrity: sha512-p02Fq5Mnc8T6nwRBN1Iaou8YXvN1sDS6hbmJaD5UaRbXjizbh+8rpFS/o7jqAHTwf3uHCDitP3pnODyHdc/CDQ==} engines: {node: '>=18'} @@ -181,6 +199,12 @@ packages: peerDependencies: zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/provider-utils@5.0.0-beta.30': + resolution: {integrity: sha512-X3AxTsFJZr9Mw32SncWJA4/ShU8NA/XjhoallCYdcdQZ2gZZ/cIDyJJ6pNh1aBhicRNHv2ndgI6w/H2NGNIjOA==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/provider@0.0.23': resolution: {integrity: sha512-oAc49O5+xypVrKM7EUU5P/Y4DUL4JZUWVxhejoAVOTOl3WZUEWsMbP3QZR+TrimQIsS0WR/n9UuF6U0jPdp0tQ==} engines: {node: '>=18'} @@ -217,6 +241,10 @@ packages: resolution: {integrity: sha512-oGMAgGoQdBXbZqNG0Ze56CHjDZ1IDYOwGYxYjO5KLSlz5HiNQ9udIXsPZ61VWaHGZ5XW/jyjmr6t2xz2jGVwbQ==} engines: {node: '>=18'} + '@ai-sdk/provider@4.0.0-beta.14': + resolution: {integrity: sha512-SMijtjVHs38n0dMkTcNuGrnStiF76OhAqS0R+ZX4iXUnuPPyTxQoVcF8Xuf2AoBB5rqndTId5FVT05bgqD5KsA==} + engines: {node: '>=18'} + '@ai-sdk/react@0.0.70': resolution: {integrity: sha512-GnwbtjW4/4z7MleLiW+TOZC2M29eCg1tOUpuEiYFMmFNZK8mkrqM0PFZMo6UsYeUYMWqEOOcPOU9OQVJMJh7IQ==} engines: {node: '>=18'} @@ -343,6 +371,10 @@ packages: resolution: {integrity: sha512-fnYhv671l+eTTp48gB4zEsTW/YtRgRPnkI2nT7x6qw5rkI1Lq2hTmQIpHPgyThI0znLK+vX2n9XxKdXZ7BUbbw==} engines: {node: '>= 20'} + '@vercel/oidc@3.2.0': + resolution: {integrity: sha512-UycprH3T6n3jH0k44NHMa7pnFHGu/N05MjojYr+Mc6I7obkoLIJujSWwin1pCvdy/eOxrI/l3uDLQsmcrOb4ug==} + engines: {node: '>= 20'} + '@vue/compiler-core@3.5.35': resolution: {integrity: sha512-BUmHaR1J+O+CKZ9uJucdVTEr1LHsdyvv7vG3eNRhK3CczEHeMd/LtsHAuD7PbrxvI2envCY2v7HI1vC1aBRzKw==} @@ -372,6 +404,9 @@ packages: '@vue/shared@3.5.35': resolution: {integrity: sha512-zSbjL7gRXwks2ZQLRGCajBtBXEOXW9Ddhn/HvSdrGkE2dqGnumzW8XtusRrxrE9LvqtiqDXQ+A60Hp6mvdYxfA==} + '@workflow/serde@4.1.0': + resolution: {integrity: sha512-pav4F2BoirECWR7Nf1TKt+2eETcBj7jj4cBefQ8VXQCA6NPkaKeLfj/zMgi+3zYV5ZIBT4GuUiphsj0/b9hPQQ==} + acorn@8.16.0: resolution: {integrity: sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==} engines: {node: '>=0.4.0'} @@ -420,6 +455,12 @@ packages: peerDependencies: zod: ^3.25.76 || ^4.1.8 + ai@7.0.0-beta.116: + resolution: {integrity: sha512-xLVY+YU0sKmQ7zVU6y/6vCFn7o8HHNNgGTK789rqxxmcwSIau/RsmoCzXp/1c6sppA+PU6i4Uh5aCwFAQmjwEA==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + aria-query@5.3.1: resolution: {integrity: sha512-Z/ZeOgVl7bcSYZ/u/rh0fOpvEpq//LZmdbkXyc7syVzjPAhfOa9ebsdTSjEBDU4vs5nC98Kfduj1uFo0qyET3g==} engines: {node: '>= 0.4'} @@ -610,6 +651,13 @@ snapshots: '@vercel/oidc': 3.0.5 zod: 3.25.76 + '@ai-sdk/gateway@4.0.0-beta.67(zod@3.25.76)': + dependencies: + '@ai-sdk/provider': 4.0.0-beta.14 + '@ai-sdk/provider-utils': 5.0.0-beta.30(zod@3.25.76) + '@vercel/oidc': 3.2.0 + zod: 3.25.76 + '@ai-sdk/openai@0.0.62(zod@3.25.76)': dependencies: '@ai-sdk/provider': 0.0.23 @@ -634,6 +682,12 @@ snapshots: '@ai-sdk/provider-utils': 4.0.4(zod@3.25.76) zod: 3.25.76 + '@ai-sdk/openai@4.0.0-beta.44(zod@3.25.76)': + dependencies: + '@ai-sdk/provider': 4.0.0-beta.14 + '@ai-sdk/provider-utils': 5.0.0-beta.30(zod@3.25.76) + zod: 3.25.76 + '@ai-sdk/provider-utils@1.0.19(zod@3.25.76)': dependencies: '@ai-sdk/provider': 0.0.23 @@ -708,6 +762,14 @@ snapshots: eventsource-parser: 3.0.8 zod: 3.25.76 + '@ai-sdk/provider-utils@5.0.0-beta.30(zod@3.25.76)': + dependencies: + '@ai-sdk/provider': 4.0.0-beta.14 + '@standard-schema/spec': 1.1.0 + '@workflow/serde': 4.1.0 + eventsource-parser: 3.0.8 + zod: 3.25.76 + '@ai-sdk/provider@0.0.23': dependencies: json-schema: 0.4.0 @@ -744,6 +806,10 @@ snapshots: dependencies: json-schema: 0.4.0 + '@ai-sdk/provider@4.0.0-beta.14': + dependencies: + json-schema: 0.4.0 + '@ai-sdk/react@0.0.70(react@19.2.6)(zod@3.25.76)': dependencies: '@ai-sdk/provider-utils': 1.0.22(zod@3.25.76) @@ -858,6 +924,8 @@ snapshots: '@vercel/oidc@3.0.5': {} + '@vercel/oidc@3.2.0': {} + '@vue/compiler-core@3.5.35': dependencies: '@babel/parser': 7.29.7 @@ -912,6 +980,8 @@ snapshots: '@vue/shared@3.5.35': {} + '@workflow/serde@4.1.0': {} + acorn@8.16.0: {} ai@3.4.33(react@19.2.6)(sswr@2.2.0(svelte@5.55.9))(svelte@5.55.9)(vue@3.5.35)(zod@3.25.76): @@ -966,6 +1036,13 @@ snapshots: '@opentelemetry/api': 1.9.0 zod: 3.25.76 + ai@7.0.0-beta.116(zod@3.25.76): + dependencies: + '@ai-sdk/gateway': 4.0.0-beta.67(zod@3.25.76) + '@ai-sdk/provider': 4.0.0-beta.14 + '@ai-sdk/provider-utils': 5.0.0-beta.30(zod@3.25.76) + zod: 3.25.76 + aria-query@5.3.1: {} axobject-query@4.1.0: {} diff --git a/e2e/scenarios/ai-sdk-instrumentation/scenario.ai-sdk-v7.mjs b/e2e/scenarios/ai-sdk-instrumentation/scenario.ai-sdk-v7.mjs new file mode 100644 index 000000000..8b228015f --- /dev/null +++ b/e2e/scenarios/ai-sdk-instrumentation/scenario.ai-sdk-v7.mjs @@ -0,0 +1,22 @@ +import { createOpenAI, openai } from "ai-sdk-openai-v7"; +import * as ai from "ai-sdk-v7"; +import { getInstalledPackageVersion } from "../../helpers/provider-runtime.mjs"; +import { runAutoAISDKInstrumentationOrExit } from "./scenario.impl.mjs"; + +runAutoAISDKInstrumentationOrExit({ + ai, + createOpenAI, + maxTokensKey: "maxOutputTokens", + openai, + sdkVersion: await getInstalledPackageVersion(import.meta.url, "ai-sdk-v7"), + supportsDenyOutputOverrideScenario: false, + supportsEmbedMany: true, + supportsGenerateObject: true, + supportsOpenAICacheScenario: false, + supportsOutputObjectScenario: true, + supportsProviderCacheAssertions: false, + supportsRerank: false, + supportsStreamObject: true, + supportsToolExecution: true, + toolSchemaKey: "inputSchema", +}); diff --git a/e2e/scenarios/ai-sdk-instrumentation/scenario.ai-sdk-v7.ts b/e2e/scenarios/ai-sdk-instrumentation/scenario.ai-sdk-v7.ts new file mode 100644 index 000000000..b36b7b2be --- /dev/null +++ b/e2e/scenarios/ai-sdk-instrumentation/scenario.ai-sdk-v7.ts @@ -0,0 +1,30 @@ +import { createOpenAI, openai } from "ai-sdk-openai-v7"; +import * as ai from "ai-sdk-v7"; +import { braintrustAISDKTelemetry } from "braintrust"; +import { + getInstalledPackageVersion, + runMain, +} from "../../helpers/scenario-runtime"; +import { runAutoAISDKInstrumentation } from "./scenario.impl.mjs"; + +ai.registerTelemetry(braintrustAISDKTelemetry()); + +runMain(async () => + runAutoAISDKInstrumentation({ + ai, + createOpenAI, + maxTokensKey: "maxOutputTokens", + openai, + sdkVersion: await getInstalledPackageVersion(import.meta.url, "ai-sdk-v7"), + supportsDenyOutputOverrideScenario: false, + supportsEmbedMany: true, + supportsGenerateObject: true, + supportsOpenAICacheScenario: false, + supportsOutputObjectScenario: true, + supportsProviderCacheAssertions: false, + supportsRerank: false, + supportsStreamObject: true, + supportsToolExecution: true, + toolSchemaKey: "inputSchema", + }), +); diff --git a/e2e/scenarios/ai-sdk-instrumentation/scenario.impl.mjs b/e2e/scenarios/ai-sdk-instrumentation/scenario.impl.mjs index 74976acb3..f84ef8c03 100644 --- a/e2e/scenarios/ai-sdk-instrumentation/scenario.impl.mjs +++ b/e2e/scenarios/ai-sdk-instrumentation/scenario.impl.mjs @@ -82,6 +82,27 @@ export const AI_SDK_SCENARIO_SPECS = [ toolSchemaKey: "inputSchema", wrapperEntry: "scenario.ts", }, + { + autoEntry: "scenario.ai-sdk-v7.mjs", + dependencyName: "ai-sdk-v7", + maxTokensKey: "maxOutputTokens", + openaiModuleName: "ai-sdk-openai-v7", + packageName: "ai-sdk-v7", + snapshotName: "ai-sdk-v7", + supportsDenyOutputOverrideScenario: false, + supportsEmbedMany: true, + supportsGenerateObject: true, + supportsOpenAICacheScenario: false, + supportsOutputObjectScenario: true, + supportsProviderCacheAssertions: false, + supportsRerank: false, + supportsStreamObject: true, + supportsToolExecution: true, + toolSchemaKey: "inputSchema", + wrapperEntry: "scenario.ai-sdk-v7.ts", + wrapperSnapshotSuffix: "explicit", + wrapperTestName: "explicit telemetry", + }, ]; function tokenLimit(key, value) { @@ -211,6 +232,12 @@ async function runAISDKInstrumentationScenario( : undefined; const sdkMajorVersion = parseMajorVersion(options.sdkVersion); const supportsRichInputScenarios = sdkMajorVersion >= 5; + const supportsDenyOutputOverrideScenario = + options.supportsDenyOutputOverrideScenario ?? supportsRichInputScenarios; + const supportsOpenAICacheScenario = + options.supportsOpenAICacheScenario ?? sdkMajorVersion >= 5; + const supportsOutputObjectScenario = + options.supportsOutputObjectScenario ?? true; const outputObject = createOutputObjectIfSupported(options.ai); await runTracedScenario({ @@ -224,7 +251,7 @@ async function runAISDKInstrumentationScenario( }); }); - if (outputObject) { + if (outputObject && supportsOutputObjectScenario) { if (sdkMajorVersion >= 5) { await runOperation( "ai-sdk-output-object-response-format-operation", @@ -331,7 +358,7 @@ async function runAISDKInstrumentationScenario( await instrumentedAI.generateText(toolRequest); }); - if (sdkMajorVersion >= 5) { + if (supportsOpenAICacheScenario) { const prompt = `${CACHE_PROMPT_PREFIX}\n\nReply with exactly CACHE_OK and nothing else.`; const openaiCacheRequest = { model: openaiModel, @@ -403,7 +430,7 @@ async function runAISDKInstrumentationScenario( ); } - if (supportsRichInputScenarios) { + if (supportsDenyOutputOverrideScenario) { await runOperation( "ai-sdk-deny-output-override-operation", "deny-output-override", diff --git a/e2e/scenarios/ai-sdk-instrumentation/scenario.test.ts b/e2e/scenarios/ai-sdk-instrumentation/scenario.test.ts index 150d66501..ceb03ac14 100644 --- a/e2e/scenarios/ai-sdk-instrumentation/scenario.test.ts +++ b/e2e/scenarios/ai-sdk-instrumentation/scenario.test.ts @@ -33,12 +33,18 @@ describe.concurrent("variants", () => { for (const scenario of aiSDKScenarios) { const sdkMajorVersion = parseMajorVersion(scenario.version); const supportsRichInputScenarios = sdkMajorVersion >= 5; - const supportsOutputObjectScenario = supportsRichInputScenarios; + const supportsDenyOutputOverrideScenario = + scenario.supportsDenyOutputOverrideScenario ?? supportsRichInputScenarios; + const supportsOpenAICacheAssertions = + (scenario.supportsOpenAICacheScenario ?? supportsRichInputScenarios) && + sdkMajorVersion >= 5; + const supportsOutputObjectScenario = + scenario.supportsOutputObjectScenario ?? supportsRichInputScenarios; describe.sequential(`ai sdk ${scenario.version}`, () => { defineAISDKInstrumentationAssertions({ agentSpanName: scenario.agentSpanName, - name: "wrapped instrumentation", + name: scenario.wrapperTestName ?? "wrapped instrumentation", runScenario: async ({ runScenarioDir }) => { await runScenarioDir({ entry: scenario.wrapperEntry, @@ -50,10 +56,11 @@ describe.concurrent("variants", () => { timeoutMs: AI_SDK_SCENARIO_TIMEOUT_MS, }); }, - snapshotName: `${scenario.snapshotName}-wrapped`, + snapshotName: `${scenario.snapshotName}-${scenario.wrapperSnapshotSuffix ?? "wrapped"}`, + supportsOpenAICacheAssertions, supportsProviderCacheAssertions: scenario.supportsProviderCacheAssertions, - supportsDenyOutputOverrideScenario: supportsRichInputScenarios, + supportsDenyOutputOverrideScenario, supportsEmbedMany: scenario.supportsEmbedMany !== false, supportsGenerateObject: scenario.supportsGenerateObject, supportsOutputObjectScenario, @@ -81,9 +88,10 @@ describe.concurrent("variants", () => { }); }, snapshotName: `${scenario.snapshotName}-auto-hook`, + supportsOpenAICacheAssertions, supportsProviderCacheAssertions: scenario.supportsProviderCacheAssertions, - supportsDenyOutputOverrideScenario: supportsRichInputScenarios, + supportsDenyOutputOverrideScenario, supportsEmbedMany: scenario.supportsEmbedMany !== false, supportsGenerateObject: scenario.supportsGenerateObject, supportsOutputObjectScenario, diff --git a/js/src/auto-instrumentations/bundler/plugin.ts b/js/src/auto-instrumentations/bundler/plugin.ts index a5294e050..3cb72fbc6 100644 --- a/js/src/auto-instrumentations/bundler/plugin.ts +++ b/js/src/auto-instrumentations/bundler/plugin.ts @@ -124,6 +124,7 @@ export const unplugin = createUnplugin( const moduleName = moduleDetails.name; // Normalize the module path for Windows compatibility (WASM transformer expects forward slashes) const normalizedModulePath = moduleDetails.path.replace(/\\/g, "/"); + const moduleVersion = getModuleVersion(moduleDetails.basedir); // Per-package source patches (see loader/special-case-patches.ts). // Same anti-pattern fallback the runtime loader uses — mirrored here @@ -142,8 +143,6 @@ export const unplugin = createUnplugin( } } - const moduleVersion = getModuleVersion(moduleDetails.basedir); - // If no version found if (!moduleVersion) { console.warn( diff --git a/js/src/auto-instrumentations/configs/ai-sdk.ts b/js/src/auto-instrumentations/configs/ai-sdk.ts index a440391ad..4db293fed 100644 --- a/js/src/auto-instrumentations/configs/ai-sdk.ts +++ b/js/src/auto-instrumentations/configs/ai-sdk.ts @@ -18,7 +18,7 @@ export const aiSDKConfigs: InstrumentationConfig[] = [ channelName: aiSDKChannels.generateText.channelName, module: { name: "ai", - versionRange: ">=3.0.0", + versionRange: ">=3.0.0 <7.0.0", filePath: "dist/index.mjs", }, functionQuery: { @@ -30,7 +30,7 @@ export const aiSDKConfigs: InstrumentationConfig[] = [ channelName: aiSDKChannels.generateText.channelName, module: { name: "ai", - versionRange: ">=3.0.0", + versionRange: ">=3.0.0 <7.0.0", filePath: "dist/index.js", }, functionQuery: { @@ -58,7 +58,7 @@ export const aiSDKConfigs: InstrumentationConfig[] = [ channelName: aiSDKChannels.streamTextSync.channelName, module: { name: "ai", - versionRange: ">=4.0.0", + versionRange: ">=4.0.0 <7.0.0", filePath: "dist/index.mjs", }, functionQuery: { @@ -82,7 +82,7 @@ export const aiSDKConfigs: InstrumentationConfig[] = [ channelName: aiSDKChannels.streamTextSync.channelName, module: { name: "ai", - versionRange: ">=4.0.0", + versionRange: ">=4.0.0 <7.0.0", filePath: "dist/index.js", }, functionQuery: { @@ -96,7 +96,7 @@ export const aiSDKConfigs: InstrumentationConfig[] = [ channelName: aiSDKChannels.generateObject.channelName, module: { name: "ai", - versionRange: ">=3.0.0", + versionRange: ">=3.0.0 <7.0.0", filePath: "dist/index.mjs", }, functionQuery: { @@ -108,7 +108,7 @@ export const aiSDKConfigs: InstrumentationConfig[] = [ channelName: aiSDKChannels.generateObject.channelName, module: { name: "ai", - versionRange: ">=3.0.0", + versionRange: ">=3.0.0 <7.0.0", filePath: "dist/index.js", }, functionQuery: { @@ -122,7 +122,7 @@ export const aiSDKConfigs: InstrumentationConfig[] = [ channelName: aiSDKChannels.embed.channelName, module: { name: "ai", - versionRange: ">=3.0.0", + versionRange: ">=3.0.0 <7.0.0", filePath: "dist/index.mjs", }, functionQuery: { @@ -134,7 +134,7 @@ export const aiSDKConfigs: InstrumentationConfig[] = [ channelName: aiSDKChannels.embed.channelName, module: { name: "ai", - versionRange: ">=3.0.0", + versionRange: ">=3.0.0 <7.0.0", filePath: "dist/index.js", }, functionQuery: { @@ -148,7 +148,7 @@ export const aiSDKConfigs: InstrumentationConfig[] = [ channelName: aiSDKChannels.embedMany.channelName, module: { name: "ai", - versionRange: ">=3.0.0", + versionRange: ">=3.0.0 <7.0.0", filePath: "dist/index.mjs", }, functionQuery: { @@ -160,7 +160,7 @@ export const aiSDKConfigs: InstrumentationConfig[] = [ channelName: aiSDKChannels.embedMany.channelName, module: { name: "ai", - versionRange: ">=3.0.0", + versionRange: ">=3.0.0 <7.0.0", filePath: "dist/index.js", }, functionQuery: { @@ -174,7 +174,7 @@ export const aiSDKConfigs: InstrumentationConfig[] = [ channelName: aiSDKChannels.rerank.channelName, module: { name: "ai", - versionRange: ">=5.0.0", + versionRange: ">=5.0.0 <7.0.0", filePath: "dist/index.mjs", }, functionQuery: { @@ -186,7 +186,7 @@ export const aiSDKConfigs: InstrumentationConfig[] = [ channelName: aiSDKChannels.rerank.channelName, module: { name: "ai", - versionRange: ">=5.0.0", + versionRange: ">=5.0.0 <7.0.0", filePath: "dist/index.js", }, functionQuery: { @@ -195,6 +195,22 @@ export const aiSDKConfigs: InstrumentationConfig[] = [ }, }, + // AI SDK v7 exposes its telemetry lifecycle through a dispatcher created for + // each operation. We patch that dispatcher in the plugin instead of rewriting + // the module to call registerTelemetry(). + { + channelName: aiSDKChannels.v7CreateTelemetryDispatcher.channelName, + module: { + name: "ai", + versionRange: ">=7.0.0-0 <8.0.0", + filePath: "dist/index.js", + }, + functionQuery: { + functionName: "createTelemetryDispatcher", + kind: "Sync", + }, + }, + // streamObject - async function (v3 only, before the sync refactor in v4) { channelName: aiSDKChannels.streamObject.channelName, @@ -214,7 +230,7 @@ export const aiSDKConfigs: InstrumentationConfig[] = [ channelName: aiSDKChannels.streamObjectSync.channelName, module: { name: "ai", - versionRange: ">=4.0.0", + versionRange: ">=4.0.0 <7.0.0", filePath: "dist/index.mjs", }, functionQuery: { @@ -238,7 +254,7 @@ export const aiSDKConfigs: InstrumentationConfig[] = [ channelName: aiSDKChannels.streamObjectSync.channelName, module: { name: "ai", - versionRange: ">=4.0.0", + versionRange: ">=4.0.0 <7.0.0", filePath: "dist/index.js", }, functionQuery: { diff --git a/js/src/auto-instrumentations/loader/cjs-patch.ts b/js/src/auto-instrumentations/loader/cjs-patch.ts index 8f3217cd1..c882a03d4 100644 --- a/js/src/auto-instrumentations/loader/cjs-patch.ts +++ b/js/src/auto-instrumentations/loader/cjs-patch.ts @@ -49,6 +49,7 @@ export class ModulePatch { const packageName = getPackageName(resolvedModule.basedir) ?? resolvedModule.name; const normalizedModulePath = resolvedModule.path.replace(/\\/g, "/"); + const version = getPackageVersion(resolvedModule.basedir); // Per-package source patches (see loader/special-case-patches.ts). // Anti-pattern intentionally isolated in its own module — do not @@ -68,9 +69,6 @@ export class ModulePatch { if (!self.packages.has(packageName)) { return self.originalCompile.apply(this, args); } - - const version = getPackageVersion(resolvedModule.basedir); - const transformer = self.instrumentator.getTransformer( packageName, version, diff --git a/js/src/auto-instrumentations/loader/esm-hook.mts b/js/src/auto-instrumentations/loader/esm-hook.mts index 2adf3b9bc..a8f199add 100644 --- a/js/src/auto-instrumentations/loader/esm-hook.mts +++ b/js/src/auto-instrumentations/loader/esm-hook.mts @@ -79,6 +79,7 @@ export async function resolve( const packageName = getPackageName(resolvedModule.basedir) ?? resolvedModule.name; const normalizedModulePath = resolvedModule.path.replace(/\\/g, "/"); + const version = getPackageVersion(resolvedModule.basedir); // Track files that need per-package source patches (see // loader/special-case-patches.ts). Anti-pattern fallback for SDKs we @@ -95,8 +96,6 @@ export async function resolve( return url; } - const version = getPackageVersion(resolvedModule.basedir); - const transformer = instrumentator.getTransformer( packageName, version, diff --git a/js/src/exports.ts b/js/src/exports.ts index ee9f7a205..5df452790 100644 --- a/js/src/exports.ts +++ b/js/src/exports.ts @@ -169,6 +169,7 @@ export { } from "./wrappers/oai"; export { + braintrustAISDKTelemetry, wrapAISDK, wrapAgentClass, BraintrustMiddleware, diff --git a/js/src/instrumentation/plugins/ai-sdk-channels.ts b/js/src/instrumentation/plugins/ai-sdk-channels.ts index 957f0c301..316a83734 100644 --- a/js/src/instrumentation/plugins/ai-sdk-channels.ts +++ b/js/src/instrumentation/plugins/ai-sdk-channels.ts @@ -9,6 +9,10 @@ import type { AISDKRerankResult, AISDKResult, } from "../../vendor-sdk-types/ai-sdk"; +import type { + AISDKV7CreateTelemetryDispatcherArgs, + AISDKV7TelemetryDispatcher, +} from "../../vendor-sdk-types/ai-sdk-v7-telemetry"; type AISDKStreamResult = AISDKResult | AsyncIterable; type AISDKChannelContext = { @@ -136,4 +140,11 @@ export const aiSDKChannels = defineChannels("ai", { channelName: "ToolLoopAgent.stream", kind: "async", }), + v7CreateTelemetryDispatcher: channel< + [AISDKV7CreateTelemetryDispatcherArgs], + AISDKV7TelemetryDispatcher + >({ + channelName: "createTelemetryDispatcher", + kind: "sync-stream", + }), }); diff --git a/js/src/instrumentation/plugins/ai-sdk-plugin.test.ts b/js/src/instrumentation/plugins/ai-sdk-plugin.test.ts index 49211eced..39312c2fd 100644 --- a/js/src/instrumentation/plugins/ai-sdk-plugin.test.ts +++ b/js/src/instrumentation/plugins/ai-sdk-plugin.test.ts @@ -1,5 +1,13 @@ import { describe, it, expect, vi, beforeEach, afterEach } from "vitest"; +const telemetryMocks = vi.hoisted(() => ({ + braintrustAISDKTelemetry: vi.fn(), + telemetry: {} as { + executeTool?: ReturnType; + onStart?: ReturnType; + }, +})); + // Mock iso's newTracingChannel - must be before any imports that use it vi.mock("../../isomorph", () => ({ default: { @@ -7,12 +15,23 @@ vi.mock("../../isomorph", () => ({ }, })); +vi.mock("../../wrappers/ai-sdk/telemetry", () => ({ + braintrustAISDKTelemetry: telemetryMocks.braintrustAISDKTelemetry, +})); + import { AISDKPlugin } from "./ai-sdk-plugin"; import { Attachment } from "../../logger"; import iso from "../../isomorph"; import { serializeAISDKToolsForLogging } from "../../wrappers/ai-sdk/tool-serialization"; const mockNewTracingChannel = iso.newTracingChannel as ReturnType; +type MockTracingChannel = { + handlers: any[]; + hasSubscribers: boolean; + subscribe: ReturnType; + unsubscribe: ReturnType; +}; +const mockChannels = new Map(); // Import private functions by re-exporting them in the test // Since these are private, we'll test them through the public API @@ -22,13 +41,33 @@ describe("AISDKPlugin", () => { let plugin: AISDKPlugin; beforeEach(() => { - // Setup mock channel - const mockChannel = { - subscribe: vi.fn(), - unsubscribe: vi.fn(), - hasSubscribers: false, + mockChannels.clear(); + telemetryMocks.telemetry = { + executeTool: vi.fn(({ execute }) => execute()), + onStart: vi.fn(), }; - mockNewTracingChannel.mockReturnValue(mockChannel); + telemetryMocks.braintrustAISDKTelemetry.mockReturnValue( + telemetryMocks.telemetry, + ); + mockNewTracingChannel.mockImplementation((name: string) => { + const channel: MockTracingChannel = { + handlers: [], + hasSubscribers: false, + subscribe: vi.fn((handlers: any) => { + channel.handlers.push(handlers); + channel.hasSubscribers = true; + }), + unsubscribe: vi.fn((handlers: any) => { + channel.handlers = channel.handlers.filter( + (candidate) => candidate !== handlers, + ); + channel.hasSubscribers = channel.handlers.length > 0; + return true; + }), + }; + mockChannels.set(name, channel); + return channel; + }); plugin = new AISDKPlugin(); }); @@ -82,6 +121,81 @@ describe("AISDKPlugin", () => { expect(true).toBe(true); }); }); + + describe("AI SDK v7 telemetry dispatcher", () => { + it("patches dispatcher callbacks through the standard channel", async () => { + const existingOnStart = vi.fn(); + const originalExecute = vi.fn(async () => "done"); + const existingExecuteTool = vi.fn(({ execute }) => execute()); + const dispatcher = { + executeTool: existingExecuteTool, + onStart: existingOnStart, + }; + + plugin.enable(); + + const channel = mockChannels.get( + "orchestrion:ai:createTelemetryDispatcher", + ); + expect(channel?.subscribe).toHaveBeenCalledTimes(1); + + channel?.handlers[0]?.end({ + arguments: [{ telemetry: { recordInputs: true } }], + result: dispatcher, + }); + + await dispatcher.onStart({ + callId: "call-1", + operationId: "ai.generateText", + }); + expect(existingOnStart).toHaveBeenCalledTimes(1); + expect(telemetryMocks.telemetry.onStart).toHaveBeenCalledWith({ + callId: "call-1", + operationId: "ai.generateText", + }); + + await expect( + dispatcher.executeTool({ + callId: "call-1", + execute: originalExecute, + toolCallId: "tool-1", + }), + ).resolves.toBe("done"); + expect(telemetryMocks.telemetry.executeTool).toHaveBeenCalledTimes(1); + expect(existingExecuteTool).toHaveBeenCalledTimes(1); + expect(originalExecute).toHaveBeenCalledTimes(1); + }); + + it("patches each dispatcher once and respects telemetry opt-out", () => { + const dispatcher = { + onStart: vi.fn(), + }; + + plugin.enable(); + + const channel = mockChannels.get( + "orchestrion:ai:createTelemetryDispatcher", + ); + channel?.handlers[0]?.end({ + arguments: [{ telemetry: {} }], + result: dispatcher, + }); + const patchedOnStart = dispatcher.onStart; + + channel?.handlers[0]?.end({ + arguments: [{ telemetry: {} }], + result: dispatcher, + }); + expect(dispatcher.onStart).toBe(patchedOnStart); + + const optedOutDispatcher = {}; + channel?.handlers[0]?.end({ + arguments: [{ telemetry: { isEnabled: false } }], + result: optedOutDispatcher, + }); + expect(optedOutDispatcher).not.toHaveProperty("onStart"); + }); + }); }); describe("AI SDK utility functions", () => { diff --git a/js/src/instrumentation/plugins/ai-sdk-plugin.ts b/js/src/instrumentation/plugins/ai-sdk-plugin.ts index 63f2fc0d6..cbadfff64 100644 --- a/js/src/instrumentation/plugins/ai-sdk-plugin.ts +++ b/js/src/instrumentation/plugins/ai-sdk-plugin.ts @@ -5,8 +5,14 @@ import { traceSyncStreamChannel, unsubscribeAll, } from "../core/channel-tracing"; +import type { ChannelMessage } from "../core/channel-definitions"; import { isAsyncIterable } from "../core/stream-patcher"; -import { SpanTypeAttribute, isPromiseLike } from "../../../util/index"; +import type { IsoChannelHandlers } from "../../isomorph"; +import { + SpanTypeAttribute, + isObject, + isPromiseLike, +} from "../../../util/index"; import { getCurrentUnixTimestamp } from "../../util"; import { Attachment, type Span, withCurrent } from "../../logger"; import { @@ -15,6 +21,7 @@ import { } from "../../wrappers/attachment-utils"; import { normalizeAISDKLoggedOutput } from "../../wrappers/ai-sdk/normalize-logged-output"; import { serializeAISDKToolsForLogging } from "../../wrappers/ai-sdk/tool-serialization"; +import { braintrustAISDKTelemetry } from "../../wrappers/ai-sdk/telemetry"; import { zodToJsonSchema } from "../../zod/utils"; import { aiSDKChannels } from "./ai-sdk-channels"; import type { @@ -34,6 +41,7 @@ import type { AISDKTools, AISDKUsage, } from "../../vendor-sdk-types/ai-sdk"; +import type { AISDKV7Telemetry } from "../../vendor-sdk-types/ai-sdk-v7-telemetry"; export interface AISDKPluginConfig { /** @@ -47,7 +55,7 @@ export interface AISDKPluginConfig { * Default paths to omit from AI SDK output logging. * These contain redundant or verbose data that's not useful for tracing. */ -const DEFAULT_DENY_OUTPUT_PATHS: string[] = [ +export const DEFAULT_DENY_OUTPUT_PATHS: string[] = [ // v3 "roundtrips[].request.body", "roundtrips[].response.headers", @@ -64,10 +72,32 @@ const DEFAULT_DENY_OUTPUT_PATHS: string[] = [ const AUTO_PATCHED_MODEL = Symbol.for("braintrust.ai-sdk.auto-patched-model"); const AUTO_PATCHED_TOOL = Symbol.for("braintrust.ai-sdk.auto-patched-tool"); +const AUTO_PATCHED_V7_TELEMETRY_DISPATCHER = Symbol.for( + "braintrust.ai-sdk.v7.auto-patched-telemetry-dispatcher", +); const RUNTIME_DENY_OUTPUT_PATHS = Symbol.for( "braintrust.ai-sdk.deny-output-paths", ); +const AI_SDK_V7_TELEMETRY_CALLBACKS = [ + "onStart", + "onStepStart", + "onLanguageModelCallStart", + "onLanguageModelCallEnd", + "onToolExecutionStart", + "onToolExecutionEnd", + "onChunk", + "onStepFinish", + "onObjectStepStart", + "onObjectStepFinish", + "onEmbedStart", + "onEmbedFinish", + "onRerankStart", + "onRerankFinish", + "onFinish", + "onError", +] as const; + /** * AI SDK plugin that subscribes to instrumentation channels * and creates Braintrust spans. @@ -111,6 +141,8 @@ export class AISDKPlugin extends BasePlugin { const denyOutputPaths = this.config.denyOutputPaths || DEFAULT_DENY_OUTPUT_PATHS; + this.unsubscribers.push(subscribeToAISDKV7TelemetryDispatcher()); + // generateText - async function that may return streams this.unsubscribers.push( traceStreamingChannel(aiSDKChannels.generateText, { @@ -402,6 +434,84 @@ export class AISDKPlugin extends BasePlugin { } } +function subscribeToAISDKV7TelemetryDispatcher(): () => void { + const channel = aiSDKChannels.v7CreateTelemetryDispatcher.tracingChannel(); + const telemetry = braintrustAISDKTelemetry(); + const handlers: IsoChannelHandlers< + ChannelMessage + > = { + end: (event) => { + const telemetryOptions = event.arguments?.[0]?.telemetry; + if (telemetryOptions?.isEnabled === false) { + return; + } + + patchAISDKV7TelemetryDispatcher(event.result, telemetry); + }, + }; + + channel.subscribe(handlers); + + return () => { + channel.unsubscribe(handlers); + }; +} + +function patchAISDKV7TelemetryDispatcher( + dispatcher: unknown, + telemetry: AISDKV7Telemetry, +): void { + if (!isObject(dispatcher)) { + return; + } + + const dispatcherRecord = dispatcher as Record; + if (dispatcherRecord[AUTO_PATCHED_V7_TELEMETRY_DISPATCHER]) { + return; + } + dispatcherRecord[AUTO_PATCHED_V7_TELEMETRY_DISPATCHER] = true; + + for (const key of AI_SDK_V7_TELEMETRY_CALLBACKS) { + const braintrustCallback = telemetry[key]; + if (typeof braintrustCallback !== "function") { + continue; + } + + const existingCallback = dispatcherRecord[key]; + dispatcherRecord[key] = (event: unknown) => { + const existingResult = + typeof existingCallback === "function" + ? existingCallback.call(dispatcher, event) + : undefined; + const braintrustResult = braintrustCallback.call(telemetry, event as any); + const pending = [existingResult, braintrustResult].filter(isPromiseLike); + + if (pending.length > 0) { + return Promise.allSettled(pending).then(() => undefined); + } + }; + } + + const braintrustExecuteTool = telemetry.executeTool; + if (typeof braintrustExecuteTool !== "function") { + return; + } + + const existingExecuteTool = dispatcherRecord.executeTool; + dispatcherRecord.executeTool = (args: { + callId: string; + toolCallId: string; + execute: () => PromiseLike; + }) => + braintrustExecuteTool.call(telemetry, { + ...args, + execute: () => + typeof existingExecuteTool === "function" + ? existingExecuteTool.call(dispatcher, args) + : args.execute(), + }); +} + function resolveDenyOutputPaths( event: | { @@ -834,7 +944,7 @@ const convertDataToAttachment = ( /** * Process AI SDK input parameters, converting attachments as needed. */ -function processAISDKCallInput( +export function processAISDKCallInput( params: AISDKCallParams, ): ProcessCallInputSyncResult { return processInputAttachmentsSync(params); @@ -943,7 +1053,7 @@ function hasModelChildTracing(event?: { [key: string]: unknown }): boolean { ); } -function createAISDKIntegrationMetadata(): Record { +export function createAISDKIntegrationMetadata(): Record { return { braintrust: { integration_name: "ai-sdk", @@ -1721,7 +1831,7 @@ function isAsyncGenerator(value: unknown): value is AsyncGenerator { /** * Process AI SDK output, omitting specified paths. */ -function processAISDKOutput( +export function processAISDKOutput( output: AISDKResult, denyOutputPaths: string[], ): Record | AISDKResult { @@ -1733,7 +1843,7 @@ function processAISDKOutput( return normalizeAISDKLoggedOutput(omit(merged, denyOutputPaths)); } -function processAISDKEmbeddingOutput( +export function processAISDKEmbeddingOutput( output: AISDKEmbeddingResult, denyOutputPaths: string[], ): Record | AISDKEmbeddingResult { @@ -1775,7 +1885,7 @@ function processAISDKEmbeddingOutput( return normalizeAISDKLoggedOutput(omit(summarized, denyOutputPaths)); } -function processAISDKRerankOutput( +export function processAISDKRerankOutput( output: AISDKRerankResult, _denyOutputPaths: string[], ): unknown { @@ -1807,7 +1917,9 @@ function processAISDKRerankOutput( /** * Extract token metrics from AI SDK result. */ -function extractTokenMetrics(result: AISDKResult): Record { +export function extractTokenMetrics( + result: AISDKResult, +): Record { const metrics: Record = {}; let usage: AISDKUsage | undefined; @@ -2144,7 +2256,7 @@ function isSerializableOutputValue(value: unknown): boolean { /** * Extracts model ID and provider from a model object or string. */ -function serializeModelWithProvider(model: AISDKModel | undefined): { +export function serializeModelWithProvider(model: AISDKModel | undefined): { model: string | undefined; provider?: string; } { diff --git a/js/src/instrumentation/plugins/ai-sdk-v7-telemetry.test.ts b/js/src/instrumentation/plugins/ai-sdk-v7-telemetry.test.ts new file mode 100644 index 000000000..aec334065 --- /dev/null +++ b/js/src/instrumentation/plugins/ai-sdk-v7-telemetry.test.ts @@ -0,0 +1,425 @@ +import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; +import { _exportsForTestingOnly, currentSpan, initLogger } from "../../logger"; +import { configureNode } from "../../node/config"; +import { braintrustAISDKTelemetry } from "../../wrappers/ai-sdk/telemetry"; + +try { + configureNode(); +} catch { + // Best-effort initialization for test environments. +} + +describe("braintrustAISDKTelemetry", () => { + let backgroundLogger: ReturnType< + typeof _exportsForTestingOnly.useTestBackgroundLogger + >; + + beforeAll(async () => { + await _exportsForTestingOnly.simulateLoginForTests(); + }); + + beforeEach(() => { + backgroundLogger = _exportsForTestingOnly.useTestBackgroundLogger(); + initLogger({ + projectName: "ai-sdk-v7-telemetry.test.ts", + projectId: "test-project-id", + }); + }); + + afterEach(() => { + _exportsForTestingOnly.clearTestBackgroundLogger(); + }); + + it("logs a generateText operation and model call", async () => { + const telemetry = braintrustAISDKTelemetry(); + + telemetry.onStart?.({ + callId: "call-1", + operationId: "ai.generateText", + provider: "openai", + modelId: "gpt-4.1-mini", + messages: [{ role: "user", content: "Reply with OK." }], + temperature: 0, + }); + telemetry.onLanguageModelCallStart?.({ + callId: "call-1", + provider: "openai", + modelId: "gpt-4.1-mini", + prompt: [{ role: "user", content: "Reply with OK." }], + }); + telemetry.onLanguageModelCallEnd?.({ + callId: "call-1", + provider: "openai", + modelId: "gpt-4.1-mini", + text: "OK", + usage: { + inputTokens: 6, + outputTokens: 1, + totalTokens: 7, + }, + }); + telemetry.onFinish?.({ + callId: "call-1", + operationId: "ai.generateText", + text: "OK", + usage: { + inputTokens: 6, + outputTokens: 1, + totalTokens: 7, + }, + }); + + const spans = (await backgroundLogger.drain()) as Array< + Record + >; + const operation = spans.find( + (span) => span.span_attributes?.name === "generateText", + ); + const modelCall = spans.find( + (span) => span.span_attributes?.name === "doGenerate", + ); + + expect(operation).toMatchObject({ + span_attributes: { + type: "function", + name: "generateText", + }, + input: { + messages: [{ role: "user", content: "Reply with OK." }], + }, + metadata: { + provider: "openai", + model: "gpt-4.1-mini", + }, + }); + expect(operation?.output).toMatchObject({ text: "OK" }); + + expect(modelCall).toMatchObject({ + span_attributes: { + type: "llm", + name: "doGenerate", + }, + metrics: { + prompt_tokens: 6, + completion_tokens: 1, + tokens: 7, + }, + metadata: { + provider: "openai", + model: "gpt-4.1-mini", + }, + }); + expect(modelCall?.output).toMatchObject({ text: "OK" }); + }); + + it("honors recordInputs and recordOutputs", async () => { + const telemetry = braintrustAISDKTelemetry(); + + telemetry.onStart?.({ + callId: "call-2", + operationId: "ai.generateText", + recordInputs: false, + messages: [{ role: "user", content: "hidden" }], + }); + telemetry.onFinish?.({ + callId: "call-2", + operationId: "ai.generateText", + recordOutputs: false, + text: "hidden", + }); + + const spans = (await backgroundLogger.drain()) as Array< + Record + >; + const operation = spans.find( + (span) => span.span_attributes?.name === "generateText", + ); + + expect(operation).toBeDefined(); + expect(operation).not.toHaveProperty("input"); + expect(operation).not.toHaveProperty("output"); + }); + + it("ends open child spans when an operation errors", async () => { + const telemetry = braintrustAISDKTelemetry(); + const callId = "call-error"; + const error = new Error("provider exploded"); + + telemetry.onStart?.({ + callId, + operationId: "ai.streamText", + }); + telemetry.onLanguageModelCallStart?.({ + callId, + provider: "openai", + modelId: "gpt-4.1-mini", + prompt: [{ role: "user", content: "Reply with OK." }], + }); + telemetry.onObjectStepStart?.({ + callId, + provider: "openai", + modelId: "gpt-4.1-mini", + promptMessages: [{ role: "user", content: "Return an object." }], + }); + telemetry.onEmbedStart?.({ + callId, + embedCallId: "embed-error", + operationId: "ai.embed", + provider: "openai", + modelId: "text-embedding-3-small", + values: ["hello"], + }); + telemetry.onRerankStart?.({ + callId, + provider: "cohere", + modelId: "rerank-v3.5", + documents: ["alpha", "beta"], + query: "alpha", + topN: 1, + }); + telemetry.onToolExecutionStart?.({ + callId, + toolCall: { + toolCallId: "tool-error", + toolName: "lookupWeather", + input: { city: "Vienna" }, + }, + }); + + telemetry.onError?.({ callId, error }); + + const spans = (await backgroundLogger.drain()) as Array< + Record + >; + const errorSpans = spans.filter((span) => + String(span.error).includes("provider exploded"), + ); + + expect(errorSpans).toHaveLength(6); + expect(errorSpans.map((span) => span.span_attributes?.name)).toEqual( + expect.arrayContaining([ + "streamText", + "doStream", + "doGenerate", + "doEmbed", + "doRerank", + "lookupWeather", + ]), + ); + + telemetry.onLanguageModelCallEnd?.({ callId, text: "late" }); + telemetry.onObjectStepFinish?.({ callId, objectText: "{}" }); + telemetry.onEmbedFinish?.({ + callId, + embedCallId: "embed-error", + operationId: "ai.embed", + embeddings: [[0.1]], + }); + telemetry.onRerankFinish?.({ + callId, + ranking: [{ index: 0, relevanceScore: 1 }], + }); + telemetry.onToolExecutionEnd?.({ + callId, + toolCall: { toolCallId: "tool-error", toolName: "lookupWeather" }, + toolOutput: { type: "tool-result", output: "late" }, + }); + telemetry.onFinish?.({ + callId, + operationId: "ai.streamText", + text: "late", + }); + + expect(await backgroundLogger.drain()).toHaveLength(0); + }); + + it("ends superseded retry child spans before successful finish", async () => { + const telemetry = braintrustAISDKTelemetry(); + + telemetry.onStart?.({ + callId: "stream-retry", + operationId: "ai.streamText", + }); + telemetry.onLanguageModelCallStart?.({ + callId: "stream-retry", + messages: [{ role: "user", content: "first stream attempt" }], + }); + telemetry.onLanguageModelCallStart?.({ + callId: "stream-retry", + messages: [{ role: "user", content: "retry stream attempt" }], + }); + telemetry.onLanguageModelCallEnd?.({ + callId: "stream-retry", + text: "OK", + }); + telemetry.onFinish?.({ + callId: "stream-retry", + operationId: "ai.streamText", + text: "OK", + }); + + telemetry.onStart?.({ + callId: "embed-retry", + operationId: "ai.embed", + }); + telemetry.onEmbedStart?.({ + callId: "embed-retry", + embedCallId: "embed-attempt-1", + operationId: "ai.embed.doEmbed", + values: ["first embed attempt"], + }); + telemetry.onEmbedStart?.({ + callId: "embed-retry", + embedCallId: "embed-attempt-2", + operationId: "ai.embed.doEmbed", + values: ["retry embed attempt"], + }); + telemetry.onEmbedFinish?.({ + callId: "embed-retry", + embedCallId: "embed-attempt-2", + operationId: "ai.embed.doEmbed", + embeddings: [[0.1]], + }); + telemetry.onFinish?.({ + callId: "embed-retry", + operationId: "ai.embed", + embedding: [0.1], + }); + + telemetry.onStart?.({ + callId: "rerank-retry", + operationId: "ai.rerank", + }); + telemetry.onRerankStart?.({ + callId: "rerank-retry", + documents: ["first rerank attempt"], + query: "first", + }); + telemetry.onRerankStart?.({ + callId: "rerank-retry", + documents: ["retry rerank attempt"], + query: "retry", + }); + telemetry.onRerankFinish?.({ + callId: "rerank-retry", + ranking: [{ index: 0, relevanceScore: 1 }], + }); + telemetry.onFinish?.({ + callId: "rerank-retry", + operationId: "ai.rerank", + ranking: [{ originalIndex: 0, score: 1 }], + }); + + const spans = (await backgroundLogger.drain()) as Array< + Record + >; + const streamSpans = spans.filter( + (span) => span.span_attributes?.name === "doStream", + ); + const embedSpans = spans.filter( + (span) => span.span_attributes?.name === "doEmbed", + ); + const rerankSpans = spans.filter( + (span) => span.span_attributes?.name === "doRerank", + ); + + expect(streamSpans).toHaveLength(2); + expect( + streamSpans.find((span) => + JSON.stringify(span.input).includes("first stream attempt"), + ), + ).not.toHaveProperty("output"); + expect( + streamSpans.find((span) => + JSON.stringify(span.input).includes("retry stream attempt"), + )?.output, + ).toMatchObject({ text: "OK" }); + + expect(embedSpans).toHaveLength(2); + expect( + embedSpans.find((span) => + JSON.stringify(span.input).includes("first embed attempt"), + ), + ).not.toHaveProperty("output"); + expect( + embedSpans.find((span) => + JSON.stringify(span.input).includes("retry embed attempt"), + ), + ).toHaveProperty("output"); + + expect(rerankSpans).toHaveLength(2); + expect( + rerankSpans.find((span) => + JSON.stringify(span.input).includes("first rerank attempt"), + ), + ).not.toHaveProperty("output"); + expect( + rerankSpans.find((span) => + JSON.stringify(span.input).includes("retry rerank attempt"), + ), + ).toHaveProperty("output"); + }); + + it("runs tool execution under the tool span", async () => { + const telemetry = braintrustAISDKTelemetry(); + + telemetry.onStart?.({ + callId: "call-3", + operationId: "ai.generateText", + }); + telemetry.onToolExecutionStart?.({ + callId: "call-3", + toolCall: { + toolCallId: "tool-1", + toolName: "lookupWeather", + input: { city: "Vienna" }, + }, + }); + + let activeToolSpanId: string | undefined; + await telemetry.executeTool?.({ + callId: "call-3", + toolCallId: "tool-1", + execute: async () => { + activeToolSpanId = currentSpan().spanId; + return { temperature: 21 }; + }, + }); + + telemetry.onToolExecutionEnd?.({ + callId: "call-3", + durationMs: 12, + toolCall: { + toolCallId: "tool-1", + toolName: "lookupWeather", + }, + toolOutput: { + type: "tool-result", + output: { temperature: 21 }, + }, + }); + telemetry.onFinish?.({ + callId: "call-3", + operationId: "ai.generateText", + text: "It is 21 C.", + }); + + const spans = (await backgroundLogger.drain()) as Array< + Record + >; + const toolSpan = spans.find( + (span) => span.span_attributes?.name === "lookupWeather", + ); + + expect(activeToolSpanId).toBe(toolSpan?.span_id); + expect(toolSpan).toMatchObject({ + span_attributes: { + type: "tool", + name: "lookupWeather", + }, + input: { city: "Vienna" }, + output: { temperature: 21 }, + metrics: { duration_ms: 12 }, + }); + }); +}); diff --git a/js/src/vendor-sdk-types/ai-sdk-v7-telemetry.ts b/js/src/vendor-sdk-types/ai-sdk-v7-telemetry.ts new file mode 100644 index 000000000..e5e9a972d --- /dev/null +++ b/js/src/vendor-sdk-types/ai-sdk-v7-telemetry.ts @@ -0,0 +1,181 @@ +/** + * Narrow AI SDK v7 telemetry types used by Braintrust. + * + * These mirror only the callback fields Braintrust reads. The public AI SDK + * `Telemetry` type is structural, so users do not need `ai` installed as a + * direct dependency for this package to type-check. + */ + +export interface AISDKV7TelemetryOptions { + recordInputs?: boolean; + recordOutputs?: boolean; + functionId?: string; +} + +export interface AISDKV7ModelInfo { + provider?: string; + modelId?: string; +} + +export interface AISDKV7OperationEvent + extends AISDKV7TelemetryOptions, AISDKV7ModelInfo { + callId: string; + operationId: string; + [key: string]: unknown; +} + +export interface AISDKV7LanguageModelCallStartEvent + extends AISDKV7TelemetryOptions, AISDKV7ModelInfo { + callId: string; + [key: string]: unknown; +} + +export interface AISDKV7LanguageModelCallEndEvent + extends AISDKV7TelemetryOptions, AISDKV7ModelInfo { + callId: string; + content?: unknown; + finishReason?: unknown; + responseId?: string; + usage?: unknown; + [key: string]: unknown; +} + +export interface AISDKV7ObjectStepStartEvent + extends AISDKV7TelemetryOptions, AISDKV7ModelInfo { + callId: string; + promptMessages?: unknown; + stepNumber?: number; + [key: string]: unknown; +} + +export interface AISDKV7ObjectStepEndEvent + extends AISDKV7TelemetryOptions, AISDKV7ModelInfo { + callId: string; + finishReason?: unknown; + objectText?: string; + providerMetadata?: unknown; + reasoning?: unknown; + request?: unknown; + response?: unknown; + usage?: unknown; + warnings?: unknown; + [key: string]: unknown; +} + +export interface AISDKV7EmbedStartEvent + extends AISDKV7TelemetryOptions, AISDKV7ModelInfo { + callId: string; + embedCallId: string; + operationId: string; + values: unknown[]; + [key: string]: unknown; +} + +export interface AISDKV7EmbedEndEvent + extends AISDKV7TelemetryOptions, AISDKV7ModelInfo { + callId: string; + embedCallId: string; + operationId: string; + embeddings?: unknown[]; + usage?: unknown; + values?: unknown[]; + [key: string]: unknown; +} + +export interface AISDKV7RerankStartEvent + extends AISDKV7TelemetryOptions, AISDKV7ModelInfo { + callId: string; + documents?: unknown[]; + query?: string; + topN?: number; + [key: string]: unknown; +} + +export interface AISDKV7RerankEndEvent + extends AISDKV7TelemetryOptions, AISDKV7ModelInfo { + callId: string; + ranking?: Array<{ index?: number; relevanceScore?: number }>; + [key: string]: unknown; +} + +export interface AISDKV7ToolCall { + toolCallId?: string; + toolName?: string; + input?: unknown; + [key: string]: unknown; +} + +export interface AISDKV7ToolExecutionStartEvent extends AISDKV7TelemetryOptions { + callId: string; + toolCall: AISDKV7ToolCall; + toolContext?: unknown; + [key: string]: unknown; +} + +export interface AISDKV7ToolOutput { + type?: "tool-result" | "tool-error" | string; + output?: unknown; + error?: unknown; + [key: string]: unknown; +} + +export interface AISDKV7ToolExecutionEndEvent extends AISDKV7TelemetryOptions { + callId: string; + durationMs?: number; + toolCall: AISDKV7ToolCall; + toolOutput?: AISDKV7ToolOutput; + [key: string]: unknown; +} + +export interface AISDKV7ChunkEvent { + chunk?: { + type?: string; + callId?: string; + [key: string]: unknown; + }; +} + +export interface AISDKV7Telemetry { + onStart?: (event: AISDKV7OperationEvent) => void | PromiseLike; + onStepStart?: (event: unknown) => void | PromiseLike; + onLanguageModelCallStart?: ( + event: AISDKV7LanguageModelCallStartEvent, + ) => void | PromiseLike; + onLanguageModelCallEnd?: ( + event: AISDKV7LanguageModelCallEndEvent, + ) => void | PromiseLike; + onObjectStepStart?: ( + event: AISDKV7ObjectStepStartEvent, + ) => void | PromiseLike; + onObjectStepFinish?: ( + event: AISDKV7ObjectStepEndEvent, + ) => void | PromiseLike; + onEmbedStart?: (event: AISDKV7EmbedStartEvent) => void | PromiseLike; + onEmbedFinish?: (event: AISDKV7EmbedEndEvent) => void | PromiseLike; + onRerankStart?: (event: AISDKV7RerankStartEvent) => void | PromiseLike; + onRerankFinish?: (event: AISDKV7RerankEndEvent) => void | PromiseLike; + onToolExecutionStart?: ( + event: AISDKV7ToolExecutionStartEvent, + ) => void | PromiseLike; + onToolExecutionEnd?: ( + event: AISDKV7ToolExecutionEndEvent, + ) => void | PromiseLike; + onChunk?: (event: AISDKV7ChunkEvent) => void | PromiseLike; + onStepFinish?: (event: unknown) => void | PromiseLike; + onFinish?: (event: AISDKV7OperationEvent) => void | PromiseLike; + onError?: (event: unknown) => void | PromiseLike; + executeTool?: (options: { + callId: string; + toolCallId: string; + execute: () => PromiseLike; + }) => PromiseLike; +} + +export type AISDKV7TelemetryDispatcher = AISDKV7Telemetry; + +export interface AISDKV7CreateTelemetryDispatcherArgs { + telemetry?: AISDKV7TelemetryOptions & { + isEnabled?: boolean; + integrations?: unknown; + }; +} diff --git a/js/src/wrappers/ai-sdk/index.ts b/js/src/wrappers/ai-sdk/index.ts index 00c42bfc3..b2058cd16 100644 --- a/js/src/wrappers/ai-sdk/index.ts +++ b/js/src/wrappers/ai-sdk/index.ts @@ -1,4 +1,5 @@ export { wrapAISDK, wrapAgentClass } from "./ai-sdk"; +export { braintrustAISDKTelemetry } from "./telemetry"; // TODO: remove in the next major release export { wrapAISDKModel } from "./deprecated/wrapAISDKModel"; diff --git a/js/src/wrappers/ai-sdk/telemetry.ts b/js/src/wrappers/ai-sdk/telemetry.ts new file mode 100644 index 000000000..8ba46a566 --- /dev/null +++ b/js/src/wrappers/ai-sdk/telemetry.ts @@ -0,0 +1,697 @@ +import { + SpanTypeAttribute, + getCurrentUnixTimestamp, + isObject, +} from "../../util"; +import { logError, startSpan, withCurrent, type Span } from "../../logger"; +import { + createAISDKIntegrationMetadata, + DEFAULT_DENY_OUTPUT_PATHS, + extractTokenMetrics, + processAISDKCallInput, + processAISDKEmbeddingOutput, + processAISDKOutput, + processAISDKRerankOutput, + serializeModelWithProvider, +} from "../../instrumentation/plugins/ai-sdk-plugin"; +import type { + AISDKCallParams, + AISDKEmbeddingResult, + AISDKModel, + AISDKResult, + AISDKRerankResult, +} from "../../vendor-sdk-types/ai-sdk"; +import type { + AISDKV7LanguageModelCallStartEvent, + AISDKV7OperationEvent, + AISDKV7Telemetry, + AISDKV7TelemetryOptions, +} from "../../vendor-sdk-types/ai-sdk-v7-telemetry"; + +type OperationState = { + firstChunkTime?: number; + hadModelChild: boolean; + operationName: string; + span: Span; + startTime: number; +}; + +type CallSpanState = { + callId: string; + span: Span; +}; + +type EmbedSpanState = CallSpanState & { + values: unknown[]; +}; + +/** + * Creates a Braintrust telemetry integration for AI SDK v7's + * `registerTelemetry()` API. + */ +export function braintrustAISDKTelemetry(): AISDKV7Telemetry { + const operations = new Map(); + const modelSpans = new Map(); + const objectSpans = new Map(); + const embedSpans = new Map(); + const rerankSpans = new Map(); + const toolSpans = new Map(); + + const runSafely = (name: string, callback: () => void) => { + try { + callback(); + } catch (error) { + // eslint-disable-next-line no-restricted-properties + console.error(`Error in Braintrust AI SDK telemetry ${name}:`, error); + } + }; + + const startChildSpan = ( + callId: string, + name: string, + type: SpanTypeAttribute, + event?: { input?: unknown; metadata?: Record }, + ) => { + const parent = operations.get(callId)?.span; + const spanArgs = { + name, + spanAttributes: { type }, + ...(event ? { event } : {}), + }; + const span = parent ? parent.startSpan(spanArgs) : startSpan(spanArgs); + const state = operations.get(callId); + if (state && type === SpanTypeAttribute.LLM) { + state.hadModelChild = true; + } + return span; + }; + + return { + onStart(event) { + runSafely("onStart", () => { + const operationName = operationNameFromId(event.operationId); + const span = startSpan({ + name: operationName, + spanAttributes: { type: SpanTypeAttribute.FUNCTION }, + }); + + operations.set(event.callId, { + hadModelChild: false, + operationName, + span, + startTime: getCurrentUnixTimestamp(), + }); + + const metadata = metadataFromEvent(event); + const logPayload: { + input?: unknown; + metadata: Record; + } = { metadata }; + + if (shouldRecordInputs(event)) { + const { input, outputPromise } = processAISDKCallInput( + operationInput(event, operationName), + ); + logPayload.input = input; + if (outputPromise && input && typeof input === "object") { + outputPromise + .then((resolvedData) => { + span.log({ + input: { + ...(input as Record), + ...resolvedData, + }, + }); + }) + .catch(() => { + // Keep the placeholder response_format if async resolution fails. + }); + } + } + + span.log(logPayload); + }); + }, + + onLanguageModelCallStart(event) { + runSafely("onLanguageModelCallStart", () => { + const state = operations.get(event.callId); + const openSpans = modelSpans.get(event.callId); + if (openSpans) { + for (const span of openSpans) { + span.end(); + } + modelSpans.delete(event.callId); + } + + const span = startChildSpan( + event.callId, + state?.operationName === "streamText" ? "doStream" : "doGenerate", + SpanTypeAttribute.LLM, + { + ...(shouldRecordInputs(event) + ? { + input: processAISDKCallInput( + operationInput( + event, + state?.operationName ?? "generateText", + ), + ).input, + } + : {}), + metadata: metadataFromEvent(event), + }, + ); + const spans = modelSpans.get(event.callId) ?? []; + spans.push(span); + modelSpans.set(event.callId, spans); + }); + }, + + onLanguageModelCallEnd(event) { + runSafely("onLanguageModelCallEnd", () => { + const span = shiftModelSpan(modelSpans, event.callId); + if (!span) { + return; + } + + const result = { + ...event, + response: event.responseId ? { id: event.responseId } : undefined, + } as AISDKResult; + span.log({ + ...(shouldRecordOutputs(event) + ? { + output: processAISDKOutput(result, DEFAULT_DENY_OUTPUT_PATHS), + } + : {}), + metrics: extractTokenMetrics(result), + }); + span.end(); + }); + }, + + onObjectStepStart(event) { + runSafely("onObjectStepStart", () => { + const state = operations.get(event.callId); + const openSpan = objectSpans.get(event.callId); + if (openSpan) { + openSpan.end(); + objectSpans.delete(event.callId); + } + + const span = startChildSpan( + event.callId, + state?.operationName === "streamObject" ? "doStream" : "doGenerate", + SpanTypeAttribute.LLM, + { + ...(shouldRecordInputs(event) + ? { + input: { + prompt: event.promptMessages, + }, + } + : {}), + metadata: metadataFromEvent(event), + }, + ); + objectSpans.set(event.callId, span); + }); + }, + + onObjectStepFinish(event) { + runSafely("onObjectStepFinish", () => { + const span = objectSpans.get(event.callId); + if (!span) { + return; + } + + const result = { + ...event, + text: event.objectText, + } as AISDKResult; + span.log({ + ...(shouldRecordOutputs(event) + ? { + output: processAISDKOutput(result, DEFAULT_DENY_OUTPUT_PATHS), + } + : {}), + metrics: extractTokenMetrics(result), + }); + span.end(); + objectSpans.delete(event.callId); + }); + }, + + onEmbedStart(event) { + runSafely("onEmbedStart", () => { + const state = operations.get(event.callId); + for (const [embedCallId, embedState] of embedSpans) { + if ( + embedState.callId === event.callId && + (state?.operationName === "embed" || + embedState.values === event.values) + ) { + embedState.span.end(); + embedSpans.delete(embedCallId); + } + } + + const span = startChildSpan( + event.callId, + "doEmbed", + SpanTypeAttribute.LLM, + { + ...(shouldRecordInputs(event) + ? { + input: { + values: event.values, + }, + } + : {}), + metadata: metadataFromEvent(event), + }, + ); + embedSpans.set(event.embedCallId, { + callId: event.callId, + span, + values: event.values, + }); + }); + }, + + onEmbedFinish(event) { + runSafely("onEmbedFinish", () => { + const state = embedSpans.get(event.embedCallId); + if (!state) { + return; + } + + const result = { + ...event, + embeddings: event.embeddings, + } as AISDKEmbeddingResult; + state.span.log({ + ...(shouldRecordOutputs(event) + ? { + output: processAISDKEmbeddingOutput( + result, + DEFAULT_DENY_OUTPUT_PATHS, + ), + } + : {}), + metrics: extractTokenMetrics(result), + }); + state.span.end(); + embedSpans.delete(event.embedCallId); + }); + }, + + onRerankStart(event) { + runSafely("onRerankStart", () => { + const openSpan = rerankSpans.get(event.callId); + if (openSpan) { + openSpan.end(); + rerankSpans.delete(event.callId); + } + + const span = startChildSpan( + event.callId, + "doRerank", + SpanTypeAttribute.LLM, + { + ...(shouldRecordInputs(event) + ? { + input: { + documents: event.documents, + query: event.query, + topN: event.topN, + }, + } + : {}), + metadata: metadataFromEvent(event), + }, + ); + rerankSpans.set(event.callId, span); + }); + }, + + onRerankFinish(event) { + runSafely("onRerankFinish", () => { + const span = rerankSpans.get(event.callId); + if (!span) { + return; + } + + const result = { + ranking: event.ranking?.map((entry) => ({ + originalIndex: entry.index, + score: entry.relevanceScore, + })), + } as AISDKRerankResult; + span.log({ + ...(shouldRecordOutputs(event) + ? { + output: processAISDKRerankOutput( + result, + DEFAULT_DENY_OUTPUT_PATHS, + ), + } + : {}), + }); + span.end(); + rerankSpans.delete(event.callId); + }); + }, + + onToolExecutionStart(event) { + runSafely("onToolExecutionStart", () => { + const toolCallId = event.toolCall.toolCallId; + if (!toolCallId) { + return; + } + + const span = startChildSpan( + event.callId, + event.toolCall.toolName || "tool", + SpanTypeAttribute.TOOL, + { + ...(shouldRecordInputs(event) + ? { + input: event.toolCall.input, + } + : {}), + metadata: { + ...createAISDKIntegrationMetadata(), + toolCallId, + ...(typeof event.toolCall.toolName === "string" + ? { toolName: event.toolCall.toolName } + : {}), + }, + }, + ); + toolSpans.set(toolCallId, { callId: event.callId, span }); + }); + }, + + onToolExecutionEnd(event) { + runSafely("onToolExecutionEnd", () => { + const toolCallId = event.toolCall.toolCallId; + const state = toolCallId ? toolSpans.get(toolCallId) : undefined; + if (!toolCallId || !state) { + return; + } + + const toolOutput = event.toolOutput; + if (toolOutput?.type === "tool-error") { + state.span.log({ + error: + toolOutput.error instanceof Error + ? toolOutput.error.message + : String(toolOutput?.error), + metrics: + typeof event.durationMs === "number" + ? { duration_ms: event.durationMs } + : {}, + }); + } else { + state.span.log({ + ...(shouldRecordOutputs(event) + ? { output: toolOutput?.output } + : {}), + metrics: + typeof event.durationMs === "number" + ? { duration_ms: event.durationMs } + : {}, + }); + } + state.span.end(); + toolSpans.delete(toolCallId); + }); + }, + + onChunk(event) { + runSafely("onChunk", () => { + const callId = event.chunk?.callId; + if (!callId) { + return; + } + const state = operations.get(callId); + if (!state || state.firstChunkTime !== undefined) { + return; + } + state.firstChunkTime = getCurrentUnixTimestamp(); + }); + }, + + onFinish(event) { + runSafely("onFinish", () => { + const state = operations.get(event.callId); + if (!state) { + return; + } + + const result = finishResult(event, state.operationName); + const metrics: Record = state.hadModelChild + ? {} + : extractTokenMetrics(result); + if (state.firstChunkTime !== undefined) { + metrics.time_to_first_token = state.firstChunkTime - state.startTime; + } + + state.span.log({ + ...(shouldRecordOutputs(event) + ? { + output: finishOutput(result, state.operationName), + } + : {}), + metrics, + }); + state.span.end(); + operations.delete(event.callId); + }); + }, + + onError(event) { + runSafely("onError", () => { + const errorEvent = isObject(event) + ? (event as { callId?: unknown; error?: unknown }) + : {}; + const callId = + typeof errorEvent.callId === "string" ? errorEvent.callId : undefined; + if (!callId) { + return; + } + + const state = operations.get(callId); + if (!state) { + return; + } + const error = errorEvent.error ?? event; + + const openModelSpans = modelSpans.get(callId); + if (openModelSpans) { + for (const span of openModelSpans) { + logError(span, error); + span.end(); + } + modelSpans.delete(callId); + } + + const openObjectSpan = objectSpans.get(callId); + if (openObjectSpan) { + logError(openObjectSpan, error); + openObjectSpan.end(); + objectSpans.delete(callId); + } + + for (const [embedCallId, embedState] of embedSpans) { + if (embedState.callId === callId) { + logError(embedState.span, error); + embedState.span.end(); + embedSpans.delete(embedCallId); + } + } + + const openRerankSpan = rerankSpans.get(callId); + if (openRerankSpan) { + logError(openRerankSpan, error); + openRerankSpan.end(); + rerankSpans.delete(callId); + } + + for (const [toolCallId, toolState] of toolSpans) { + if (toolState.callId === callId) { + logError(toolState.span, error); + toolState.span.end(); + toolSpans.delete(toolCallId); + } + } + + logError(state.span, error); + state.span.end(); + operations.delete(callId); + }); + }, + + executeTool({ toolCallId, execute }) { + const state = toolSpans.get(toolCallId); + return state ? withCurrent(state.span, () => execute()) : execute(); + }, + }; +} + +function shouldRecordInputs(event: AISDKV7TelemetryOptions): boolean { + return event.recordInputs !== false; +} + +function shouldRecordOutputs(event: AISDKV7TelemetryOptions): boolean { + return event.recordOutputs !== false; +} + +function operationNameFromId(operationId: string | undefined): string { + return operationId?.startsWith("ai.") + ? operationId.slice("ai.".length) + : operationId || "ai-sdk"; +} + +function modelFromEvent(event: { + modelId?: string; + provider?: string; +}): AISDKModel | undefined { + return event.modelId + ? { + modelId: event.modelId, + ...(event.provider ? { provider: event.provider } : {}), + } + : undefined; +} + +function metadataFromEvent( + event: AISDKV7TelemetryOptions & { modelId?: string; provider?: string }, +): Record { + const metadata = createAISDKIntegrationMetadata(); + const { model, provider } = serializeModelWithProvider(modelFromEvent(event)); + if (model) { + metadata.model = model; + } + if (provider) { + metadata.provider = provider; + } + if (typeof event.functionId === "string") { + metadata.functionId = event.functionId; + } + return metadata; +} + +function operationInput( + event: AISDKV7OperationEvent | AISDKV7LanguageModelCallStartEvent, + operationName: string, +): AISDKCallParams { + if (operationName === "embed") { + return { + model: modelFromEvent(event), + value: (event as { value?: unknown }).value, + }; + } + + if (operationName === "embedMany") { + return { + model: modelFromEvent(event), + values: Array.isArray((event as { value?: unknown }).value) + ? ((event as { value?: unknown[] }).value ?? []) + : undefined, + }; + } + + if (operationName === "rerank") { + return { + model: modelFromEvent(event), + documents: (event as { documents?: unknown[] }).documents, + query: (event as { query?: string }).query, + topN: (event as { topN?: number }).topN, + }; + } + + return { + model: modelFromEvent(event), + system: event.system, + prompt: event.prompt, + messages: event.messages, + tools: event.tools, + toolChoice: event.toolChoice, + activeTools: event.activeTools, + output: event.output, + schema: event.schema, + schemaName: event.schemaName, + schemaDescription: event.schemaDescription, + maxOutputTokens: event.maxOutputTokens, + temperature: event.temperature, + topP: event.topP, + topK: event.topK, + presencePenalty: event.presencePenalty, + frequencyPenalty: event.frequencyPenalty, + seed: event.seed, + maxRetries: event.maxRetries, + headers: event.headers, + providerOptions: event.providerOptions, + } as AISDKCallParams; +} + +function shiftModelSpan( + modelSpans: Map, + callId: string, +): Span | undefined { + const spans = modelSpans.get(callId); + const span = spans?.shift(); + if (spans && spans.length === 0) { + modelSpans.delete(callId); + } + return span; +} + +function finishResult( + event: AISDKV7OperationEvent, + operationName: string, +): AISDKResult | AISDKEmbeddingResult | AISDKRerankResult { + if (operationName === "embed") { + return { + ...event, + embedding: (event as { embedding?: unknown }).embedding, + } as AISDKEmbeddingResult; + } + + if (operationName === "embedMany") { + return { + ...event, + embeddings: (event as { embedding?: unknown }).embedding, + } as AISDKEmbeddingResult; + } + + if (operationName === "rerank") { + return event as AISDKRerankResult; + } + + return event as AISDKResult; +} + +function finishOutput( + result: AISDKResult | AISDKEmbeddingResult | AISDKRerankResult, + operationName: string, +): unknown { + if (operationName === "embed" || operationName === "embedMany") { + return processAISDKEmbeddingOutput( + result as AISDKEmbeddingResult, + DEFAULT_DENY_OUTPUT_PATHS, + ); + } + + if (operationName === "rerank") { + return processAISDKRerankOutput( + result as AISDKRerankResult, + DEFAULT_DENY_OUTPUT_PATHS, + ); + } + + return processAISDKOutput(result as AISDKResult, DEFAULT_DENY_OUTPUT_PATHS); +}