UNPKG

@arizeai/phoenix-client

Version:
49 lines 1.8 kB
import type { ClientFn } from "../types/core"; import type { DatasetSelector, Example } from "../types/datasets"; export type AppendDatasetExamplesParams = ClientFn & { /** * The dataset to append examples to */ dataset: DatasetSelector; /** * The examples to append to the dataset */ examples: Example[]; }; export type AppendDatasetExamplesResponse = { datasetId: string; }; /** * Append examples to an existing dataset. * * @experimental this interface may change in the future * * @param params - The parameters for appending examples * @param params.client - Optional Phoenix client instance * @param params.dataset - The dataset to append examples to (by ID or name) * @param params.examples - The examples to append. Each example can include: * - `input`: Required input data for the example * - `output`: Optional expected output data * - `metadata`: Optional metadata for the example * - `splits`: Optional split assignment (string, array of strings, or null) * - `spanId`: Optional OpenTelemetry span ID to link the example back to its source span * * @returns A promise that resolves to the dataset ID * * @example * ```ts * // Append examples with span links to an existing dataset * const { datasetId } = await appendDatasetExamples({ * dataset: { datasetName: "qa-dataset" }, * examples: [ * { * input: { question: "What is deep learning?" }, * output: { answer: "Deep learning is..." }, * spanId: "span123abc" // Links to the source span * } * ] * }); * ``` */ export declare function appendDatasetExamples({ client: _client, dataset, examples, }: AppendDatasetExamplesParams): Promise<AppendDatasetExamplesResponse>; //# sourceMappingURL=appendDatasetExamples.d.ts.map