@arizeai/phoenix-client 6.12.2 → 6.13.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arizeai/phoenix-client",
3
- "version": "6.12.2",
3
+ "version": "6.13.0",
4
4
  "description": "A client for the Phoenix API",
5
5
  "keywords": [
6
6
  "arize",
@@ -101,24 +101,24 @@
101
101
  "openapi-fetch": "^0.17.0",
102
102
  "tiny-invariant": "^1.3.3",
103
103
  "zod": "^4.4.3",
104
- "@arizeai/phoenix-config": "0.3.0",
105
- "@arizeai/phoenix-otel": "1.1.1"
104
+ "@arizeai/phoenix-otel": "1.2.0",
105
+ "@arizeai/phoenix-config": "0.4.0"
106
106
  },
107
107
  "devDependencies": {
108
- "@ai-sdk/openai": "^3.0.80",
109
- "@anthropic-ai/sdk": "^0.102.0",
108
+ "@ai-sdk/openai": "^3.0.83",
109
+ "@anthropic-ai/sdk": "^0.111.0",
110
110
  "@opentelemetry/api": "^1.9.1",
111
111
  "@opentelemetry/sdk-trace-node": "^2.9.0",
112
112
  "@types/async": "^3.2.25",
113
- "@types/node": "^25.9.4",
114
- "ai": "^6.0.219",
115
- "dotenv": "^16.6.1",
116
- "jest": "^29.7.0",
117
- "openai": "^6.45.0",
113
+ "@types/node": "^26.1.1",
114
+ "ai": "^6.0.222",
115
+ "dotenv": "^17.4.2",
116
+ "jest": "^30.4.2",
117
+ "openai": "^6.46.0",
118
118
  "openapi-typescript": "^7.13.0",
119
- "tsx": "^4.22.5",
120
- "vitest": "^4.1.9",
121
- "@arizeai/phoenix-evals": "1.1.0"
119
+ "tsx": "^4.23.0",
120
+ "vitest": "^4.1.10",
121
+ "@arizeai/phoenix-evals": "1.2.0"
122
122
  },
