List runs from the LangSmith server.
listRuns(props: ListRunsParams): AsyncIterable<Run>| Name | Type | Description |
|---|---|---|
props* | ListRunsParams |
// List all runs in a project
const projectRuns = client.listRuns({ projectName: "<your_project>" });// List LLM and Chat runs in the last 24 hours
const todaysLLMRuns = client.listRuns({
projectName: "<your_project>",
start_time: new Date(Date.now() - 24 * 60 * 60 * 1000),
run_type: "llm",
});// List traces in a project
const rootRuns = client.listRuns({
projectName: "<your_project>",
execution_order: 1,
});// List runs without errors
const correctRuns = client.listRuns({
projectName: "<your_project>",
error: false,
});// List runs by run ID
const runIds = [
"a36092d2-4ad5-4fb4-9c0d-0dba9a2ed836",
"9398e6be-964f-4aa4-8ae9-ad78cd4b7074",
];
const selectedRuns = client.listRuns({ run_ids: runIds });// List all "chain" type runs that took more than 10 seconds and had `total_tokens` greater than 5000
const chainRuns = client.listRuns({
projectName: "<your_project>",
filter: 'and(eq(run_type, "chain"), gt(latency, 10), gt(total_tokens, 5000))',
});// List all runs called "extractor" whose root of the trace was assigned feedback "user_score" score of 1
const goodExtractorRuns = client.listRuns({
projectName: "<your_project>",
filter: 'eq(name, "extractor")',
traceFilter: 'and(eq(feedback_key, "user_score"), eq(feedback_score, 1))',
});// List all runs that started after a specific timestamp and either have "error" not equal to null or a "Correctness" feedback score equal to 0
const complexRuns = client.listRuns({
projectName: "<your_project>",
filter: 'and(gt(start_time, "2023-07-15T12:34:56Z"), or(neq(error, null), and(eq(feedback_key, "Correctness"), eq(feedback_score, 0.0))))',
});// List all runs where `tags` include "experimental" or "beta" and `latency` is greater than 2 seconds
const taggedRuns = client.listRuns({
projectName: "<your_project>",
filter: 'and(or(has(tags, "experimental"), has(tags, "beta")), gt(latency, 2))',
});