test_extra_kwargs() — langchain Function Reference
Architecture documentation for the test_extra_kwargs() function in test_chat_models.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 30eafbff_933e_882e_64c0_0955c02fb5c4["test_extra_kwargs()"] aaa4b344_20ed_7fa3_4067_f8f05affc01f["test_chat_models.py"] 30eafbff_933e_882e_64c0_0955c02fb5c4 -->|defined in| aaa4b344_20ed_7fa3_4067_f8f05affc01f style 30eafbff_933e_882e_64c0_0955c02fb5c4 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/mistralai/tests/unit_tests/test_chat_models.py lines 316–328
def test_extra_kwargs() -> None:
# Check that foo is saved in extra_kwargs.
llm = ChatMistralAI(model="my-model", foo=3, max_tokens=10) # type: ignore[call-arg]
assert llm.max_tokens == 10
assert llm.model_kwargs == {"foo": 3}
# Test that if extra_kwargs are provided, they are added to it.
llm = ChatMistralAI(model="my-model", foo=3, model_kwargs={"bar": 2}) # type: ignore[call-arg]
assert llm.model_kwargs == {"foo": 3, "bar": 2}
# Test that if provided twice it errors
with pytest.raises(ValueError):
ChatMistralAI(model="my-model", foo=3, model_kwargs={"foo": 2}) # type: ignore[call-arg]
Domain
Subdomains
Source
Frequently Asked Questions
What does test_extra_kwargs() do?
test_extra_kwargs() is a function in the langchain codebase, defined in libs/partners/mistralai/tests/unit_tests/test_chat_models.py.
Where is test_extra_kwargs() defined?
test_extra_kwargs() is defined in libs/partners/mistralai/tests/unit_tests/test_chat_models.py at line 316.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free