test_selector_add_example() — langchain Function Reference
Architecture documentation for the test_selector_add_example() function in test_length_based_example_selector.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD c144f5c2_7fec_4a9a_fd60_3cf30a66e2b2["test_selector_add_example()"] 7e68d2d6_6314_1254_1bda_33f0fc029c9d["test_length_based_example_selector.py"] c144f5c2_7fec_4a9a_fd60_3cf30a66e2b2 -->|defined in| 7e68d2d6_6314_1254_1bda_33f0fc029c9d style c144f5c2_7fec_4a9a_fd60_3cf30a66e2b2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/example_selectors/test_length_based_example_selector.py lines 34–40
def test_selector_add_example(selector: LengthBasedExampleSelector) -> None:
"""Test LengthBasedExampleSelector can add an example."""
new_example = {"question": "Question: what are you?\nAnswer: bar"}
selector.add_example(new_example)
short_question = "Short question?"
output = selector.select_examples({"question": short_question})
assert output == [*EXAMPLES, new_example]
Domain
Subdomains
Source
Frequently Asked Questions
What does test_selector_add_example() do?
test_selector_add_example() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/example_selectors/test_length_based_example_selector.py.
Where is test_selector_add_example() defined?
test_selector_add_example() is defined in libs/core/tests/unit_tests/example_selectors/test_length_based_example_selector.py at line 34.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free