langchain-ai / langsmith-docs

Documentation for langsmith

Home Page:https://docs.smith.langchain.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DOC: <Issue related to /how_to_guides/evaluation/evaluate_llm_application>

jmattiace opened this issue · comments

The documentation for evaluating a Langchain runnable for Typescript has an error. It mentions Then, pass the runnable.invoke method to the evaluate method. with the following code snippet:

import { evaluate } from "langsmith/evaluation";

await evaluate(chain, {
  data: datasetName,
  evaluators: [correctLabel],
  experimentPrefix: "Toxic Queries",
});

What I have found in my testing is that the chain function needs to be called -> chain().

Updated example:

import { evaluate } from "langsmith/evaluation";

await evaluate(chain(), {
  data: datasetName,
  evaluators: [correctLabel],
  experimentPrefix: "Toxic Queries",
});

That seems incorrect/weird. I'm unable to repro -- using chain works fine for me:

await evaluate(chain, {
  data: "Toxic Queries",
  evaluators: [correctLabel],
  experimentPrefix: "Toxic Queries",
});

Please upgrade to latest TS SDK (0.1.25) and let me know if the issue persists

closing for lack of reproducibility / last comment was made last month