@ai-sdk/otel 1.0.165 → 1.0.168

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": "@ai-sdk/otel",
3
- "version": "1.0.165",
3
+ "version": "1.0.168",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -28,10 +28,10 @@
28
28
  "dependencies": {
29
29
  "@ai-sdk/provider": "4.0.37",
30
30
  "@opentelemetry/api": "1.9.1",
31
- "ai": "7.0.165"
31
+ "ai": "7.0.168"
32
32
  },
33
33
  "devDependencies": {
34
- "@ai-sdk/provider-utils": "5.0.76",
34
+ "@ai-sdk/provider-utils": "5.0.78",
35
35
  "@opentelemetry/sdk-metrics": "2.8.0",
36
36
  "@opentelemetry/sdk-trace-base": "2.7.1",
37
37
  "@types/node": "22.19.19",
@@ -23,7 +23,7 @@ type LanguageModelV4ContentPart =
23
23
  | LanguageModelV4ToolResultPart
24
24
  | LanguageModelV4ToolApprovalResponsePart;
25
25
 
26
- type SemConvPart =
26
+ export type SemConvPart =
27
27
  | { type: 'text'; content: string }
28
28
  | { type: 'reasoning'; content: string }
29
29
  | {
@@ -45,18 +45,18 @@ type SemConvPart =
45
45
  }
46
46
  | { type: string; [key: string]: unknown };
47
47
 
48
- interface SemConvInputMessage {
48
+ export interface SemConvInputMessage {
49
49
  role: string;
50
50
  parts: SemConvPart[];
51
51
  }
52
52
 
53
- interface SemConvOutputMessage {
53
+ export interface SemConvOutputMessage {
54
54
  role: string;
55
55
  parts: SemConvPart[];
56
56
  finish_reason: string;
57
57
  }
58
58
 
59
- interface SemConvSystemInstruction {
59
+ export interface SemConvSystemInstruction {
60
60
  type: string;
61
61
  content?: string;
62
62
  [key: string]: unknown;
package/src/index.ts CHANGED
@@ -1,4 +1,17 @@
1
1
  export { OpenTelemetryIdGenerator } from './durable-span-ids';
2
+ export {
3
+ formatInputMessages,
4
+ formatModelMessages,
5
+ formatObjectOutputMessages,
6
+ formatOutputMessages,
7
+ formatSystemInstructions,
8
+ } from './gen-ai-format-messages';
9
+ export type {
10
+ SemConvInputMessage,
11
+ SemConvOutputMessage,
12
+ SemConvPart,
13
+ SemConvSystemInstruction,
14
+ } from './gen-ai-format-messages';
2
15
  export { OpenTelemetry } from './open-telemetry';
3
16
  export type {
4
17
  EnrichSpan,
@@ -1,3 +1,4 @@
1
+ import { redactToolDefinition } from './redact-tool-definition';
1
2
  import type { LanguageModelV4Prompt } from '@ai-sdk/provider';
2
3
  import type { Context as AISDKContext } from '@ai-sdk/provider-utils';
3
4
  import {
@@ -50,7 +51,6 @@ import type {
50
51
  import { assembleOperationName } from './assemble-operation-name';
51
52
  import { getBaseTelemetryAttributes } from './get-base-telemetry-attributes';
52
53
  import { getProviderUsageAttributes } from './provider-usage-attributes';
53
- import { redactToolDefinition } from './redact-tool-definition';
54
54
  import { sanitizeAttributeValue } from './sanitize-attribute-value';
55
55
  import {
56
56
  stringifyForTelemetry,
@@ -1,3 +1,4 @@
1
+ import { redactToolDefinition } from './redact-tool-definition';
1
2
  import {
2
3
  context,
3
4
  metrics,
@@ -60,7 +61,6 @@ import {
60
61
  } from './gen-ai-format-messages';
61
62
  import { stringifyDecisionStateForTelemetry } from './stringify-for-telemetry';
62
63
  import { recordErrorOnSpan } from './record-span';
63
- import { redactToolDefinition } from './redact-tool-definition';
64
64
  import { getProviderUsageAttributes } from './provider-usage-attributes';
65
65
  import { getServerAttributes } from './server-attributes';
66
66
  import { sanitizeAttributes } from './sanitize-attribute-value';
@@ -1,4 +1,8 @@
1
- /** Remove provider credentials from a telemetry-only copy of a tool definition. */
1
+ /**
2
+ * Preserve exporter protection for older providers and plain tool definitions
3
+ * whose arguments do not carry a provider-owned telemetry redaction annotation.
4
+ * Only create telemetry copies; never modify the provider's arguments.
5
+ */
2
6
  export function redactToolDefinition(
3
7
  tool: Record<string, unknown>,
4
8
  ): Record<string, unknown> {