Skip to content

Commit

Permalink
0.0.39 (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw authored Sep 21, 2023
1 parent f22a497 commit 45058c9
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "langsmith",
"version": "0.0.38",
"version": "0.0.39",
"description": "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform.",
"files": [
"dist/",
Expand Down
5 changes: 4 additions & 1 deletion js/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,10 @@ export class Client {
const childRuns = await toArray(this.listRuns({ id: run.child_run_ids }));
const treemap: { [key: string]: Run[] } = {};
const runs: { [key: string]: Run } = {};
childRuns.sort((a, b) => a.dotted_order.localeCompare(b.dotted_order));
// TODO: make dotted order required when the migration finishes
childRuns.sort((a, b) =>
(a?.dotted_order ?? "").localeCompare(b?.dotted_order ?? "")
);
for (const childRun of childRuns) {
if (
childRun.parent_run_id === null ||
Expand Down
4 changes: 2 additions & 2 deletions js/src/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export interface Run extends BaseRun {
/** IDs of parent runs, if multiple exist. */
parent_run_ids?: string[];
/**Unique ID assigned to every run within this nested trace.**/
trace_id: string;
trace_id?: string;

/**
* The dotted order for the run.
Expand All @@ -163,7 +163,7 @@ export interface Run extends BaseRun {
* - 20230914T223155647Z1b64098b-4ab7-43f6-afee-992304f198d8.20230914T223155649Z809ed3a2-0172-4f4d-8a02-a64e9b7a0f8a
* - 20230915T223155647Z1b64098b-4ab7-43f6-afee-992304f198d8.20230914T223155650Zc8d9f4c5-6c5a-4b2d-9b1c-3d9d7a7c5c7c
*/
dotted_order: string;
dotted_order?: string;
}

export interface RunCreate extends BaseRun {
Expand Down
6 changes: 5 additions & 1 deletion python/langsmith/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,11 @@ def _load_child_runs(self, run: ls_schemas.Run) -> ls_schemas.Run:
list
)
runs: Dict[uuid.UUID, ls_schemas.Run] = {}
for child_run in sorted(child_runs, key=lambda r: r.dotted_order):
for child_run in sorted(
# TODO: Remove execution_order once it's no longer used
child_runs,
key=lambda r: r.dotted_order or str(r.execution_order),
):
if child_run.parent_run_id is None:
raise ls_utils.LangSmithError(f"Child run {child_run.id} has no parent")
treemap[child_run.parent_run_id].append(child_run)
Expand Down
2 changes: 1 addition & 1 deletion python/langsmith/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class Run(RunBase):
"""List of parent run IDs."""
trace_id: Optional[UUID] = None
"""Unique ID assigned to every run within this nested trace."""
dotted_order: str = ""
dotted_order: Optional[str] = None
"""Dotted order for the run.
This is a string composed of {time}{run-uuid}.* so that a trace can be
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langsmith"
version = "0.0.38"
version = "0.0.39"
description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform."
authors = ["LangChain <support@langchain.dev>"]
license = "MIT"
Expand Down

0 comments on commit 45058c9

Please sign in to comment.