@llmops/sdk 0.6.1-beta.1 → 0.6.1-beta.2

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.
@@ -83,6 +83,10 @@ type GenerationSpanData = {
83
83
  type ResponseSpanData = {
84
84
  type: 'response';
85
85
  response_id?: string;
86
+ /** Input messages — provided by @openai/agents for non-OpenAI tracing providers */
87
+ _input?: unknown;
88
+ /** Full API response object (includes usage, model, output) */
89
+ _response?: Record<string, unknown>;
86
90
  [key: string]: unknown;
87
91
  };
88
92
  type HandoffSpanData = {
@@ -83,6 +83,10 @@ type GenerationSpanData = {
83
83
  type ResponseSpanData = {
84
84
  type: 'response';
85
85
  response_id?: string;
86
+ /** Input messages — provided by @openai/agents for non-OpenAI tracing providers */
87
+ _input?: unknown;
88
+ /** Full API response object (includes usage, model, output) */
89
+ _response?: Record<string, unknown>;
86
90
  [key: string]: unknown;
87
91
  };
88
92
  type HandoffSpanData = {
@@ -38,7 +38,10 @@ function deriveSpanName(data) {
38
38
  case "agent": return `Agent: ${data.name}`;
39
39
  case "function": return `Tool: ${data.name}`;
40
40
  case "generation": return data.model ? `Generation: ${data.model}` : "Generation";
41
- case "response": return "Response";
41
+ case "response": {
42
+ const model = data._response?.model;
43
+ return typeof model === "string" ? `Response: ${model}` : "Response";
44
+ }
42
45
  case "handoff": return `Handoff: ${data.from_agent ?? "?"} → ${data.to_agent ?? "?"}`;
43
46
  case "guardrail": return `Guardrail: ${data.name}`;
44
47
  case "custom": return `Custom: ${data.name}`;
@@ -87,10 +90,23 @@ function convertSpanDataToAttributes(data, error) {
87
90
  attrs.push(kv("llmops.guardrail.action", data.triggered ? "triggered" : "passed"));
88
91
  attrs.push(kv("openai.agents.guardrail.name", data.name));
89
92
  break;
90
- case "response":
93
+ case "response": {
91
94
  attrs.push(kv("gen_ai.operation.name", "chat"));
92
95
  if (data.response_id) attrs.push(kv("openai.agents.response.id", data.response_id));
96
+ const resp = data._response;
97
+ if (resp) {
98
+ if (typeof resp.model === "string") {
99
+ attrs.push(kv("gen_ai.request.model", resp.model));
100
+ attrs.push(kv("gen_ai.system", "openai"));
101
+ }
102
+ const usage = resp.usage;
103
+ if (usage?.input_tokens != null) attrs.push(kv("gen_ai.usage.input_tokens", usage.input_tokens));
104
+ if (usage?.output_tokens != null) attrs.push(kv("gen_ai.usage.output_tokens", usage.output_tokens));
105
+ if (resp.output != null) attrs.push(kv("gen_ai.completion", JSON.stringify(resp.output)));
106
+ }
107
+ if (data._input != null) attrs.push(kv("ai.prompt.messages", JSON.stringify(data._input)));
93
108
  break;
109
+ }
94
110
  case "custom":
95
111
  attrs.push(kv("openai.agents.custom.name", data.name));
96
112
  attrs.push(kv("openai.agents.custom.data", JSON.stringify(data.data)));
@@ -37,7 +37,10 @@ function deriveSpanName(data) {
37
37
  case "agent": return `Agent: ${data.name}`;
38
38
  case "function": return `Tool: ${data.name}`;
39
39
  case "generation": return data.model ? `Generation: ${data.model}` : "Generation";
40
- case "response": return "Response";
40
+ case "response": {
41
+ const model = data._response?.model;
42
+ return typeof model === "string" ? `Response: ${model}` : "Response";
43
+ }
41
44
  case "handoff": return `Handoff: ${data.from_agent ?? "?"} → ${data.to_agent ?? "?"}`;
42
45
  case "guardrail": return `Guardrail: ${data.name}`;
43
46
  case "custom": return `Custom: ${data.name}`;
@@ -86,10 +89,23 @@ function convertSpanDataToAttributes(data, error) {
86
89
  attrs.push(kv("llmops.guardrail.action", data.triggered ? "triggered" : "passed"));
87
90
  attrs.push(kv("openai.agents.guardrail.name", data.name));
88
91
  break;
89
- case "response":
92
+ case "response": {
90
93
  attrs.push(kv("gen_ai.operation.name", "chat"));
91
94
  if (data.response_id) attrs.push(kv("openai.agents.response.id", data.response_id));
95
+ const resp = data._response;
96
+ if (resp) {
97
+ if (typeof resp.model === "string") {
98
+ attrs.push(kv("gen_ai.request.model", resp.model));
99
+ attrs.push(kv("gen_ai.system", "openai"));
100
+ }
101
+ const usage = resp.usage;
102
+ if (usage?.input_tokens != null) attrs.push(kv("gen_ai.usage.input_tokens", usage.input_tokens));
103
+ if (usage?.output_tokens != null) attrs.push(kv("gen_ai.usage.output_tokens", usage.output_tokens));
104
+ if (resp.output != null) attrs.push(kv("gen_ai.completion", JSON.stringify(resp.output)));
105
+ }
106
+ if (data._input != null) attrs.push(kv("ai.prompt.messages", JSON.stringify(data._input)));
92
107
  break;
108
+ }
93
109
  case "custom":
94
110
  attrs.push(kv("openai.agents.custom.name", data.name));
95
111
  attrs.push(kv("openai.agents.custom.data", JSON.stringify(data.data)));
package/dist/agents.cjs CHANGED
@@ -1,3 +1,3 @@
1
- const require_agents_exporter = require('./agents-exporter-Ct3l12qS.cjs');
1
+ const require_agents_exporter = require('./agents-exporter-C0mNajZs.cjs');
2
2
 
3
3
  exports.createLLMOpsAgentsExporter = require_agents_exporter.createLLMOpsAgentsExporter;
package/dist/agents.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as AgentsTracingExporter, i as AgentsTrace, n as AgentsSpanData, o as LLMOpsAgentsExporterConfig, r as AgentsSpanError, s as createLLMOpsAgentsExporter, t as AgentsSpan } from "./agents-exporter-DvECkYQd.cjs";
1
+ import { a as AgentsTracingExporter, i as AgentsTrace, n as AgentsSpanData, o as LLMOpsAgentsExporterConfig, r as AgentsSpanError, s as createLLMOpsAgentsExporter, t as AgentsSpan } from "./agents-exporter-B-ADoC7t.cjs";
2
2
  export { AgentsSpan, AgentsSpanData, AgentsSpanError, AgentsTrace, AgentsTracingExporter, LLMOpsAgentsExporterConfig, createLLMOpsAgentsExporter };
package/dist/agents.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as AgentsTracingExporter, i as AgentsTrace, n as AgentsSpanData, o as LLMOpsAgentsExporterConfig, r as AgentsSpanError, s as createLLMOpsAgentsExporter, t as AgentsSpan } from "./agents-exporter-DIoxRgjd.mjs";
1
+ import { a as AgentsTracingExporter, i as AgentsTrace, n as AgentsSpanData, o as LLMOpsAgentsExporterConfig, r as AgentsSpanError, s as createLLMOpsAgentsExporter, t as AgentsSpan } from "./agents-exporter-BZjfVkaH.mjs";
2
2
  export { AgentsSpan, AgentsSpanData, AgentsSpanError, AgentsTrace, AgentsTracingExporter, LLMOpsAgentsExporterConfig, createLLMOpsAgentsExporter };
package/dist/agents.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { t as createLLMOpsAgentsExporter } from "./agents-exporter-BorGCb93.mjs";
1
+ import { t as createLLMOpsAgentsExporter } from "./agents-exporter-vcQaaBwp.mjs";
2
2
 
3
3
  export { createLLMOpsAgentsExporter };
@@ -1,4 +1,4 @@
1
- import "./agents-exporter-DvECkYQd.cjs";
2
- import "./index-D49MVTAo.cjs";
3
- import { t as createLLMOpsMiddleware } from "./index-DVTO0Hbl.cjs";
1
+ import "./agents-exporter-B-ADoC7t.cjs";
2
+ import "./index-Dtp5Lgj8.cjs";
3
+ import { t as createLLMOpsMiddleware } from "./index-Chr-puA7.cjs";
4
4
  export { createLLMOpsMiddleware };
@@ -1,4 +1,4 @@
1
- import "./agents-exporter-DIoxRgjd.mjs";
2
- import "./index-CelQx4B3.mjs";
3
- import { t as createLLMOpsMiddleware } from "./index-CmC2x4dU.mjs";
1
+ import "./agents-exporter-BZjfVkaH.mjs";
2
+ import "./index-C1cyvMt2.mjs";
3
+ import { t as createLLMOpsMiddleware } from "./index-CRUhyzzA.mjs";
4
4
  export { createLLMOpsMiddleware };
package/dist/hono.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import "./agents-exporter-DvECkYQd.cjs";
2
- import { t as LLMOpsClient } from "./index-D49MVTAo.cjs";
1
+ import "./agents-exporter-B-ADoC7t.cjs";
2
+ import { t as LLMOpsClient } from "./index-Dtp5Lgj8.cjs";
3
3
  import { MiddlewareHandler } from "hono";
4
4
 
5
5
  //#region src/lib/hono/index.d.ts
package/dist/hono.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import "./agents-exporter-DIoxRgjd.mjs";
2
- import { t as LLMOpsClient } from "./index-CelQx4B3.mjs";
1
+ import "./agents-exporter-BZjfVkaH.mjs";
2
+ import { t as LLMOpsClient } from "./index-C1cyvMt2.mjs";
3
3
  import { MiddlewareHandler } from "hono";
4
4
 
5
5
  //#region src/lib/hono/index.d.ts
@@ -1,4 +1,4 @@
1
- import { a as AgentsTracingExporter } from "./agents-exporter-DIoxRgjd.mjs";
1
+ import { a as AgentsTracingExporter } from "./agents-exporter-BZjfVkaH.mjs";
2
2
  import { LLMOpsConfig, ValidatedLLMOpsConfig } from "@llmops/core";
3
3
 
4
4
  //#region src/client/index.d.ts
@@ -1,4 +1,4 @@
1
- import { t as LLMOpsClient } from "./index-CelQx4B3.mjs";
1
+ import { t as LLMOpsClient } from "./index-C1cyvMt2.mjs";
2
2
  import { NextFunction, Request, Response } from "express";
3
3
 
4
4
  //#region src/lib/express/index.d.ts
@@ -1,4 +1,4 @@
1
- import { t as LLMOpsClient } from "./index-D49MVTAo.cjs";
1
+ import { t as LLMOpsClient } from "./index-Dtp5Lgj8.cjs";
2
2
  import { NextFunction, Request, Response } from "express";
3
3
 
4
4
  //#region src/lib/express/index.d.ts
@@ -1,4 +1,4 @@
1
- import { a as AgentsTracingExporter } from "./agents-exporter-DvECkYQd.cjs";
1
+ import { a as AgentsTracingExporter } from "./agents-exporter-B-ADoC7t.cjs";
2
2
  import { LLMOpsConfig, ValidatedLLMOpsConfig } from "@llmops/core";
3
3
 
4
4
  //#region src/client/index.d.ts
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  const require_express = require('./express-B-wbCza5.cjs');
2
- const require_agents_exporter = require('./agents-exporter-Ct3l12qS.cjs');
2
+ const require_agents_exporter = require('./agents-exporter-C0mNajZs.cjs');
3
3
  let __llmops_core = require("@llmops/core");
4
4
  let __llmops_app = require("@llmops/app");
5
5
 
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- import { a as AgentsTracingExporter, o as LLMOpsAgentsExporterConfig, s as createLLMOpsAgentsExporter } from "./agents-exporter-DvECkYQd.cjs";
2
- import { i as createLLMOps, n as ProviderOptions, r as TraceContext, t as LLMOpsClient } from "./index-D49MVTAo.cjs";
3
- import { t as createLLMOpsMiddleware } from "./index-DVTO0Hbl.cjs";
1
+ import { a as AgentsTracingExporter, o as LLMOpsAgentsExporterConfig, s as createLLMOpsAgentsExporter } from "./agents-exporter-B-ADoC7t.cjs";
2
+ import { i as createLLMOps, n as ProviderOptions, r as TraceContext, t as LLMOpsClient } from "./index-Dtp5Lgj8.cjs";
3
+ import { t as createLLMOpsMiddleware } from "./index-Chr-puA7.cjs";
4
4
 
5
5
  //#region src/lib/auth/client.d.ts
6
6
 
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { a as AgentsTracingExporter, o as LLMOpsAgentsExporterConfig, s as createLLMOpsAgentsExporter } from "./agents-exporter-DIoxRgjd.mjs";
2
- import { i as createLLMOps, n as ProviderOptions, r as TraceContext, t as LLMOpsClient } from "./index-CelQx4B3.mjs";
3
- import { t as createLLMOpsMiddleware } from "./index-CmC2x4dU.mjs";
1
+ import { a as AgentsTracingExporter, o as LLMOpsAgentsExporterConfig, s as createLLMOpsAgentsExporter } from "./agents-exporter-BZjfVkaH.mjs";
2
+ import { i as createLLMOps, n as ProviderOptions, r as TraceContext, t as LLMOpsClient } from "./index-C1cyvMt2.mjs";
3
+ import { t as createLLMOpsMiddleware } from "./index-CRUhyzzA.mjs";
4
4
 
5
5
  //#region src/lib/auth/client.d.ts
6
6
 
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as createLLMOpsMiddleware } from "./express-ClEIbLM9.mjs";
2
- import { t as createLLMOpsAgentsExporter } from "./agents-exporter-BorGCb93.mjs";
2
+ import { t as createLLMOpsAgentsExporter } from "./agents-exporter-vcQaaBwp.mjs";
3
3
  import { LLMOPS_INTERNAL_HEADER, LLMOPS_SPAN_NAME_HEADER, LLMOPS_TRACE_ID_HEADER, LLMOPS_TRACE_NAME_HEADER } from "@llmops/core";
4
4
  import { createApp } from "@llmops/app";
5
5
 
package/dist/nextjs.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import "./agents-exporter-DvECkYQd.cjs";
2
- import { t as LLMOpsClient } from "./index-D49MVTAo.cjs";
1
+ import "./agents-exporter-B-ADoC7t.cjs";
2
+ import { t as LLMOpsClient } from "./index-Dtp5Lgj8.cjs";
3
3
 
4
4
  //#region src/lib/nextjs/index.d.ts
5
5
  declare function toNextJsHandler(client: LLMOpsClient): {
package/dist/nextjs.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import "./agents-exporter-DIoxRgjd.mjs";
2
- import { t as LLMOpsClient } from "./index-CelQx4B3.mjs";
1
+ import "./agents-exporter-BZjfVkaH.mjs";
2
+ import { t as LLMOpsClient } from "./index-C1cyvMt2.mjs";
3
3
 
4
4
  //#region src/lib/nextjs/index.d.ts
5
5
  declare function toNextJsHandler(client: LLMOpsClient): {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llmops/sdk",
3
- "version": "0.6.1-beta.1",
3
+ "version": "0.6.1-beta.2",
4
4
  "description": "An LLMOps toolkit for TypeScript applications",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -84,8 +84,8 @@
84
84
  "access": "public"
85
85
  },
86
86
  "dependencies": {
87
- "@llmops/app": "^0.6.1-beta.1",
88
- "@llmops/core": "^0.6.1-beta.1"
87
+ "@llmops/app": "^0.6.1-beta.2",
88
+ "@llmops/core": "^0.6.1-beta.2"
89
89
  },
90
90
  "devDependencies": {
91
91
  "@types/express": "^5.0.6",