Home / File/ test_run_collector.py — langchain Source File

test_run_collector.py — langchain Source File

Architecture documentation for test_run_collector.py, a python file in the langchain codebase. 3 imports, 0 dependents.

File python CoreAbstractions Serialization 3 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  aa5e5723_6e2d_9b5c_756b_51c9840136a0["test_run_collector.py"]
  8dfa0cac_d802_3ccd_f710_43a5e70da3a5["uuid"]
  aa5e5723_6e2d_9b5c_756b_51c9840136a0 --> 8dfa0cac_d802_3ccd_f710_43a5e70da3a5
  ba43b74d_3099_7e1c_aac3_cf594720469e["langchain_core.language_models"]
  aa5e5723_6e2d_9b5c_756b_51c9840136a0 --> ba43b74d_3099_7e1c_aac3_cf594720469e
  0dd80fba_b72d_91a8_6113_3bb8b0a7af05["langchain_core.tracers.context"]
  aa5e5723_6e2d_9b5c_756b_51c9840136a0 --> 0dd80fba_b72d_91a8_6113_3bb8b0a7af05
  style aa5e5723_6e2d_9b5c_756b_51c9840136a0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"""Test the run collector."""

import uuid

from langchain_core.language_models import FakeListLLM
from langchain_core.tracers.context import collect_runs


def test_collect_runs() -> None:
    model = FakeListLLM(responses=["hello"])
    with collect_runs() as cb:
        model.invoke("hi")
        assert cb.traced_runs
        assert len(cb.traced_runs) == 1
        assert isinstance(cb.traced_runs[0].id, uuid.UUID)
        assert cb.traced_runs[0].inputs == {"prompts": ["hi"]}

Subdomains

Dependencies

  • langchain_core.language_models
  • langchain_core.tracers.context
  • uuid

Frequently Asked Questions

What does test_run_collector.py do?
test_run_collector.py is a source file in the langchain codebase, written in python. It belongs to the CoreAbstractions domain, Serialization subdomain.
What functions are defined in test_run_collector.py?
test_run_collector.py defines 1 function(s): test_collect_runs.
What does test_run_collector.py depend on?
test_run_collector.py imports 3 module(s): langchain_core.language_models, langchain_core.tracers.context, uuid.
Where is test_run_collector.py in the architecture?
test_run_collector.py is located at libs/core/tests/unit_tests/tracers/test_run_collector.py (domain: CoreAbstractions, subdomain: Serialization, directory: libs/core/tests/unit_tests/tracers).

Analyze Your Own Codebase

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

Try Supermodel Free