Home / Function/ selector() — langchain Function Reference

selector() — langchain Function Reference

Architecture documentation for the selector() function in test_length_based_example_selector.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  6149161e_8515_bb02_5688_cbd65b869815["selector()"]
  7e68d2d6_6314_1254_1bda_33f0fc029c9d["test_length_based_example_selector.py"]
  6149161e_8515_bb02_5688_cbd65b869815 -->|defined in| 7e68d2d6_6314_1254_1bda_33f0fc029c9d
  style 6149161e_8515_bb02_5688_cbd65b869815 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/example_selectors/test_length_based_example_selector.py lines 17–24

def selector() -> LengthBasedExampleSelector:
    """Get length based selector to use in tests."""
    prompts = PromptTemplate(input_variables=["question"], template="{question}")
    return LengthBasedExampleSelector(
        examples=EXAMPLES,
        example_prompt=prompts,
        max_length=30,
    )

Subdomains

Frequently Asked Questions

What does selector() do?
selector() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/example_selectors/test_length_based_example_selector.py.
Where is selector() defined?
selector() is defined in libs/core/tests/unit_tests/example_selectors/test_length_based_example_selector.py at line 17.

Analyze Your Own Codebase

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

Try Supermodel Free