@arizeai/phoenix-client 7.11.0 → 7.12.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.
Files changed (39) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +13 -5
  3. package/dist/esm/__generated__/api/v1.d.ts +98 -4
  4. package/dist/esm/__generated__/api/v1.d.ts.map +1 -1
  5. package/dist/esm/constants/serverRequirements.d.ts +2 -0
  6. package/dist/esm/constants/serverRequirements.d.ts.map +1 -1
  7. package/dist/esm/constants/serverRequirements.js +16 -0
  8. package/dist/esm/constants/serverRequirements.js.map +1 -1
  9. package/dist/esm/sessions/listSessions.d.ts +10 -1
  10. package/dist/esm/sessions/listSessions.d.ts.map +1 -1
  11. package/dist/esm/sessions/listSessions.js +10 -1
  12. package/dist/esm/sessions/listSessions.js.map +1 -1
  13. package/dist/esm/traces/getTraces.d.ts +10 -2
  14. package/dist/esm/traces/getTraces.d.ts.map +1 -1
  15. package/dist/esm/traces/getTraces.js +12 -4
  16. package/dist/esm/traces/getTraces.js.map +1 -1
  17. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  18. package/dist/src/__generated__/api/v1.d.ts +98 -4
  19. package/dist/src/__generated__/api/v1.d.ts.map +1 -1
  20. package/dist/src/constants/serverRequirements.d.ts +2 -0
  21. package/dist/src/constants/serverRequirements.d.ts.map +1 -1
  22. package/dist/src/constants/serverRequirements.js +17 -1
  23. package/dist/src/constants/serverRequirements.js.map +1 -1
  24. package/dist/src/sessions/listSessions.d.ts +10 -1
  25. package/dist/src/sessions/listSessions.d.ts.map +1 -1
  26. package/dist/src/sessions/listSessions.js +9 -0
  27. package/dist/src/sessions/listSessions.js.map +1 -1
  28. package/dist/src/traces/getTraces.d.ts +10 -2
  29. package/dist/src/traces/getTraces.d.ts.map +1 -1
  30. package/dist/src/traces/getTraces.js +11 -3
  31. package/dist/src/traces/getTraces.js.map +1 -1
  32. package/dist/tsconfig.tsbuildinfo +1 -1
  33. package/docs/sessions.mdx +13 -0
  34. package/docs/traces.mdx +7 -6
  35. package/package.json +10 -10
  36. package/src/__generated__/api/v1.ts +98 -4
  37. package/src/constants/serverRequirements.ts +18 -0
  38. package/src/sessions/listSessions.ts +22 -2
  39. package/src/traces/getTraces.ts +21 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @arizeai/phoenix-client
2
2
 
3
+ ## 7.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - dab09f1: Add `filter` expressions to `getTraces` and `listSessions` (requires Phoenix server >= 20.12.0). Deprecate the individual trace error and latency parameters while retaining their behavior and support for server >= 20.8.0.
8
+
3
9
  ## 7.11.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -383,8 +383,11 @@ checks an aggregate bar (so CI can allow a mean of 80% while still running
383
383
  every case), and `passRate` requires a minimum fraction of runs to satisfy a
384
384
  per-run `passFn` predicate.
385
385
 
