@arizeai/openinference-instrumentation-openai 4.4.2 → 4.4.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arizeai/openinference-instrumentation-openai",
3
- "version": "4.4.2",
3
+ "version": "4.4.4",
4
4
  "private": false,
5
5
  "description": "OpenInference instrumentation for OpenAI",
6
6
  "keywords": [],
@@ -28,8 +28,8 @@
28
28
  "@opentelemetry/api": "^1.9.0",
29
29
  "@opentelemetry/core": "^2.8.0",
30
30
  "@opentelemetry/instrumentation": "^0.46.0",
31
- "@arizeai/openinference-core": "2.8.1",
32
- "@arizeai/openinference-semantic-conventions": "2.15.0"
31
+ "@arizeai/openinference-core": "2.8.2",
32
+ "@arizeai/openinference-semantic-conventions": "2.16.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@opentelemetry/exporter-trace-otlp-proto": "^0.50.0",
@@ -87,6 +87,7 @@ export const HOST_SUFFIX_TO_PROVIDER: Record<string, LLMProvider> = {
87
87
  "api.minimaxi.com": LLMProvider.MINIMAX,
88
88
  "api.minimax.chat": LLMProvider.MINIMAX,
89
89
  "oci.oraclecloud.com": LLMProvider.ORACLE,
90
+ "ml.cloud.ibm.com": LLMProvider.IBM,
90
91
  };
91
92
 
92
93
  /**
@@ -556,7 +557,11 @@ export class OpenAIInstrumentation extends InstrumentationBase<typeof openai> {
556
557
  ...getResponsesOutputMessagesAttributes(result),
557
558
  ...getResponsesUsageAttributes(result),
558
559
  });
559
- span.setStatus({ code: SpanStatusCode.OK });
560
+ span.setStatus(
561
+ result.status === "failed"
562
+ ? { code: SpanStatusCode.ERROR, message: result.error?.message }
563
+ : { code: SpanStatusCode.OK },
564
+ );
560
565
  span.end();
561
566
  };
562
567
  if (isResponseCreateResponse(result)) {
@@ -255,7 +255,11 @@ export async function consumeResponseStreamEvents(
255
255
 
256
256
  for await (const event of stream) {
257
257
  switch (event.type) {
258
- case "response.completed": {
258
+ // A stream can end on any of these; the incomplete and failed ones still carry the
259
+ // partial output and the usage.
260
+ case "response.completed":
261
+ case "response.incomplete":
262
+ case "response.failed": {
259
263
  response = event.response;
260
264
  break;
261
265
  }
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // this is an auto-generated file. see js/scripts/version-update.js
2
- export const VERSION = "4.4.2";
2
+ export const VERSION = "4.4.4";