123
123
  "peerDependencies": {
124
124
  "@anthropic-ai/sdk": "^0.35.0",
@@ -1679,9 +1679,15 @@ export interface components {
1679
1679
  * @description Wire schema for the chat stream's `message_metadata` payload.
1680
1680
  */
1681
1681
  AssistantMessageMetadata: {
1682
+ /**
1683
+ * @description discriminator enum property added by openapi-typescript
1684
+ * @enum {string}
1685
+ */
1686
+ type: "assistant";
1682
1687
  /** Sessionid */
1683
1688
  sessionId: string;
1684
1689
  trace?: components["schemas"]["AssistantMessageMetadataTraceIds"] | null;
1690
+ turnTraceContext?: components["schemas"]["TurnTraceContext"] | null;
1685
1691
  usage?: components["schemas"]["AssistantMessageMetadataUsage"] | null;
1686
1692
  };
1687
1693
  /** AssistantMessageMetadataTraceIds */
@@ -1712,22 +1718,6 @@ export interface components {
1712
1718
  /** Total */
1713
1719
  total: number;
1714
1720
  };
1715
- /**
1716
- * AssistantMetadataUIMessage
1717
- * @description `UIMessage` with `metadata` narrowed to `AssistantMessageMetadata`.
1718
- */
1719
- AssistantMetadataUIMessage: {
1720
- /** Id */
1721
- id: string;
1722
- /**
1723
- * Role
1724
- * @enum {string}
1725
- */
1726
- role: "system" | "user" | "assistant";
1727
- metadata?: components["schemas"]["AssistantMessageMetadata"] | null;
1728
- /** Parts */
1729
- parts: (components["schemas"]["TextUIPart"] | components["schemas"]["ReasoningUIPart"] | components["schemas"]["ToolInputStreamingPart"] | components["schemas"]["ToolInputAvailablePart"] | components["schemas"]["ToolOutputAvailablePart"] | components["schemas"]["ToolOutputErrorPart"] | components["schemas"]["ToolApprovalRequestedPart"] | components["schemas"]["ToolApprovalRespondedPart"] | components["schemas"]["ToolOutputDeniedPart"] | components["schemas"]["DynamicToolInputStreamingPart"] | components["schemas"]["DynamicToolInputAvailablePart"] | components["schemas"]["DynamicToolOutputAvailablePart"] | components["schemas"]["DynamicToolOutputErrorPart"] | components["schemas"]["DynamicToolApprovalRequestedPart"] | components["schemas"]["DynamicToolApprovalRespondedPart"] | components["schemas"]["DynamicToolOutputDeniedPart"] | components["schemas"]["SourceUrlUIPart"] | components["schemas"]["SourceDocumentUIPart"] | components["schemas"]["FileUIPart"] | components["schemas"]["DataUIPart"] | components["schemas"]["StepStartUIPart"])[];
1730
- };
1731
1721
  /**
1732
1722
  * BuiltInProviderModelSelection
1733
1723
  * @description Chat against a Phoenix built-in provider.
@@ -1810,7 +1800,7 @@ export interface components {
1810
1800
  /** Id */
1811
1801
  id: string;
1812
1802
  /** Messages */
1813
- messages: components["schemas"]["AssistantMetadataUIMessage"][];
1803
+ messages: components["schemas"]["PhoenixUIMessage"][];
1814
1804
  /** Messageid */
1815
1805
  messageId?: string | null;
1816
1806
  /**
@@ -1844,6 +1834,7 @@ export interface components {
1844
1834
  requestedSkills?: string[];
1845
1835
  /** Model */
1846
1836
  model: components["schemas"]["CustomProviderModelSelection"] | components["schemas"]["BuiltInProviderModelSelection"];
1837
+ turnTraceContext?: components["schemas"]["TurnTraceContext"] | null;
1847
1838
  } & {
1848
1839
  [key: string]: unknown;
1849
1840
  };
@@ -1865,7 +1856,7 @@ export interface components {
1865
1856
  /** Id */
1866
1857
  id: string;
1867
1858
  /** Messages */
1868
- messages: components["schemas"]["AssistantMetadataUIMessage"][];
1859
+ messages: components["schemas"]["PhoenixUIMessage"][];
1869
1860
  /**
1870
1861
  * Ingesttraces
1871
1862
  * @default false
@@ -1897,6 +1888,7 @@ export interface components {
1897
1888
  requestedSkills?: string[];
1898
1889
  /** Model */
1899
1890
  model: components["schemas"]["CustomProviderModelSelection"] | components["schemas"]["BuiltInProviderModelSelection"];
1891
+ turnTraceContext?: components["schemas"]["TurnTraceContext"] | null;
1900
1892
  } & {
1901
1893
  [key: string]: unknown;
1902
1894
  };
@@ -3404,6 +3396,23 @@ export interface components {
3404
3396
  */
3405
3397
  message?: string | null;
3406
3398
  };
3399
+ /**
3400
+ * PhoenixUIMessage
3401
+ * @description `UIMessage` with `metadata` narrowed to the Phoenix wire shapes.
3402
+ */
3403
+ PhoenixUIMessage: {
3404
+ /** Id */
3405
+ id: string;
3406
+ /**
3407
+ * Role
3408
+ * @enum {string}
3409
+ */
3410
+ role: "system" | "user" | "assistant";
3411
+ /** Metadata */
3412
+ metadata?: (components["schemas"]["AssistantMessageMetadata"] | components["schemas"]["UserMessageMetadata"]) | null;
3413
+ /** Parts */
3414
+ parts: (components["schemas"]["TextUIPart"] | components["schemas"]["ReasoningUIPart"] | components["schemas"]["ToolInputStreamingPart"] | components["schemas"]["ToolInputAvailablePart"] | components["schemas"]["ToolOutputAvailablePart"] | components["schemas"]["ToolOutputErrorPart"] | components["schemas"]["ToolApprovalRequestedPart"] | components["schemas"]["ToolApprovalRespondedPart"] | components["schemas"]["ToolOutputDeniedPart"] | components["schemas"]["DynamicToolInputStreamingPart"] | components["schemas"]["DynamicToolInputAvailablePart"] | components["schemas"]["DynamicToolOutputAvailablePart"] | components["schemas"]["DynamicToolOutputErrorPart"] | components["schemas"]["DynamicToolApprovalRequestedPart"] | components["schemas"]["DynamicToolApprovalRespondedPart"] | components["schemas"]["DynamicToolOutputDeniedPart"] | components["schemas"]["SourceUrlUIPart"] | components["schemas"]["SourceDocumentUIPart"] | components["schemas"]["FileUIPart"] | components["schemas"]["DataUIPart"] | components["schemas"]["StepStartUIPart"])[];
3415
+ };
3407
3416
  /**
3408
3417
  * PlaygroundBuiltinModelContext
3409
3418
  * @description Built-in playground model selection.
@@ -5464,6 +5473,18 @@ export interface components {
5464
5473
  */
5465
5474
  end_time: string;
5466
5475
  };
