diff --git a/js/package.json b/js/package.json index b14aab1f1..d58b45677 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "langsmith", - "version": "0.1.51", + "version": "0.1.52", "description": "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform.", "packageManager": "yarn@1.22.19", "files": [ @@ -276,4 +276,4 @@ }, "./package.json": "./package.json" } -} +} \ No newline at end of file diff --git a/js/src/client.ts b/js/src/client.ts index 49e182fc9..0f397cd2e 100644 --- a/js/src/client.ts +++ b/js/src/client.ts @@ -249,13 +249,20 @@ type RecordStringAny = Record; export type FeedbackSourceType = "model" | "api" | "app"; export type CreateExampleOptions = { + /** The ID of the dataset to create the example in. */ datasetId?: string; + /** The name of the dataset to create the example in (if dataset ID is not provided). */ datasetName?: string; + /** The creation date of the example. */ createdAt?: Date; + /** A unique identifier for the example. */ exampleId?: string; - + /** Additional metadata associated with the example. */ metadata?: KVMap; + /** The split(s) to assign the example to. */ split?: string | string[]; + /** The ID of the source run associated with this example. */ + sourceRunId?: string; }; type AutoBatchQueueItem = { @@ -2288,6 +2295,7 @@ export class Client { exampleId, metadata, split, + sourceRunId, }: CreateExampleOptions ): Promise { let datasetId_ = datasetId; @@ -2309,6 +2317,7 @@ export class Client { id: exampleId, metadata, split, + source_run_id: sourceRunId, }; const response = await this.caller.call(fetch, `${this.apiUrl}/examples`, { diff --git a/js/src/index.ts b/js/src/index.ts index d55ae6a07..03cee2609 100644 --- a/js/src/index.ts +++ b/js/src/index.ts @@ -12,4 +12,4 @@ export type { export { RunTree, type RunTreeConfig } from "./run_trees.js"; // Update using yarn bump-version -export const __version__ = "0.1.51"; +export const __version__ = "0.1.52"; diff --git a/js/src/schemas.ts b/js/src/schemas.ts index 1101a54bb..4d73f29aa 100644 --- a/js/src/schemas.ts +++ b/js/src/schemas.ts @@ -60,6 +60,7 @@ export interface BaseExample { inputs: KVMap; outputs?: KVMap; metadata?: KVMap; + source_run_id?: string; } /** diff --git a/python/langsmith/client.py b/python/langsmith/client.py index 1f0797bbe..b2dc4ac2b 100644 --- a/python/langsmith/client.py +++ b/python/langsmith/client.py @@ -3307,6 +3307,7 @@ def create_example( metadata: Optional[Mapping[str, Any]] = None, split: Optional[str | List[str]] = None, example_id: Optional[ID_TYPE] = None, + source_run_id: Optional[ID_TYPE] = None, ) -> ls_schemas.Example: """Create a dataset example in the LangSmith API. @@ -3330,9 +3331,11 @@ def create_example( split : str or List[str] or None, default=None The splits for the example, which are divisions of your dataset such as 'train', 'test', or 'validation'. - exemple_id : UUID or None, default=None + example_id : UUID or None, default=None The ID of the example to create. If not provided, a new example will be created. + source_run_id : UUID or None, default=None + The ID of the source run associated with this example. Returns: Example: The created example. @@ -3346,6 +3349,7 @@ def create_example( "dataset_id": dataset_id, "metadata": metadata, "split": split, + "source_run_id": source_run_id, } if created_at: data["created_at"] = created_at.isoformat() diff --git a/python/pyproject.toml b/python/pyproject.toml index 17d8a6ddb..ac4d8cb86 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langsmith" -version = "0.1.116" +version = "0.1.117" description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform." authors = ["LangChain "] license = "MIT"