@arizeai/phoenix-client 5.4.1 → 5.5.1

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": "5.4.1",
3
+ "version": "5.5.1",
4
4
  "description": "A client for the Phoenix API",
5
5
  "main": "dist/src/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -77,7 +77,7 @@
77
77
  "tiny-invariant": "^1.3.3",
78
78
  "zod": "^3.24.3",
79
79
  "zod-to-json-schema": "^3.24.3",
80
- "@arizeai/phoenix-otel": "0.3.0"
80
+ "@arizeai/phoenix-otel": "0.3.1"
81
81
  },
82
82
  "engines": {
83
83
  "node": ">=18"
@@ -3527,6 +3527,8 @@ export interface operations {
3527
3527
  inputs: Record<string, unknown>[];
3528
3528
  outputs?: Record<string, unknown>[];
3529
3529
  metadata?: Record<string, unknown>[];
3530
+ /** @description Split per example: string, string array, or null */
3531
+ splits?: (string | string[] | null)[];
3530
3532
  };
3531
3533
  "multipart/form-data": {
3532
3534
  /** @enum {string} */
@@ -3536,6 +3538,8 @@ export interface operations {
3536
3538
  "input_keys[]": string[];
3537
3539
  "output_keys[]": string[];
3538
3540
  "metadata_keys[]"?: string[];
3541
+ /** @description Column names for auto-assigning examples to splits */
3542
+ "split_keys[]"?: string[];
3539
3543
  /** Format: binary */
3540
3544
  file: string;
3541
3545
  };
@@ -36,6 +36,9 @@ export async function appendDatasetExamples({
36
36
  const inputs = examples.map((example) => example.input);
37
37
  const outputs = examples.map((example) => example.output ?? {}); // Treat null as an empty object
38
38
  const metadata = examples.map((example) => example.metadata ?? {});
39
+ const splits = examples.map((example) =>
40
+ example.splits !== undefined ? example.splits : null
41
+ );
39
42
  let datasetName: string;
40
43
  if ("datasetName" in dataset) {
41
44
  datasetName = dataset.datasetName;
@@ -58,6 +61,7 @@ export async function appendDatasetExamples({
58
61
  inputs,
59
62
  outputs,
60
63
  metadata,
64
+ splits,
61
65
  },
62
66
  });
63
67
  invariant(appendResponse.data?.data, "Failed to append dataset examples");
@@ -37,6 +37,9 @@ export async function createDataset({
37
37
  const inputs = examples.map((example) => example.input);
38
38
  const outputs = examples.map((example) => example?.output ?? {}); // Treat null as an empty object
39
39
  const metadata = examples.map((example) => example?.metadata ?? {});
40
+ const splits = examples.map((example) =>
41
+ example?.splits !== undefined ? example.splits : null
42
+ );
40
43
  const createDatasetResponse = await client.POST("/v1/datasets/upload", {
41
44
  params: {
42
45
  query: {
@@ -51,6 +54,7 @@ export async function createDataset({
51
54
  inputs,
52
55
  outputs,
53
56
  metadata,
57
+ splits,
54
58
  },
55
59
  });
56
60
  invariant(createDatasetResponse.data?.data, "Failed to create dataset");
@@ -45,6 +45,13 @@ export interface Example {
45
45
  input: Record<string, unknown>;
46
46
  output?: Record<string, unknown> | null;
47
47
  metadata?: Record<string, unknown> | null;
48
+ /**
49
+ * Split assignment for this example. Can be:
50
+ * - A single string for one split: "train"
51
+ * - An array of strings for multiple splits: ["train", "easy"]
52
+ * - null for no split assignment
53
+ */
54
+ splits?: string | string[] | null;
48
55
  }
49
56
 
50
57
  /**