langchain_community.chat_loaders.langsmith
.LangSmithRunChatLoader¶
- class langchain_community.chat_loaders.langsmith.LangSmithRunChatLoader(runs: Iterable[Union[str, Run]], client: Optional['Client'] = None)[source]¶
Load chat sessions from a list of LangSmith “llm” runs.
- 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 the chat sessions from the iterable of run IDs.
load
()Eagerly load the chat sessions into memory.
- __init__(runs: Iterable[Union[str, Run]], client: Optional['Client'] = 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.
- Return type
List[ChatSession]