@arizeai/openinference-instrumentation-openai 0.4.1 → 0.6.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.
@@ -35,6 +35,7 @@ const version_1 = require("./version");
35
35
  const openinference_semantic_conventions_1 = require("@arizeai/openinference-semantic-conventions");
36
36
  const typeUtils_1 = require("./typeUtils");
37
37
  const core_1 = require("@opentelemetry/core");
38
+ const openinference_core_1 = require("@arizeai/openinference-core");
38
39
  const MODULE_NAME = "openai";
39
40
  /**
40
41
  * Flag to check if the openai module has been patched
@@ -99,7 +100,7 @@ class OpenAIInstrumentation extends instrumentation_1.InstrumentationBase {
99
100
  const { messages: _messages } = body, invocationParameters = __rest(body, ["messages"]);
100
101
  const span = instrumentation.tracer.startSpan(`OpenAI Chat Completions`, {
101
102
  kind: api_1.SpanKind.INTERNAL,
102
- attributes: Object.assign({ [openinference_semantic_conventions_1.SemanticConventions.OPENINFERENCE_SPAN_KIND]: openinference_semantic_conventions_1.OpenInferenceSpanKind.LLM, [openinference_semantic_conventions_1.SemanticConventions.LLM_MODEL_NAME]: body.model, [openinference_semantic_conventions_1.SemanticConventions.INPUT_VALUE]: JSON.stringify(body), [openinference_semantic_conventions_1.SemanticConventions.INPUT_MIME_TYPE]: openinference_semantic_conventions_1.MimeType.JSON, [openinference_semantic_conventions_1.SemanticConventions.LLM_INVOCATION_PARAMETERS]: JSON.stringify(invocationParameters) }, getLLMInputMessagesAttributes(body)),
103
+ attributes: Object.assign(Object.assign({ [openinference_semantic_conventions_1.SemanticConventions.OPENINFERENCE_SPAN_KIND]: openinference_semantic_conventions_1.OpenInferenceSpanKind.LLM, [openinference_semantic_conventions_1.SemanticConventions.LLM_MODEL_NAME]: body.model, [openinference_semantic_conventions_1.SemanticConventions.INPUT_VALUE]: JSON.stringify(body), [openinference_semantic_conventions_1.SemanticConventions.INPUT_MIME_TYPE]: openinference_semantic_conventions_1.MimeType.JSON, [openinference_semantic_conventions_1.SemanticConventions.LLM_INVOCATION_PARAMETERS]: JSON.stringify(invocationParameters), [openinference_semantic_conventions_1.SemanticConventions.LLM_SYSTEM]: openinference_semantic_conventions_1.LLMSystem.OPENAI, [openinference_semantic_conventions_1.SemanticConventions.LLM_PROVIDER]: openinference_semantic_conventions_1.LLMProvider.OPENAI }, getLLMInputMessagesAttributes(body)), getLLMToolsJSONSchema(body)),
103
104
  });
104
105
  const execContext = getExecContext(span);
105
106
  const execPromise = (0, instrumentation_1.safeExecuteInTheMiddle)(() => {
@@ -147,7 +148,7 @@ class OpenAIInstrumentation extends instrumentation_1.InstrumentationBase {
147
148
  const { prompt: _prompt } = body, invocationParameters = __rest(body, ["prompt"]);
148
149
  const span = instrumentation.tracer.startSpan(`OpenAI Completions`, {
149
150
  kind: api_1.SpanKind.INTERNAL,
150
- attributes: Object.assign({ [openinference_semantic_conventions_1.SemanticConventions.OPENINFERENCE_SPAN_KIND]: openinference_semantic_conventions_1.OpenInferenceSpanKind.LLM, [openinference_semantic_conventions_1.SemanticConventions.LLM_MODEL_NAME]: body.model, [openinference_semantic_conventions_1.SemanticConventions.LLM_INVOCATION_PARAMETERS]: JSON.stringify(invocationParameters) }, getCompletionInputValueAndMimeType(body)),
151
+ attributes: Object.assign({ [openinference_semantic_conventions_1.SemanticConventions.OPENINFERENCE_SPAN_KIND]: openinference_semantic_conventions_1.OpenInferenceSpanKind.LLM, [openinference_semantic_conventions_1.SemanticConventions.LLM_MODEL_NAME]: body.model, [openinference_semantic_conventions_1.SemanticConventions.LLM_INVOCATION_PARAMETERS]: JSON.stringify(invocationParameters), [openinference_semantic_conventions_1.SemanticConventions.LLM_SYSTEM]: openinference_semantic_conventions_1.LLMSystem.OPENAI, [openinference_semantic_conventions_1.SemanticConventions.LLM_PROVIDER]: openinference_semantic_conventions_1.LLMProvider.OPENAI }, getCompletionInputValueAndMimeType(body)),
151
152
  });
152
153
  const execContext = getExecContext(span);
153
154
  const execPromise = (0, instrumentation_1.safeExecuteInTheMiddle)(() => {
@@ -283,6 +284,23 @@ function getLLMInputMessagesAttributes(body) {
283
284
  return acc;
284
285
  }, {});
285
286
  }
287
+ /**
288
+ * Converts each tool definition into a json schema
289
+ */
290
+ function getLLMToolsJSONSchema(body) {
291
+ if (!body.tools) {
292
+ // If tools is undefined, return an empty object
293
+ return {};
294
+ }
295
+ return body.tools.reduce((acc, tool, index) => {
296
+ const toolJsonSchema = (0, openinference_core_1.safelyJSONStringify)(tool);
297
+ const key = `${openinference_semantic_conventions_1.SemanticConventions.LLM_TOOLS}.${index}.${openinference_semantic_conventions_1.SemanticConventions.TOOL_JSON_SCHEMA}`;
298
+ if (toolJsonSchema) {
299
+ acc[key] = toolJsonSchema;
300
+ }
301
+ return acc;
302
+ }, {});
303
+ }
286
304
  function getChatCompletionInputMessageAttributes(message) {
287
305
  const role = message.role;
288
306
  const attributes = {
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../src/instrumentation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,8BAEC;AApDD,oEAMwC;AACxC,4CAQ4B;AAC5B,uCAAoC;AACpC,oGAIqD;AAerD,2CAA0D;AAC1D,8CAA0D;AAE1D,MAAM,WAAW,GAAG,QAAQ,CAAC;AAE7B;;;GAGG;AACH,IAAI,uBAAuB,GAAG,KAAK,CAAC;AAEpC;;GAEG;AACH,SAAgB,SAAS;IACvB,OAAO,uBAAuB,CAAC;AACjC,CAAC;AAED;;;;GAIG;AACH,SAAS,cAAc,CAAC,IAAU;IAChC,MAAM,aAAa,GAAG,aAAO,CAAC,MAAM,EAAE,CAAC;IACvC,MAAM,eAAe,GAAG,IAAA,0BAAmB,EAAC,aAAa,CAAC,CAAC;IAC3D,MAAM,WAAW,GAAG,eAAe;QACjC,CAAC,CAAC,WAAK,CAAC,OAAO,CAAC,aAAO,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC;QACvC,CAAC,CAAC,aAAa,CAAC;IAClB,iCAA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YAClC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACD,IAAI,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QAC/B,UAAU,CAAC,wDAAmB,CAAC,0BAA0B,CAAC;YACxD,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC;QAClC,UAAU,CAAC,wDAAmB,CAAC,oCAAoC,CAAC;YAClE,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC;IACzC,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.4.1";
1
+ export declare const VERSION = "0.6.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // this is an auto-generated file. see js/scripts/version-update.js
5
- exports.VERSION = "0.4.1";
5
+ exports.VERSION = "0.6.0";
6
6
  //# sourceMappingURL=version.js.map
@@ -144,23 +144,25 @@ describe("OpenAIInstrumentation", () => {
144
144
  const span = spans[0];
145
145
  expect(span.name).toBe("OpenAI Chat Completions");
146
146
  expect(span.attributes).toMatchInlineSnapshot(`
147
- {
148
- "input.mime_type": "application/json",
149
- "input.value": "{"messages":[{"role":"user","content":"Say this is a test"}],"model":"gpt-3.5-turbo"}",
150
- "llm.input_messages.0.message.content": "Say this is a test",
151
- "llm.input_messages.0.message.role": "user",
152
- "llm.invocation_parameters": "{"model":"gpt-3.5-turbo"}",
153
- "llm.model_name": "gpt-3.5-turbo-0613",
154
- "llm.output_messages.0.message.content": "This is a test.",
155
- "llm.output_messages.0.message.role": "assistant",
156
- "llm.token_count.completion": 5,
157
- "llm.token_count.prompt": 12,
158
- "llm.token_count.total": 17,
159
- "openinference.span.kind": "LLM",
160
- "output.mime_type": "application/json",
161
- "output.value": "{"id":"chatcmpl-8adq9JloOzNZ9TyuzrKyLpGXexh6p","object":"chat.completion","created":1703743645,"model":"gpt-3.5-turbo-0613","choices":[{"index":0,"message":{"role":"assistant","content":"This is a test."},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":12,"completion_tokens":5,"total_tokens":17}}",
162
- }
163
- `);
147
+ {
148
+ "input.mime_type": "application/json",
149
+ "input.value": "{"messages":[{"role":"user","content":"Say this is a test"}],"model":"gpt-3.5-turbo"}",
150
+ "llm.input_messages.0.message.content": "Say this is a test",
151
+ "llm.input_messages.0.message.role": "user",
152
+ "llm.invocation_parameters": "{"model":"gpt-3.5-turbo"}",
153
+ "llm.model_name": "gpt-3.5-turbo-0613",
154
+ "llm.output_messages.0.message.content": "This is a test.",
155
+ "llm.output_messages.0.message.role": "assistant",
156
+ "llm.provider": "openai",
157
+ "llm.system": "openai",
158
+ "llm.token_count.completion": 5,
159
+ "llm.token_count.prompt": 12,
160
+ "llm.token_count.total": 17,
161
+ "openinference.span.kind": "LLM",
162
+ "output.mime_type": "application/json",
163
+ "output.value": "{"id":"chatcmpl-8adq9JloOzNZ9TyuzrKyLpGXexh6p","object":"chat.completion","created":1703743645,"model":"gpt-3.5-turbo-0613","choices":[{"index":0,"message":{"role":"assistant","content":"This is a test."},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":12,"completion_tokens":5,"total_tokens":17}}",
164
+ }
165
+ `);
164
166
  }));
165
167
  it("creates a span for completions", () => __awaiter(void 0, void 0, void 0, function* () {
166
168
  const response = {
@@ -193,19 +195,21 @@ describe("OpenAIInstrumentation", () => {
193
195
  const span = spans[0];
194
196
  expect(span.name).toBe("OpenAI Completions");
195
197
  expect(span.attributes).toMatchInlineSnapshot(`
196
- {
197
- "input.mime_type": "text/plain",
198
- "input.value": "Say this is a test",
199
- "llm.invocation_parameters": "{"model":"gpt-3.5-turbo-instruct"}",
200
- "llm.model_name": "gpt-3.5-turbo-instruct",
201
- "llm.token_count.completion": 5,
202
- "llm.token_count.prompt": 12,
203
- "llm.token_count.total": 17,
204
- "openinference.span.kind": "LLM",
205
- "output.mime_type": "text/plain",
206
- "output.value": "This is a test",
207
- }
208
- `);
198
+ {
199
+ "input.mime_type": "text/plain",
200
+ "input.value": "Say this is a test",
201
+ "llm.invocation_parameters": "{"model":"gpt-3.5-turbo-instruct"}",
202
+ "llm.model_name": "gpt-3.5-turbo-instruct",
203
+ "llm.provider": "openai",
204
+ "llm.system": "openai",
205
+ "llm.token_count.completion": 5,
206
+ "llm.token_count.prompt": 12,
207
+ "llm.token_count.total": 17,
208
+ "openinference.span.kind": "LLM",
209
+ "output.mime_type": "text/plain",
210
+ "output.value": "This is a test",
211
+ }
212
+ `);
209
213
  }));
