@arizeai/openinference-instrumentation-openai 0.0.3 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/esm/index.d.ts +1 -1
  2. package/dist/esm/index.js +1 -1
  3. package/dist/esm/instrumentation.d.ts +13 -19
  4. package/dist/esm/instrumentation.d.ts.map +1 -1
  5. package/dist/esm/instrumentation.js +451 -30
  6. package/dist/esm/instrumentation.js.map +1 -1
  7. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  8. package/dist/esm/typeUtils.d.ts +8 -0
  9. package/dist/esm/typeUtils.d.ts.map +1 -0
  10. package/dist/esm/typeUtils.js +10 -0
  11. package/dist/esm/typeUtils.js.map +1 -0
  12. package/dist/esm/version.d.ts +2 -2
  13. package/dist/esm/version.js +2 -2
  14. package/dist/esnext/index.d.ts +1 -1
  15. package/dist/esnext/index.js +1 -1
  16. package/dist/esnext/instrumentation.d.ts +13 -19
  17. package/dist/esnext/instrumentation.d.ts.map +1 -1
  18. package/dist/esnext/instrumentation.js +321 -29
  19. package/dist/esnext/instrumentation.js.map +1 -1
  20. package/dist/esnext/tsconfig.esnext.tsbuildinfo +1 -1
  21. package/dist/esnext/typeUtils.d.ts +8 -0
  22. package/dist/esnext/typeUtils.d.ts.map +1 -0
  23. package/dist/esnext/typeUtils.js +10 -0
  24. package/dist/esnext/typeUtils.js.map +1 -0
  25. package/dist/esnext/version.d.ts +2 -2
  26. package/dist/esnext/version.js +2 -2
  27. package/dist/src/instrumentation.d.ts.map +1 -1
  28. package/dist/src/instrumentation.js +333 -29
  29. package/dist/src/instrumentation.js.map +1 -1
  30. package/dist/src/typeUtils.d.ts +8 -0
  31. package/dist/src/typeUtils.d.ts.map +1 -0
  32. package/dist/src/typeUtils.js +14 -0
  33. package/dist/src/typeUtils.js.map +1 -0
  34. package/dist/src/version.d.ts +1 -1
  35. package/dist/src/version.js +1 -1
  36. package/dist/test/openai.test.js +387 -6
  37. package/dist/test/openai.test.js.map +1 -1
  38. package/dist/tsconfig.tsbuildinfo +1 -1
  39. package/package.json +6 -2
  40. package/src/instrumentation.ts +420 -48
  41. package/src/typeUtils.ts +9 -0
  42. package/src/version.ts +1 -1
@@ -31,6 +31,26 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
31
31
  step((generator = generator.apply(thisArg, _arguments || [])).next());
32
32
  });
33
33
  };
34
+ var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
35
+ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
36
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
37
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
38
+ return i = {}, verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
39
+ function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
40
+ function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
41
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
42
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
43
+ function fulfill(value) { resume("next", value); }
44
+ function reject(value) { resume("throw", value); }
45
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
46
+ };
47
+ var __asyncValues = (this && this.__asyncValues) || function (o) {
48
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
49
+ var m = o[Symbol.asyncIterator], i;
50
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
51
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
52
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
53
+ };
34
54
  Object.defineProperty(exports, "__esModule", { value: true });
35
55
  const src_1 = require("../src");
36
56
  const sdk_trace_base_1 = require("@opentelemetry/sdk-trace-base");
@@ -40,6 +60,7 @@ tracerProvider.register();
40
60
  const instrumentation = new src_1.OpenAIInstrumentation();
41
61
  instrumentation.disable();
42
62
  const OpenAI = __importStar(require("openai"));
