Home / Function/ lazy_load() — langchain Function Reference

lazy_load() — langchain Function Reference

Architecture documentation for the lazy_load() function in langsmith.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  1ba91cff_5744_a5d8_37e7_04902c3b07ff["lazy_load()"]
  daac6824_bc00_b426_fe70_ad636432d088["LangSmithLoader"]
  1ba91cff_5744_a5d8_37e7_04902c3b07ff -->|defined in| daac6824_bc00_b426_fe70_ad636432d088
  1ba91cff_5744_a5d8_37e7_04902c3b07ff["lazy_load()"]
  1ba91cff_5744_a5d8_37e7_04902c3b07ff -->|calls| 1ba91cff_5744_a5d8_37e7_04902c3b07ff
  1ba91cff_5744_a5d8_37e7_04902c3b07ff["lazy_load()"]
  1ba91cff_5744_a5d8_37e7_04902c3b07ff -->|calls| 1ba91cff_5744_a5d8_37e7_04902c3b07ff
  style 1ba91cff_5744_a5d8_37e7_04902c3b07ff fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/document_loaders/langsmith.py lines 113–134

    def lazy_load(self) -> Iterator[Document]:
        for example in self._client.list_examples(
            dataset_id=self.dataset_id,
            dataset_name=self.dataset_name,
            example_ids=self.example_ids,
            as_of=self.as_of,
            splits=self.splits,
            inline_s3_urls=self.inline_s3_urls,
            offset=self.offset,
            limit=self.limit,
            metadata=self.metadata,
            filter=self.filter,
        ):
            content: Any = example.inputs
            for key in self.content_key:
                content = content[key]
            content_str = self.format_content(content)
            metadata = pydantic_to_dict(example)
            # Stringify datetime and UUID types.
            for k in ("dataset_id", "created_at", "modified_at", "source_run_id", "id"):
                metadata[k] = str(metadata[k]) if metadata[k] else metadata[k]
            yield Document(content_str, metadata=metadata)

Subdomains

Calls

Called By

Frequently Asked Questions

What does lazy_load() do?
lazy_load() is a function in the langchain codebase, defined in libs/core/langchain_core/document_loaders/langsmith.py.
Where is lazy_load() defined?
lazy_load() is defined in libs/core/langchain_core/document_loaders/langsmith.py at line 113.
What does lazy_load() call?
lazy_load() calls 1 function(s): lazy_load.
What calls lazy_load()?
lazy_load() is called by 1 function(s): lazy_load.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free