210
214
  it("creates a span for embedding create", () => __awaiter(void 0, void 0, void 0, function* () {
211
215
  const response = {
@@ -285,20 +289,22 @@ describe("OpenAIInstrumentation", () => {
285
289
  const span = spans[0];
286
290
  expect(span.name).toBe("OpenAI Chat Completions");
287
291
  expect(span.attributes).toMatchInlineSnapshot(`
288
- {
289
- "input.mime_type": "application/json",
290
- "input.value": "{"messages":[{"role":"user","content":"Say this is a test"}],"model":"gpt-3.5-turbo","stream":true}",
291
- "llm.input_messages.0.message.content": "Say this is a test",
292
- "llm.input_messages.0.message.role": "user",
293
- "llm.invocation_parameters": "{"model":"gpt-3.5-turbo","stream":true}",
294
- "llm.model_name": "gpt-3.5-turbo",
295
- "llm.output_messages.0.message.content": "This is a test.",
296
- "llm.output_messages.0.message.role": "assistant",
297
- "openinference.span.kind": "LLM",
298
- "output.mime_type": "text/plain",
299
- "output.value": "This is a test.",
300
- }
301
- `);
292
+ {
293
+ "input.mime_type": "application/json",
294
+ "input.value": "{"messages":[{"role":"user","content":"Say this is a test"}],"model":"gpt-3.5-turbo","stream":true}",
295
+ "llm.input_messages.0.message.content": "Say this is a test",
296
+ "llm.input_messages.0.message.role": "user",
297
+ "llm.invocation_parameters": "{"model":"gpt-3.5-turbo","stream":true}",
298
+ "llm.model_name": "gpt-3.5-turbo",
299
+ "llm.output_messages.0.message.content": "This is a test.",
300
+ "llm.output_messages.0.message.role": "assistant",
301
+ "llm.provider": "openai",
302
+ "llm.system": "openai",
303
+ "openinference.span.kind": "LLM",
304
+ "output.mime_type": "text/plain",
305
+ "output.value": "This is a test.",
306
+ }
307
+ `);
302
308
  }));
303
309
  it("should capture tool calls", () => __awaiter(void 0, void 0, void 0, function* () {
304
310
  // Mock out the embedding create endpoint
@@ -430,82 +436,94 @@ describe("OpenAIInstrumentation", () => {
430
436
  const [span1, span2, span3] = spans;
431
437
  expect(span1.name).toBe("OpenAI Chat Completions");
432
438
  expect(span1.attributes).toMatchInlineSnapshot(`
433
- {
434
- "input.mime_type": "application/json",
435
- "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}",
436
- "llm.input_messages.0.message.content": "How is the weather this week?",
437
- "llm.input_messages.0.message.role": "user",
438
- "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}",
439
- "llm.model_name": "gpt-3.5-turbo-0613",
440
- "llm.output_messages.0.message.role": "assistant",
441
- "llm.output_messages.0.message.tool_calls.0.tool_call.function.arguments": "{}",
442
- "llm.output_messages.0.message.tool_calls.0.tool_call.function.name": "getCurrentLocation",
443
- "llm.token_count.completion": 7,
444
- "llm.token_count.prompt": 70,
445
- "llm.token_count.total": 77,
446
- "openinference.span.kind": "LLM",
447
- "output.mime_type": "application/json",
448
- "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}",
449
- }
450
- `);
439
+ {
440
+ "input.mime_type": "application/json",
441
+ "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}",
442
+ "llm.input_messages.0.message.content": "How is the weather this week?",
443
+ "llm.input_messages.0.message.role": "user",
444
+ "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}",
445
+ "llm.model_name": "gpt-3.5-turbo-0613",
446
+ "llm.output_messages.0.message.role": "assistant",
447
+ "llm.output_messages.0.message.tool_calls.0.tool_call.function.arguments": "{}",
448
+ "llm.output_messages.0.message.tool_calls.0.tool_call.function.name": "getCurrentLocation",
449
+ "llm.provider": "openai",
450
+ "llm.system": "openai",
451
+ "llm.token_count.completion": 7,
452
+ "llm.token_count.prompt": 70,
453
+ "llm.token_count.total": 77,
454
+ "llm.tools.0.tool.json_schema": "{"type":"function","function":{"name":"getCurrentLocation","parameters":{"type":"object","properties":{}},"description":"Get the current location of the user."}}",
455
+ "llm.tools.1.tool.json_schema": "{"type":"function","function":{"name":"getWeather","parameters":{"type":"object","properties":{"location":{"type":"string"}}},"description":"Get the weather for a location."}}",
456
+ "openinference.span.kind": "LLM",
457
+ "output.mime_type": "application/json",
458
+ "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}",
459
+ }
460
+ `);
451
461
  expect(span2.name).toBe("OpenAI Chat Completions");
452
462
  expect(span2.attributes).toMatchInlineSnapshot(`
453
- {
454
- "input.mime_type": "application/json",
455
- "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}",
456
- "llm.input_messages.0.message.content": "How is the weather this week?",
457
- "llm.input_messages.0.message.role": "user",
458
- "llm.input_messages.1.message.role": "assistant",
459
- "llm.input_messages.1.message.tool_calls.0.tool_call.function.arguments": "{}",
460
- "llm.input_messages.1.message.tool_calls.0.tool_call.function.name": "getCurrentLocation",
461
- "llm.input_messages.2.message.content": "Boston",
462
- "llm.input_messages.2.message.role": "tool",
463
- "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}",
464
- "llm.model_name": "gpt-3.5-turbo-0613",
465
- "llm.output_messages.0.message.role": "assistant",
466
- "llm.output_messages.0.message.tool_calls.0.tool_call.function.arguments": "{
467
- "location": "Boston"
468
- }",
469
- "llm.output_messages.0.message.tool_calls.0.tool_call.function.name": "getWeather",
470
- "llm.token_count.completion": 15,
471
- "llm.token_count.prompt": 86,
472
- "llm.token_count.total": 101,
473
- "openinference.span.kind": "LLM",
474
- "output.mime_type": "application/json",
475
- "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}",
476
- }
477
- `);
463
+ {
464
+ "input.mime_type": "application/json",
465
+ "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":"{}","parsed_arguments":null}}],"parsed":null},{"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}",
466
+ "llm.input_messages.0.message.content": "How is the weather this week?",
467
+ "llm.input_messages.0.message.role": "user",
468
+ "llm.input_messages.1.message.role": "assistant",
469
+ "llm.input_messages.1.message.tool_calls.0.tool_call.function.arguments": "{}",
470
+ "llm.input_messages.1.message.tool_calls.0.tool_call.function.name": "getCurrentLocation",
471
+ "llm.input_messages.2.message.content": "Boston",
472
+ "llm.input_messages.2.message.role": "tool",
473
+ "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}",
474
+ "llm.model_name": "gpt-3.5-turbo-0613",
475
+ "llm.output_messages.0.message.role": "assistant",
476
+ "llm.output_messages.0.message.tool_calls.0.tool_call.function.arguments": "{
477
+ "location": "Boston"
478
+ }",
479
+ "llm.output_messages.0.message.tool_calls.0.tool_call.function.name": "getWeather",
480
+ "llm.provider": "openai",
481
+ "llm.system": "openai",
482
+ "llm.token_count.completion": 15,
483
+ "llm.token_count.prompt": 86,
484
+ "llm.token_count.total": 101,
485
+ "llm.tools.0.tool.json_schema": "{"type":"function","function":{"name":"getCurrentLocation","parameters":{"type":"object","properties":{}},"description":"Get the current location of the user."}}",
486
+ "llm.tools.1.tool.json_schema": "{"type":"function","function":{"name":"getWeather","parameters":{"type":"object","properties":{"location":{"type":"string"}}},"description":"Get the weather for a location."}}",
487
+ "openinference.span.kind": "LLM",
488
+ "output.mime_type": "application/json",
489
+ "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}",
490
+ }
491
+ `);
478
492
  expect(span3.name).toBe("OpenAI Chat Completions");
479
493
  expect(span3.attributes).toMatchInlineSnapshot(`
480
- {
481
- "input.mime_type": "application/json",
482
- "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}",
483
- "llm.input_messages.0.message.content": "How is the weather this week?",
484
- "llm.input_messages.0.message.role": "user",
485
- "llm.input_messages.1.message.role": "assistant",
486
- "llm.input_messages.1.message.tool_calls.0.tool_call.function.arguments": "{}",
487
- "llm.input_messages.1.message.tool_calls.0.tool_call.function.name": "getCurrentLocation",
488
- "llm.input_messages.2.message.content": "Boston",
489
- "llm.input_messages.2.message.role": "tool",
490
- "llm.input_messages.3.message.role": "assistant",
491
- "llm.input_messages.3.message.tool_calls.0.tool_call.function.arguments": "{
492
- "location": "Boston"
493
- }",
494
- "llm.input_messages.3.message.tool_calls.0.tool_call.function.name": "getWeather",
495
- "llm.input_messages.4.message.content": "{"temperature":52,"precipitation":"rainy"}",
496
- "llm.input_messages.4.message.role": "tool",
497
- "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}",
498
- "llm.model_name": "gpt-3.5-turbo-0613",
499
- "llm.output_messages.0.message.content": "The weather in Boston this week is expected to be rainy with a temperature of 52 degrees.",
500
- "llm.output_messages.0.message.role": "assistant",
501
- "llm.token_count.completion": 20,
502
- "llm.token_count.prompt": 121,
503
- "llm.token_count.total": 141,
504
- "openinference.span.kind": "LLM",
505
- "output.mime_type": "application/json",
506
- "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}",
507
- }
508
- `);
494
+ {
495
+ "input.mime_type": "application/json",
496
+ "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":"{}","parsed_arguments":null}}],"parsed":null},{"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}","parsed_arguments":null}}],"parsed":null},{"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}",
497
+ "llm.input_messages.0.message.content": "How is the weather this week?",
498
+ "llm.input_messages.0.message.role": "user",
499
+ "llm.input_messages.1.message.role": "assistant",
500
+ "llm.input_messages.1.message.tool_calls.0.tool_call.function.arguments": "{}",
501
+ "llm.input_messages.1.message.tool_calls.0.tool_call.function.name": "getCurrentLocation",
502
+ "llm.input_messages.2.message.content": "Boston",
503
+ "llm.input_messages.2.message.role": "tool",
504
+ "llm.input_messages.3.message.role": "assistant",
505
+ "llm.input_messages.3.message.tool_calls.0.tool_call.function.arguments": "{
506
+ "location": "Boston"
507
+ }",
508
+ "llm.input_messages.3.message.tool_calls.0.tool_call.function.name": "getWeather",
509
+ "llm.input_messages.4.message.content": "{"temperature":52,"precipitation":"rainy"}",
510
+ "llm.input_messages.4.message.role": "tool",
511
+ "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}",
512
+ "llm.model_name": "gpt-3.5-turbo-0613",
513
+ "llm.output_messages.0.message.content": "The weather in Boston this week is expected to be rainy with a temperature of 52 degrees.",
514
+ "llm.output_messages.0.message.role": "assistant",
515
+ "llm.provider": "openai",
516
+ "llm.system": "openai",
517
+ "llm.token_count.completion": 20,
518
+ "llm.token_count.prompt": 121,
519
+ "llm.token_count.total": 141,
520
+ "llm.tools.0.tool.json_schema": "{"type":"function","function":{"name":"getCurrentLocation","parameters":{"type":"object","properties":{}},"description":"Get the current location of the user."}}",
521
+ "llm.tools.1.tool.json_schema": "{"type":"function","function":{"name":"getWeather","parameters":{"type":"object","properties":{"location":{"type":"string"}}},"description":"Get the weather for a location."}}",
522
+ "openinference.span.kind": "LLM",
523
+ "output.mime_type": "application/json",
524
+ "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}",
525
+ }
526
+ `);
509
527
  }));
