Sources

langsmith

Read transcripts from LangSmith traces.

Each LangSmith root run (trace) becomes one Scout transcript. Child runs (LLM calls, tools) become events within the transcript.

Data sources:

  • project - Import traces from a project (default)
  • dataset - Import examples from a dataset
async def langsmith(
    project: str | None = None,
    dataset: str | None = None,
    from_time: datetime | None = None,
    to_time: datetime | None = None,
    tags: list[str] | None = None,
    filter: str | None = None,
    trace_filter: str | None = None,
    run_type: str | None = None,
    limit: int | None = None,
    api_key: str | None = None,
    api_url: str | None = None,
) -> AsyncIterator[Transcript]
project str | None

LangSmith project name. Optional for dataset, used as default data source otherwise.

dataset str | None

LangSmith dataset name or ID. Fetches from curated evaluation datasets instead of project traces.

from_time datetime | None

Only fetch traces created on or after this time

to_time datetime | None

Only fetch traces created before this time

tags list[str] | None

Filter by tags (all must match)

filter str | None

LangSmith filter string for run filtering. Can use filters saved from the LangSmith UI.

trace_filter str | None

Filter on root run attributes

run_type str | None

Filter by run type (llm, chain, tool, etc.)

limit int | None

Maximum number of transcripts to fetch

api_key str | None

LangSmith API key (or LANGSMITH_API_KEY env var)

api_url str | None

LangSmith API URL (or LANGSMITH_ENDPOINT env var)

logfire

Read transcripts from Logfire traces.

Each Logfire trace (collection of spans with same trace_id) becomes one Scout transcript. Child spans (LLM calls, tools) become events within the transcript.

async def logfire(
    project: str | None = None,
    from_time: datetime | None = None,
    to_time: datetime | None = None,
    filter: str | None = None,
    trace_id: str | None = None,
    limit: int | None = None,
    read_token: str | None = None,
) -> AsyncIterator[Transcript]
project str | None

Logfire project name in format “org/project”. If not provided, queries across all accessible projects.

from_time datetime | None

Only fetch traces created on or after this time

to_time datetime | None

Only fetch traces created before this time

filter str | None

SQL WHERE fragment for additional filtering (e.g., “attributes->>‘gen_ai.request.model’ = ‘gpt-4o’”)

trace_id str | None

Fetch a specific trace by ID instead of querying

limit int | None

Maximum number of transcripts to fetch

read_token str | None

Logfire read token (or LOGFIRE_READ_TOKEN env var). Generate from Logfire dashboard Settings > Read Tokens.