LangSmithRunChatLoader#

class langchain_community.chat_loaders.langsmith.LangSmithRunChatLoader(runs: Iterable[str | Run], client: 'Client' | None = None)[source]#

Load chat sessions from a list of LangSmith β€œllm” runs.

runs#

The list of LLM run IDs or run objects.

Type:

Iterable[Union[str, Run]]

client#

Instance of LangSmith client for fetching data.

Type:

Client

Initialize a new LangSmithRunChatLoader instance.

Parameters:
  • runs (Iterable[Union[str, Run]]) – List of LLM run IDs or run objects.

  • client (Optional['Client']) – An instance of LangSmith client, if not provided, a new client instance will be created.

Methods

__init__(runs[,Β client])

Initialize a new LangSmithRunChatLoader instance.

lazy_load()

Lazy load the chat sessions from the iterable of run IDs.

load()

Eagerly load the chat sessions into memory.

__init__(runs: Iterable[str | Run], client: 'Client' | None = None)[source]#

Initialize a new LangSmithRunChatLoader instance.

Parameters:
  • runs (Iterable[Union[str, Run]]) – List of LLM run IDs or run objects.

  • client (Optional['Client']) – An instance of LangSmith client, if not provided, a new client instance will be created.

lazy_load() β†’ Iterator[ChatSession][source]#

Lazy load the chat sessions from the iterable of run IDs.

This method fetches the runs and converts them to chat sessions on-the-fly, yielding one session at a time.

Returns:

Iterator of chat sessions containing messages.

Return type:

Iterator[ChatSession]

load() β†’ list[ChatSession]#

Eagerly load the chat sessions into memory.

Returns:

A list of chat sessions.

Return type:

list[ChatSession]

Examples using LangSmithRunChatLoader