510
528
  it("should capture tool calls with streaming", () => __awaiter(void 0, void 0, void 0, function* () {
511
529
  var _a, e_2, _b, _c;
@@ -640,6 +658,10 @@ describe("OpenAIInstrumentation", () => {
640
658
  "llm.output_messages.0.message.role": "assistant",
641
659
  "llm.output_messages.0.message.tool_calls.0.tool_call.function.arguments": "{}",
642
660
  "llm.output_messages.0.message.tool_calls.0.tool_call.function.name": "getWeather",
661
+ "llm.provider": "openai",
662
+ "llm.system": "openai",
663
+ "llm.tools.0.tool.json_schema": "{"type":"function","function":{"name":"getCurrentLocation","parameters":{"type":"object","properties":{}},"description":"Get the current location of the user."}}",
664
+ "llm.tools.1.tool.json_schema": "{"type":"function","function":{"name":"getWeather","description":"Get the weather for a location.","parameters":{"type":"object","properties":{"location":{"type":"string"}}}}}",
643
665
  "openinference.span.kind": "LLM",
644
666
  "output.mime_type": "text/plain",
645
667
  "output.value": "",
@@ -753,22 +775,24 @@ describe("OpenAIInstrumentation", () => {
753
775
  const span = spans[0];
754
776
  expect(span.name).toBe("OpenAI Chat Completions");
755
777
  expect(span.attributes).toMatchInlineSnapshot(`
756
- {
757
- "input.mime_type": "application/json",
758
- "input.value": "{"messages":[{"role":"user","content":"What's the weather today?"}],"model":"gpt-3.5-turbo","functions":[{"name":"getWeather","description":"Get the weather for a location.","parameters":{"type":"object","properties":{"location":{"type":"string"}}}},{"name":"getCurrentLocation","description":"Get the current location of the user.","parameters":{"type":"object","properties":{}}}],"stream":true}",
759
- "llm.input_messages.0.message.content": "What's the weather today?",
760
- "llm.input_messages.0.message.role": "user",
761
- "llm.invocation_parameters": "{"model":"gpt-3.5-turbo","functions":[{"name":"getWeather","description":"Get the weather for a location.","parameters":{"type":"object","properties":{"location":{"type":"string"}}}},{"name":"getCurrentLocation","description":"Get the current location of the user.","parameters":{"type":"object","properties":{}}}],"stream":true}",
762
- "llm.model_name": "gpt-3.5-turbo",
763
- "llm.output_messages.0.message.content": "",
764
- "llm.output_messages.0.message.function_call_arguments_json": "{}",
765
- "llm.output_messages.0.message.function_call_name": "getWeather",
766
- "llm.output_messages.0.message.role": "assistant",
767
- "openinference.span.kind": "LLM",
768
- "output.mime_type": "text/plain",
769
- "output.value": "",
770
- }
771
- `);
778
+ {
779
+ "input.mime_type": "application/json",
780
+ "input.value": "{"messages":[{"role":"user","content":"What's the weather today?"}],"model":"gpt-3.5-turbo","functions":[{"name":"getWeather","description":"Get the weather for a location.","parameters":{"type":"object","properties":{"location":{"type":"string"}}}},{"name":"getCurrentLocation","description":"Get the current location of the user.","parameters":{"type":"object","properties":{}}}],"stream":true}",
781
+ "llm.input_messages.0.message.content": "What's the weather today?",
782
+ "llm.input_messages.0.message.role": "user",
783
+ "llm.invocation_parameters": "{"model":"gpt-3.5-turbo","functions":[{"name":"getWeather","description":"Get the weather for a location.","parameters":{"type":"object","properties":{"location":{"type":"string"}}}},{"name":"getCurrentLocation","description":"Get the current location of the user.","parameters":{"type":"object","properties":{}}}],"stream":true}",
784
+ "llm.model_name": "gpt-3.5-turbo",
785
+ "llm.output_messages.0.message.content": "",
786
+ "llm.output_messages.0.message.function_call_arguments_json": "{}",
787
+ "llm.output_messages.0.message.function_call_name": "getWeather",
788
+ "llm.output_messages.0.message.role": "assistant",
789
+ "llm.provider": "openai",
790
+ "llm.system": "openai",
791
+ "openinference.span.kind": "LLM",
792
+ "output.mime_type": "text/plain",
793
+ "output.value": "",
794
+ }
795
+ `);
772
796
  }));
773
797
  it("should not emit a span if tracing is suppressed", () => __awaiter(void 0, void 0, void 0, function* () {
774
798
  const response = {
@@ -861,26 +885,28 @@ describe("OpenAIInstrumentation", () => {
861
885
  const span = spans[0];
862
886
  expect(span.name).toBe("OpenAI Chat Completions");
863
887
  expect(span.attributes).toMatchInlineSnapshot(`
864
- {
865
- "input.mime_type": "application/json",
866
- "input.value": "{"messages":[{"role":"user","content":[{"type":"text","text":"Say this is a test"},{"type":"image_url","image_url":{"url":"data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="}}]}],"model":"gpt-3.5-turbo"}",
867
- "llm.input_messages.0.message.contents.0.message_content.text": "Say this is a test",
868
- "llm.input_messages.0.message.contents.0.message_content.type": "text",
869
- "llm.input_messages.0.message.contents.1.message_content.image": "data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",
870
- "llm.input_messages.0.message.contents.1.message_content.type": "image",
871
- "llm.input_messages.0.message.role": "user",
872
- "llm.invocation_parameters": "{"model":"gpt-3.5-turbo"}",
873
- "llm.model_name": "gpt-3.5-turbo-0613",
874
- "llm.output_messages.0.message.content": "This is a test.",
875
- "llm.output_messages.0.message.role": "assistant",
876
- "llm.token_count.completion": 5,
877
- "llm.token_count.prompt": 12,
878
- "llm.token_count.total": 17,
879
- "openinference.span.kind": "LLM",
880
- "output.mime_type": "application/json",
881
- "output.value": "{"id":"chatcmpl-8adq9JloOzNZ9TyuzrKyLpGXexh6p","object":"chat.completion","created":1703743645,"model":"gpt-3.5-turbo-0613","choices":[{"index":0,"message":{"role":"assistant","content":"This is a test."},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":12,"completion_tokens":5,"total_tokens":17}}",
882
- }
883
- `);
888
+ {
889
+ "input.mime_type": "application/json",
890
+ "input.value": "{"messages":[{"role":"user","content":[{"type":"text","text":"Say this is a test"},{"type":"image_url","image_url":{"url":"data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="}}]}],"model":"gpt-3.5-turbo"}",
891
+ "llm.input_messages.0.message.contents.0.message_content.text": "Say this is a test",
892
+ "llm.input_messages.0.message.contents.0.message_content.type": "text",
893
+ "llm.input_messages.0.message.contents.1.message_content.image": "data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",
894
+ "llm.input_messages.0.message.contents.1.message_content.type": "image",
895
+ "llm.input_messages.0.message.role": "user",
896
+ "llm.invocation_parameters": "{"model":"gpt-3.5-turbo"}",
897
+ "llm.model_name": "gpt-3.5-turbo-0613",
898
+ "llm.output_messages.0.message.content": "This is a test.",
899
+ "llm.output_messages.0.message.role": "assistant",
900
+ "llm.provider": "openai",
901
+ "llm.system": "openai",
902
+ "llm.token_count.completion": 5,
903
+ "llm.token_count.prompt": 12,
904
+ "llm.token_count.total": 17,
905
+ "openinference.span.kind": "LLM",
906
+ "output.mime_type": "application/json",
907
+ "output.value": "{"id":"chatcmpl-8adq9JloOzNZ9TyuzrKyLpGXexh6p","object":"chat.completion","created":1703743645,"model":"gpt-3.5-turbo-0613","choices":[{"index":0,"message":{"role":"assistant","content":"This is a test."},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":12,"completion_tokens":5,"total_tokens":17}}",
908
+ }
909
+ `);
884
910
  }));
885
911
  });
886
912
  //# sourceMappingURL=openai.test.js.map