5476
+ /** TurnTraceContext */
5477
+ TurnTraceContext: {
5478
+ /** Traceid */
5479
+ traceId: string;
5480
+ /** Rootspanid */
5481
+ rootSpanId: string;
5482
+ /**
5483
+ * Startedat
5484
+ * Format: date-time
5485
+ */
5486
+ startedAt: string;
5487
+ };
5467
5488
  /**
5468
5489
  * UIMessage
5469
5490
  * @description A message as displayed in the UI by Vercel AI Elements.
@@ -5644,6 +5665,21 @@ export interface components {
5644
5665
  /** Deleted Keys */
5645
5666
  deleted_keys: string[];
5646
5667
  };
5668
+ /**
5669
+ * UserMessageMetadata
5670
+ * @description Wire schema for metadata the browser attaches to outgoing user messages.
5671
+ */
5672
+ UserMessageMetadata: {
5673
+ /**
5674
+ * @description discriminator enum property added by openapi-typescript
5675
+ * @enum {string}
5676
+ */
5677
+ type: "user";
5678
+ /** Currentdatetime */
5679
+ currentDateTime: string;
5680
+ /** Timezone */
5681
+ timeZone: string;
5682
+ };
5647
5683
  /** ValidationError */
5648
5684
  ValidationError: {
5649
5685
  /** Location */
@@ -5704,6 +5740,34 @@ export interface components {
5704
5740
  /** Summary */
5705
5741
  summary: string;
5706
5742
  };
5743
+ /**
5744
+ * ToolCallCallbackProviderMetadata
5745
+ * @description Shape of the ``phoenix`` namespace the browser returns in
5746
+ * ``callProviderMetadata`` on resolved tool parts: the server-stamped fields
5747
+ * plus browser-recorded execution timings.
5748
+ */
5749
+ ToolCallCallbackProviderMetadata: {
5750
+ /**
5751
+ * Tool Execution Environment
5752
+ * @enum {string}
5753
+ */
5754
+ tool_execution_environment: "client" | "server";
5755
+ /**
5756
+ * Tool Input Emitted At
5757
+ * @default null
5758
+ */
5759
+ tool_input_emitted_at?: string | null;
5760
+ /**
5761
+ * Client Started At
5762
+ * @default null
5763
+ */
5764
+ client_started_at?: string | null;
5765
+ /**
5766
+ * Client Ended At
5767
+ * @default null
5768
+ */
5769
+ client_ended_at?: string | null;
5770
+ };
5707
5771
  /**
5708
5772
  * ToolCallProviderMetadata
5709
5773
  * @description Payload Phoenix stamps under the ``phoenix`` namespace of Vercel AI
@@ -5716,6 +5780,11 @@ export interface components {
5716
5780
  * @enum {string}
5717
5781
  */
5718
5782
  tool_execution_environment: "client" | "server";
5783
+ /**
5784
+ * Tool Input Emitted At
5785
+ * @default null
5786
+ */
5787
+ tool_input_emitted_at?: string | null;
5719
5788
  };
5720
5789
  };
5721
5790
  responses: never;
package/src/client.ts CHANGED
@@ -12,6 +12,7 @@ import {
12
12
  defaultGetEnvironmentOptions,
13
13
  makeDefaultClientOptions,
14
14
  } from "./config";
15
+ import { HttpError } from "./errors";
15
16
  import type { SemanticVersion } from "./types/semver";
16
17
  import { parseSemanticVersion } from "./utils/semverUtils";
17
18
 
@@ -66,10 +67,7 @@ export const getMergedOptions = ({
66
67
  const middleware: Middleware = {
67
68
  onResponse({ response }) {
68
69
  if (!response.ok) {
69
- // Will produce error messages like "https://example.org/api/v1/example: 404 Not Found".
70
- throw new Error(
71
- `${response.url}: ${response.status} ${response.statusText}`
72
- );
70
+ throw new HttpError(response);
73
71
  }
74
72
  },
75
73
  };
package/src/errors.ts ADDED
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Thrown when Phoenix answers a request with a non-2xx status.
3
+ *
4
+ * `status` is on the error so callers can branch on it: a status is frequently
5
+ * a legitimate answer rather than a bug — a 401 from an unauthenticated probe,
6
+ * for instance, is how a caller learns that auth is enabled on the deployment.
7
+ */
8
+ export class HttpError extends Error {
9
+ readonly status: number;
10
+ readonly statusText: string;
11
+ readonly url: string;
12
+
13
+ constructor(response: Response) {
14
+ super(`${response.url}: ${response.status} ${response.statusText}`);
15
+ this.name = "HttpError";
16
+ this.status = response.status;
17
+ this.statusText = response.statusText;
18
+ this.url = response.url;
19
+ }
20
+ }
package/src/index.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from "./client";
2
+ export * from "./errors";