63
+ const streaming_1 = require("openai/streaming");
43
64
  describe("OpenAIInstrumentation", () => {
44
65
  let openai;
45
66
  const memoryExporter = new sdk_trace_base_1.InMemorySpanExporter();
@@ -47,17 +68,21 @@ describe("OpenAIInstrumentation", () => {
47
68
  provider.getTracer("default");
48
69
  instrumentation.setTracerProvider(tracerProvider);
49
70
  tracerProvider.addSpanProcessor(new sdk_trace_base_1.SimpleSpanProcessor(memoryExporter));
50
- beforeEach(() => {
51
- // @ts-expect-error the moduleExports property is private. This is needed to make the test work with auto-mocking
52
- instrumentation._modules[0].moduleExports = OpenAI;
71
+ // @ts-expect-error the moduleExports property is private. This is needed to make the test work with auto-mocking
72
+ instrumentation._modules[0].moduleExports = OpenAI;
73
+ beforeAll(() => {
53
74
  instrumentation.enable();
54
75
  openai = new OpenAI.OpenAI({
55
- apiKey: `fake-api-key`,
76
+ apiKey: "fake-api-key",
56
77
  });
78
+ });
79
+ afterAll(() => {
80
+ instrumentation.disable();
81
+ });
82
+ beforeEach(() => {
57
83
  memoryExporter.reset();
58
84
  });
59
85
  afterEach(() => {
60
- instrumentation.disable();
61
86
  jest.clearAllMocks();
62
87
  });
63
88
  it("is patched", () => {
@@ -107,7 +132,7 @@ describe("OpenAIInstrumentation", () => {
107
132
  "llm.input_messages.0.message.content": "Say this is a test",
108
133
  "llm.input_messages.0.message.role": "user",
109
134
  "llm.invocation_parameters": "{"model":"gpt-3.5-turbo"}",
110
- "llm.model_name": "gpt-3.5-turbo",
135
+ "llm.model_name": "gpt-3.5-turbo-0613",
111
136
  "llm.output_messages.0.message.content": "This is a test.",
112
137
  "llm.output_messages.0.message.role": "assistant",
113
138
  "llm.token_count.completion": 5,
@@ -119,5 +144,361 @@ describe("OpenAIInstrumentation", () => {
119
144
  }
120
145
  `);
121
146
  }));
147
+ it("creates a span for completions", () => __awaiter(void 0, void 0, void 0, function* () {
148
+ const response = {
149
+ id: "cmpl-8fZu1H3VijJUWev9asnxaYyQvJTC9",
150
+ object: "text_completion",
151
+ created: 1704920149,
152
+ model: "gpt-3.5-turbo-instruct",
153
+ choices: [
154
+ {
155
+ text: "This is a test",
156
+ index: 0,
157
+ logprobs: null,
158
+ finish_reason: "stop",
159
+ },
160
+ ],
161
+ usage: { prompt_tokens: 12, completion_tokens: 5, total_tokens: 17 },
162
+ };
163
+ // Mock out the completions endpoint
164
+ jest.spyOn(openai, "post").mockImplementation(
165
+ // @ts-expect-error the response type is not correct - this is just for testing
166
+ () => __awaiter(void 0, void 0, void 0, function* () {
167
+ return response;
168
+ }));
169
+ yield openai.completions.create({
170
+ prompt: "Say this is a test",
171
+ model: "gpt-3.5-turbo-instruct",
172
+ });
173
+ const spans = memoryExporter.getFinishedSpans();
174
+ expect(spans.length).toBe(1);
175
+ const span = spans[0];
176
+ expect(span.name).toBe("OpenAI Completions");
177
+ expect(span.attributes).toMatchInlineSnapshot(`
178
+ {
179
+ "input.mime_type": "text/plain",
180
+ "input.value": "Say this is a test",
181
+ "llm.invocation_parameters": "{"model":"gpt-3.5-turbo-instruct"}",
182
+ "llm.model_name": "gpt-3.5-turbo-instruct",
183
+ "llm.token_count.completion": 5,
184
+ "llm.token_count.prompt": 12,
185
+ "llm.token_count.total": 17,
186
+ "openinference.span.kind": "llm",
187
+ "output.mime_type": "text/plain",
188
+ "output.value": "This is a test",
189
+ }
190
+ `);
191
+ }));
192
+ it("creates a span for embedding create", () => __awaiter(void 0, void 0, void 0, function* () {
193
+ const response = {
194
+ object: "list",
195
+ data: [{ object: "embedding", index: 0, embedding: [1, 2, 3] }],
196
+ };
197
+ // Mock out the embedding create endpoint
198
+ jest.spyOn(openai, "post").mockImplementation(
199
+ // @ts-expect-error the response type is not correct - this is just for testing
200
+ () => __awaiter(void 0, void 0, void 0, function* () {
201
+ return response;
202
+ }));
203
+ yield openai.embeddings.create({
204
+ input: "A happy moment",
205
+ model: "text-embedding-ada-002",
206
+ });
207
+ const spans = memoryExporter.getFinishedSpans();
208
+ expect(spans.length).toBe(1);
209
+ const span = spans[0];
210
+ expect(span.name).toBe("OpenAI Embeddings");
211
+ expect(span.attributes).toMatchInlineSnapshot(`
212
+ {
213
+ "embedding.embeddings.0.embedding.text": "A happy moment",
214
+ "embedding.embeddings.0.embedding.vector": [
215
+ 1,
216
+ 2,
217
+ 3,
218
+ ],
219
+ "embedding.model_name": "text-embedding-ada-002",
220
+ "input.mime_type": "text/plain",
221
+ "input.value": "A happy moment",
222
+ "openinference.span.kind": "embedding",
223
+ }
224
+ `);
225
+ }));
226
+ it("can handle streaming responses", () => __awaiter(void 0, void 0, void 0, function* () {
227
+ var _a, e_1, _b, _c;
228
+ // Mock out the embedding create endpoint
229
+ jest.spyOn(openai, "post").mockImplementation(
230
+ // @ts-expect-error the response type is not correct - this is just for testing
231
+ () => __awaiter(void 0, void 0, void 0, function* () {
232
+ const iterator = () => (function () {
233
+ return __asyncGenerator(this, arguments, function* () {
234
+ yield yield __await({ choices: [{ delta: { content: "This is " } }] });
235
+ yield yield __await({ choices: [{ delta: { content: "a test." } }] });
236
+ yield yield __await({ choices: [{ delta: { finish_reason: "stop" } }] });
237
+ });
238
+ })();
239
+ const controller = new AbortController();
240
+ return new streaming_1.Stream(iterator, controller);
241
+ }));
242
+ const stream = yield openai.chat.completions.create({
243
+ messages: [{ role: "user", content: "Say this is a test" }],
244
+ model: "gpt-3.5-turbo",
245
+ stream: true,
246
+ });
247
+ let response = "";
248
+ try {
249
+ for (var _d = true, stream_1 = __asyncValues(stream), stream_1_1; stream_1_1 = yield stream_1.next(), _a = stream_1_1.done, !_a; _d = true) {
250
+ _c = stream_1_1.value;
251
+ _d = false;
252
+ const chunk = _c;
253
+ if (chunk.choices[0].delta.content)
254
+ response += chunk.choices[0].delta.content;
255
+ }
256
+ }
257
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
258
+ finally {
259
+ try {
260
+ if (!_d && !_a && (_b = stream_1.return)) yield _b.call(stream_1);
261
+ }
262
+ finally { if (e_1) throw e_1.error; }
263
+ }
264
+ expect(response).toBe("This is a test.");
265
+ const spans = memoryExporter.getFinishedSpans();
266
+ expect(spans.length).toBe(1);
267
+ const span = spans[0];
268
+ expect(span.name).toBe("OpenAI Chat Completions");
269
+ expect(span.attributes).toMatchInlineSnapshot(`
270
+ {
271
+ "input.mime_type": "application/json",
272
+ "input.value": "{"messages":[{"role":"user","content":"Say this is a test"}],"model":"gpt-3.5-turbo","stream":true}",
273
+ "llm.input_messages.0.message.content": "Say this is a test",
274
+ "llm.input_messages.0.message.role": "user",
275
+ "llm.invocation_parameters": "{"model":"gpt-3.5-turbo","stream":true}",
276
+ "llm.model_name": "gpt-3.5-turbo",
277
+ "llm.output_messages.0.message.content": "This is a test.",
278
+ "llm.output_messages.0.message.role": "assistant",
279
+ "openinference.span.kind": "llm",
280
+ "output.mime_type": "text/plain",
281
+ "output.value": "This is a test.",
282
+ }
283
+ `);
284
+ }));
285
+ it("should capture tool calls", () => __awaiter(void 0, void 0, void 0, function* () {
286
+ // Mock out the embedding create endpoint
287
+ const response1 = {
288
+ id: "chatcmpl-8hhqZDFTRD0vzExhqWnMLE7viVl7E",
289
+ object: "chat.completion",
290
+ created: 1705427343,
291
+ model: "gpt-3.5-turbo-0613",
292
+ choices: [
293
+ {
294
+ index: 0,
295
+ message: {
296
+ role: "assistant",
297
+ content: null,
298
+ tool_calls: [
299
+ {
300
+ id: "call_5ERYvu4iTGSvDlcDQjDP3g3J",
301
+ type: "function",
302
+ function: { name: "getCurrentLocation", arguments: "{}" },
303
+ },
304
+ ],
305
+ },
306
+ logprobs: null,
307
+ finish_reason: "tool_calls",
308
+ },
309
+ ],
310
+ usage: { prompt_tokens: 70, completion_tokens: 7, total_tokens: 77 },
311
+ system_fingerprint: null,
312
+ };
313
+ const response2 = {
314
+ id: "chatcmpl-8hhsP9eAplUFYB3mHUJxBkq7IwnjZ",
315
+ object: "chat.completion",
316
+ created: 1705427457,
317
+ model: "gpt-3.5-turbo-0613",
318
+ choices: [
319
+ {
320
+ index: 0,
321
+ message: {
322
+ role: "assistant",
323
+ content: null,
324
+ tool_calls: [
325
+ {
326
+ id: "call_0LCdYLkdRUt3rV3dawoIFHBf",
327
+ type: "function",
328
+ function: {
329
+ name: "getWeather",
330
+ arguments: '{\n "location": "Boston"\n}',
331
+ },
332
+ },
333
+ ],
334
+ },
335
+ logprobs: null,
336
+ finish_reason: "tool_calls",
337
+ },
338
+ ],
339
+ usage: { prompt_tokens: 86, completion_tokens: 15, total_tokens: 101 },
340
+ system_fingerprint: null,
341
+ };
342
+ const response3 = {
343
+ id: "chatcmpl-8hhtfzSD33tsG7XJiBg4F9MqnXKDp",
344
+ object: "chat.completion",
345
+ created: 1705427535,
346
+ model: "gpt-3.5-turbo-0613",
347
+ choices: [
348
+ {
349
+ index: 0,
350
+ message: {
351
+ role: "assistant",
352
+ content: "The weather in Boston this week is expected to be rainy with a temperature of 52 degrees.",
353
+ },
354
+ logprobs: null,
355
+ finish_reason: "stop",
356
+ },
357
+ ],
358
+ usage: { prompt_tokens: 121, completion_tokens: 20, total_tokens: 141 },
359
+ system_fingerprint: null,
360
+ };
361
+ jest
362
+ .spyOn(openai, "post")
363
+ .mockImplementationOnce(
364
+ // @ts-expect-error the response type is not correct - this is just for testing
365
+ () => __awaiter(void 0, void 0, void 0, function* () {
366
+ return response1;
367
+ }))
368
+ .mockImplementationOnce(
369
+ // @ts-expect-error the response type is not correct - this is just for testing
370
+ () => __awaiter(void 0, void 0, void 0, function* () {
371
+ return response2;
372
+ }))
373
+ .mockImplementationOnce(
374
+ // @ts-expect-error the response type is not correct - this is just for testing
375
+ () => __awaiter(void 0, void 0, void 0, function* () {
376
+ return response3;
377
+ }));
378
+ // Function tools
379
+ function getCurrentLocation() {
380
+ return __awaiter(this, void 0, void 0, function* () {
381
+ return "Boston"; // Simulate lookup
382
+ });
383
+ }
384
+ function getWeather(_args) {
385
+ return __awaiter(this, void 0, void 0, function* () {
386
+ return { temperature: 52, precipitation: "rainy" };
387
+ });
388
+ }
389
+ const messages = [];
390
+ const runner = openai.beta.chat.completions
391
+ .runTools({
392
+ model: "gpt-3.5-turbo",
393
+ messages: [{ role: "user", content: "How is the weather this week?" }],
394
+ tools: [
395
+ {
396
+ type: "function",
397
+ function: {
398
+ function: getCurrentLocation,
399
+ parameters: { type: "object", properties: {} },
400
+ description: "Get the current location of the user.",
401
+ },
402
+ },
403
+ {
404
+ type: "function",
405
+ function: {
406
+ function: getWeather,
407
+ parse: JSON.parse, // or use a validation library like zod for typesafe parsing.
408
+ description: "Get the weather for a location.",
409
+ parameters: {
410
+ type: "object",
411
+ properties: {
412
+ location: { type: "string" },
413
+ },
414
+ },
415
+ },
416
+ },
417
+ ],
418
+ })
419
+ .on("message", (message) => messages.push(message));
420
+ const _finalContent = yield runner.finalContent();
421
+ const spans = memoryExporter.getFinishedSpans();
422
+ expect(spans.length).toBe(3);
423
+ const [span1, span2, span3] = spans;
424
+ expect(span1.name).toBe("OpenAI Chat Completions");
425
+ expect(span1.attributes).toMatchInlineSnapshot(`
426
+ {
427
+ "input.mime_type": "application/json",
428
+ "input.value": "{"model":"gpt-3.5-turbo","messages":[{"role":"user","content":"How is the weather this week?"}],"tools":[{"type":"function","function":{"name":"getCurrentLocation","parameters":{"type":"object","properties":{}},"description":"Get the current location of the user."}},{"type":"function","function":{"name":"getWeather","parameters":{"type":"object","properties":{"location":{"type":"string"}}},"description":"Get the weather for a location."}}],"tool_choice":"auto","stream":false}",
429
+ "llm.input_messages.0.message.content": "How is the weather this week?",
430
+ "llm.input_messages.0.message.role": "user",
431
+ "llm.invocation_parameters": "{"model":"gpt-3.5-turbo","tools":[{"type":"function","function":{"name":"getCurrentLocation","parameters":{"type":"object","properties":{}},"description":"Get the current location of the user."}},{"type":"function","function":{"name":"getWeather","parameters":{"type":"object","properties":{"location":{"type":"string"}}},"description":"Get the weather for a location."}}],"tool_choice":"auto","stream":false}",
432
+ "llm.model_name": "gpt-3.5-turbo-0613",
433
+ "llm.output_messages.0.message.role": "assistant",
434
+ "llm.output_messages.0.message.tool_calls.0.tool_call.function.arguments": "{}",
435
+ "llm.output_messages.0.message.tool_calls.0.tool_call.function.name": "getCurrentLocation",
436
+ "llm.token_count.completion": 7,
437
+ "llm.token_count.prompt": 70,
438
+ "llm.token_count.total": 77,
439
+ "openinference.span.kind": "llm",
440
+ "output.mime_type": "application/json",
441
+ "output.value": "{"id":"chatcmpl-8hhqZDFTRD0vzExhqWnMLE7viVl7E","object":"chat.completion","created":1705427343,"model":"gpt-3.5-turbo-0613","choices":[{"index":0,"message":{"role":"assistant","content":null,"tool_calls":[{"id":"call_5ERYvu4iTGSvDlcDQjDP3g3J","type":"function","function":{"name":"getCurrentLocation","arguments":"{}"}}]},"logprobs":null,"finish_reason":"tool_calls"}],"usage":{"prompt_tokens":70,"completion_tokens":7,"total_tokens":77},"system_fingerprint":null}",
442
+ }
443
+ `);
444
+ expect(span2.name).toBe("OpenAI Chat Completions");
445
+ expect(span2.attributes).toMatchInlineSnapshot(`
446
+ {
447
+ "input.mime_type": "application/json",
448
+ "input.value": "{"model":"gpt-3.5-turbo","messages":[{"role":"user","content":"How is the weather this week?"},{"role":"assistant","content":null,"tool_calls":[{"id":"call_5ERYvu4iTGSvDlcDQjDP3g3J","type":"function","function":{"name":"getCurrentLocation","arguments":"{}"}}]},{"role":"tool","tool_call_id":"call_5ERYvu4iTGSvDlcDQjDP3g3J","content":"Boston"}],"tools":[{"type":"function","function":{"name":"getCurrentLocation","parameters":{"type":"object","properties":{}},"description":"Get the current location of the user."}},{"type":"function","function":{"name":"getWeather","parameters":{"type":"object","properties":{"location":{"type":"string"}}},"description":"Get the weather for a location."}}],"tool_choice":"auto","stream":false}",
449
+ "llm.input_messages.0.message.content": "How is the weather this week?",
450
+ "llm.input_messages.0.message.role": "user",
451
+ "llm.input_messages.1.message.role": "assistant",
452
+ "llm.input_messages.1.message.tool_calls.0.tool_call.function.arguments": "{}",
453
+ "llm.input_messages.1.message.tool_calls.0.tool_call.function.name": "getCurrentLocation",
454
+ "llm.input_messages.2.message.content": "Boston",
455
+ "llm.input_messages.2.message.role": "tool",
456
+ "llm.invocation_parameters": "{"model":"gpt-3.5-turbo","tools":[{"type":"function","function":{"name":"getCurrentLocation","parameters":{"type":"object","properties":{}},"description":"Get the current location of the user."}},{"type":"function","function":{"name":"getWeather","parameters":{"type":"object","properties":{"location":{"type":"string"}}},"description":"Get the weather for a location."}}],"tool_choice":"auto","stream":false}",
457
+ "llm.model_name": "gpt-3.5-turbo-0613",
458
+ "llm.output_messages.0.message.role": "assistant",
459
+ "llm.output_messages.0.message.tool_calls.0.tool_call.function.arguments": "{
460
+ "location": "Boston"
461
+ }",
462
+ "llm.output_messages.0.message.tool_calls.0.tool_call.function.name": "getWeather",
463
+ "llm.token_count.completion": 15,
464
+ "llm.token_count.prompt": 86,
465
+ "llm.token_count.total": 101,
466
+ "openinference.span.kind": "llm",
467
+ "output.mime_type": "application/json",
468
+ "output.value": "{"id":"chatcmpl-8hhsP9eAplUFYB3mHUJxBkq7IwnjZ","object":"chat.completion","created":1705427457,"model":"gpt-3.5-turbo-0613","choices":[{"index":0,"message":{"role":"assistant","content":null,"tool_calls":[{"id":"call_0LCdYLkdRUt3rV3dawoIFHBf","type":"function","function":{"name":"getWeather","arguments":"{\\n \\"location\\": \\"Boston\\"\\n}"}}]},"logprobs":null,"finish_reason":"tool_calls"}],"usage":{"prompt_tokens":86,"completion_tokens":15,"total_tokens":101},"system_fingerprint":null}",
469
+ }
470
+ `);
471
+ expect(span3.name).toBe("OpenAI Chat Completions");
472
+ expect(span3.attributes).toMatchInlineSnapshot(`
473
+ {
474
+ "input.mime_type": "application/json",
475
+ "input.value": "{"model":"gpt-3.5-turbo","messages":[{"role":"user","content":"How is the weather this week?"},{"role":"assistant","content":null,"tool_calls":[{"id":"call_5ERYvu4iTGSvDlcDQjDP3g3J","type":"function","function":{"name":"getCurrentLocation","arguments":"{}"}}]},{"role":"tool","tool_call_id":"call_5ERYvu4iTGSvDlcDQjDP3g3J","content":"Boston"},{"role":"assistant","content":null,"tool_calls":[{"id":"call_0LCdYLkdRUt3rV3dawoIFHBf","type":"function","function":{"name":"getWeather","arguments":"{\\n \\"location\\": \\"Boston\\"\\n}"}}]},{"role":"tool","tool_call_id":"call_0LCdYLkdRUt3rV3dawoIFHBf","content":"{\\"temperature\\":52,\\"precipitation\\":\\"rainy\\"}"}],"tools":[{"type":"function","function":{"name":"getCurrentLocation","parameters":{"type":"object","properties":{}},"description":"Get the current location of the user."}},{"type":"function","function":{"name":"getWeather","parameters":{"type":"object","properties":{"location":{"type":"string"}}},"description":"Get the weather for a location."}}],"tool_choice":"auto","stream":false}",
476
+ "llm.input_messages.0.message.content": "How is the weather this week?",
477
+ "llm.input_messages.0.message.role": "user",
478
+ "llm.input_messages.1.message.role": "assistant",
479
+ "llm.input_messages.1.message.tool_calls.0.tool_call.function.arguments": "{}",
480
+ "llm.input_messages.1.message.tool_calls.0.tool_call.function.name": "getCurrentLocation",
481
+ "llm.input_messages.2.message.content": "Boston",
482
+ "llm.input_messages.2.message.role": "tool",
483
+ "llm.input_messages.3.message.role": "assistant",
484
+ "llm.input_messages.3.message.tool_calls.0.tool_call.function.arguments": "{
485
+ "location": "Boston"
486
+ }",
487
+ "llm.input_messages.3.message.tool_calls.0.tool_call.function.name": "getWeather",
488
+ "llm.input_messages.4.message.content": "{"temperature":52,"precipitation":"rainy"}",
489
+ "llm.input_messages.4.message.role": "tool",
490
+ "llm.invocation_parameters": "{"model":"gpt-3.5-turbo","tools":[{"type":"function","function":{"name":"getCurrentLocation","parameters":{"type":"object","properties":{}},"description":"Get the current location of the user."}},{"type":"function","function":{"name":"getWeather","parameters":{"type":"object","properties":{"location":{"type":"string"}}},"description":"Get the weather for a location."}}],"tool_choice":"auto","stream":false}",
491
+ "llm.model_name": "gpt-3.5-turbo-0613",
492
+ "llm.output_messages.0.message.content": "The weather in Boston this week is expected to be rainy with a temperature of 52 degrees.",
493
+ "llm.output_messages.0.message.role": "assistant",
494
+ "llm.token_count.completion": 20,
495
+ "llm.token_count.prompt": 121,
496
+ "llm.token_count.total": 141,
497
+ "openinference.span.kind": "llm",
498
+ "output.mime_type": "application/json",
499
+ "output.value": "{"id":"chatcmpl-8hhtfzSD33tsG7XJiBg4F9MqnXKDp","object":"chat.completion","created":1705427535,"model":"gpt-3.5-turbo-0613","choices":[{"index":0,"message":{"role":"assistant","content":"The weather in Boston this week is expected to be rainy with a temperature of 52 degrees."},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":121,"completion_tokens":20,"total_tokens":141},"system_fingerprint":null}",
500
+ }
501
+ `);
502
+ }));
122
503
  });
123
504
  //# sourceMappingURL=openai.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"openai.test.js","sourceRoot":"","sources":["../../test/openai.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gCAA+C;AAC/C,kEAGuC;AACvC,kEAAmE;AACnE,MAAM,cAAc,GAAG,IAAI,mCAAkB,EAAE,CAAC;AAChD,cAAc,CAAC,QAAQ,EAAE,CAAC;AAE1B,MAAM,eAAe,GAAG,IAAI,2BAAqB,EAAE,CAAC;AACpD,eAAe,CAAC,OAAO,EAAE,CAAC;AAE1B,+CAAiC;AAEjC,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,IAAI,MAAqB,CAAC;IAE1B,MAAM,cAAc,GAAG,IAAI,qCAAoB,EAAE,CAAC;IAClD,MAAM,QAAQ,GA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