Skip to content

Commit

Permalink
Use singletons
Browse files Browse the repository at this point in the history
  • Loading branch information
dqbd committed May 15, 2024
1 parent 2e9407b commit a648854
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion langchain-core/src/runnables/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
type TraceableFunction,
isTraceableFunction,
} from "langsmith/singletons/traceable";

import type { RunnableInterface, RunnableBatchOptions } from "./types.js";
import {
CallbackManager,
Expand Down
2 changes: 2 additions & 0 deletions langchain-core/src/tracers/tracer_langchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ export class LangChainTracer

getTraceableRunTree(): RunTree | undefined {
try {
// TODO: this might be an unsafe/breaking operation
// as now we have a hard dependency on node:async_hooks
return getCurrentRunTree();
} catch {
return undefined;
Expand Down
2 changes: 1 addition & 1 deletion langchain/src/smith/runner_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
} from "langsmith";
import { EvaluationResult, RunEvaluator } from "langsmith/evaluation";
import { DataType } from "langsmith/schemas";
import type { TraceableFunction } from "langsmith/traceable";
import type { TraceableFunction } from "langsmith/singletons/traceable";
import { LLMStringEvaluator } from "../evaluation/base.js";
import { loadEvaluator } from "../evaluation/loader.js";
import { EvaluatorType } from "../evaluation/types.js";
Expand Down

0 comments on commit a648854

Please sign in to comment.