386
- See the [`docs/`](./docs) folder — `ci-evals.mdx`, `ci-evals-vitest.mdx`,
387
- `ci-evals-jest.mdx`, and `ci-evals-annotations.mdx` — for setup, the full
386
+ See the [CI Eval Tests](https://arize.com/docs/phoenix/sdk-api-reference/typescript/packages/phoenix-client/ci-evals),
387
+ [Vitest](https://arize.com/docs/phoenix/sdk-api-reference/typescript/packages/phoenix-client/ci-evals-vitest),
388
+ [Jest](https://arize.com/docs/phoenix/sdk-api-reference/typescript/packages/phoenix-client/ci-evals-jest),
389
+ and [Annotations](https://arize.com/docs/phoenix/sdk-api-reference/typescript/packages/phoenix-client/ci-evals-annotations)
390
+ guides for setup, the full
388
391
  `describe` / `test` / `test.each` API, acceptance criteria, repetitions,
389
392
  dry-run mode, and annotation details.
390
393
 
@@ -422,11 +425,10 @@ const sessionTraces = await getTraces({
422
425
  sessionId: "my-session-id",
423
426
  });
424
427
 
425
- // Filter by error status and latency (requires Phoenix server >= 20.8.0)
428
+ // Filter by error status and latency (requires Phoenix server >= 20.12.0)
426
429
  const slowFailures = await getTraces({
427
430
  project: { projectName: "my-project" },
428
- error: true,
429
- minLatencyMs: 1000,
431
+ filter: "error_count > 0 and latency_ms >= 1000",
430
432
  });
431
433
  ```
432
434
 
@@ -441,10 +443,16 @@ const slowFailures = await getTraces({
441
443
  | `cursor` | `string \| null` | Pagination cursor |
442
444
  | `includeSpans` | `boolean` | Include full span details for each trace |
443
445
  | `sessionId` | `string \| string[] \| null` | Filter traces by session identifier(s) |
446
+ | `filter` | `string \| null` | Trace filter expression |
444
447
  | `error` | `boolean \| null` | Only traces with (`true`) or without (`false`) errored spans |
445
448
  | `minLatencyMs` | `number \| null` | Inclusive lower bound on trace latency (ms) |
446
449
  | `maxLatencyMs` | `number \| null` | Inclusive upper bound on trace latency (ms) |
447
450
 
451
+ `error`, `minLatencyMs`, and `maxLatencyMs` are deprecated but remain supported on
452
+ server >= 20.8.0. Use `error_count > 0` / `error_count == 0`, `latency_ms >= N`, and
453
+ `latency_ms <= N` in `filter` instead. Empty expressions do not filter; invalid
454
+ expressions return HTTP 400. Keep the same expression when requesting the next page.
455
+
448
456
  ### Pagination
449
457
 
450
458
  Use the `cursor` from a previous result to fetch the next page:
@@ -429,7 +429,8 @@ export interface paths {
429
429
  path?: never;
430
430
  cookie?: never;
431
431
  };
432
- get?: never;
432
+ /** List dataset splits */
433
+ get: operations["listDatasetSplits"];
433
434
  put?: never;
434
435
  /** Create a dataset split */
435
436
  post: operations["createDatasetSplit"];
@@ -3979,6 +3980,13 @@ export interface components {
3979
3980
  /** Data */
3980
3981
  data: components["schemas"]["DatasetLabel"][];
3981
3982
  };
3983
+ /** ListDatasetSplitsResponseBody */
3984
+ ListDatasetSplitsResponseBody: {
3985
+ /** Data */
3986
+ data: components["schemas"]["DatasetSplit"][];
3987
+ /** Next Cursor */
3988
+ next_cursor: string | null;
3989
+ };
3982
3990
  /** ListDatasetVersionsResponseBody */
3983
3991
  ListDatasetVersionsResponseBody: {
3984
3992
  /** Data */
@@ -8958,6 +8966,61 @@ export interface operations {
8958
8966
  };
8959
8967
  };
8960
8968
  };
8969
+ listDatasetSplits: {
8970
+ parameters: {
8971
+ query?: {
8972
+ /** @description Cursor for pagination */
8973
+ cursor?: string | null;
8974
+ /** @description The max number of dataset splits to return at a time. */
8975
+ limit?: number;
8976
+ };
8977
+ header?: never;
8978
+ path: {
8979
+ /** @description The dataset identifier: either dataset ID or dataset name. */
8980
+ dataset_identifier: string;
8981
+ };
8982
+ cookie?: never;
8983
+ };
8984
+ requestBody?: never;
8985
+ responses: {
8986
+ /** @description Successful Response */
8987
+ 200: {
8988
+ headers: {
8989
+ [name: string]: unknown;
8990
+ };
8991
+ content: {
8992
+ "application/json": components["schemas"]["ListDatasetSplitsResponseBody"];
8993
+ };
8994
+ };
8995
+ /** @description Forbidden */
8996
+ 403: {
8997
+ headers: {
8998
+ [name: string]: unknown;
8999
+ };
9000
+ content: {
9001
+ "text/plain": string;
9002
+ };
9003
+ };
9004
+ /** @description Dataset not found */
9005
+ 404: {
9006
+ headers: {
9007
+ [name: string]: unknown;
9008
+ };
9009
+ content: {
9010
+ "text/plain": string;
9011
+ };
9012
+ };
9013
+ /** @description Invalid request */
9014
+ 422: {
9015
+ headers: {
9016
+ [name: string]: unknown;
9017
+ };
9018
+ content: {
9019
+ "text/plain": string;
9020
+ };
9021
+ };
9022
+ };
9023
+ };
8961
9024
  createDatasetSplit: {
8962
9025
  parameters: {
8963
9026
  query?: never;
@@ -10111,12 +10174,23 @@ export interface operations {
10111
10174
  include_spans?: boolean;
10112
10175
  /** @description List of session identifiers to filter traces by. Each value can be either a session_id string or a session GlobalID. Only traces belonging to the specified sessions will be returned. */
10113
10176
  session_identifier?: string[] | null;
10114
- /** @description Filter by trace error status. If true, only return traces that contain at least one span with `status_code == ERROR`. If false, only return traces with no errored spans. If omitted, traces are not filtered by error status. Matches the error indicator shown in the UI. */
10177
+ /**
10178
+ * @deprecated
10179
+ * @description Deprecated: use `filter=error_count > 0` or `filter=error_count == 0`. Filter by trace error status. If true, only return traces that contain at least one span with `status_code == ERROR`. If false, only return traces with no errored spans. If omitted, traces are not filtered by error status.
10180
+ */
10115
10181
  error?: boolean | null;
10116
- /** @description Inclusive lower bound on trace latency in milliseconds. */
10182
+ /**
10183
+ * @deprecated
10184
+ * @description Inclusive lower bound on trace latency in milliseconds. Deprecated: use `filter=latency_ms >= N`.
10185
+ */
10117
10186
  min_latency_ms?: number | null;
10118
- /** @description Inclusive upper bound on trace latency in milliseconds. */
10187
+ /**
10188
+ * @deprecated
10189
+ * @description Inclusive upper bound on trace latency in milliseconds. Deprecated: use `filter=latency_ms <= N`.
10190
+ */
10119
10191
  max_latency_ms?: number | null;
10192
+ /** @description Trace filter expression, as documented at https://arize.com/docs/phoenix/tracing/how-to-tracing/filter-expressions. Combined with other filters using AND. Empty expressions do not filter. Invalid expressions return 400. */
10193
+ filter?: string | null;
10120
10194
  };
10121
10195
  header?: never;
10122
10196
  path: {
@@ -10136,6 +10210,15 @@ export interface operations {
10136
10210
  "application/json": components["schemas"]["GetTracesResponseBody"];
10137
10211
  };
10138
10212
  };
10213
+ /** @description Bad Request */
10214
+ 400: {
10215
+ headers: {
10216
+ [name: string]: unknown;
10217
+ };
10218
+ content: {
10219
+ "text/plain": string;
10220
+ };
10221
+ };
10139
10222
  /** @description Forbidden */
10140
10223
  403: {
10141
10224
  headers: {
@@ -11903,6 +11986,8 @@ export interface operations {
11903
11986
  limit?: number;
11904
11987
  /** @description Sort order by ID: 'asc' (ascending) or 'desc' (descending). */
11905
11988
  order?: "asc" | "desc";
11989
+ /** @description Session filter expression, as documented at https://arize.com/docs/phoenix/tracing/how-to-tracing/filter-expressions. Empty expressions do not filter. Invalid expressions return 400. */
11990
+ filter?: string | null;
11906
11991
  };
11907
11992
  header?: never;
11908
11993
  path: {
@@ -11922,6 +12007,15 @@ export interface operations {
11922
12007
  "application/json": components["schemas"]["GetSessionsResponseBody"];
11923
12008
  };
11924
12009
  };
12010
+ /** @description Bad Request */
12011
+ 400: {
12012
+ headers: {
12013
+ [name: string]: unknown;
12014
+ };
12015
+ content: {
12016
+ "text/plain": string;
12017
+ };
12018
+ };
11925
12019
  /** @description Forbidden */
11926
12020
  403: {
11927
12021
  headers: {