test_chat_xai_extra_kwargs() — langchain Function Reference
Architecture documentation for the test_chat_xai_extra_kwargs() function in test_chat_models.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD a7bd3b42_82f7_7a65_01fb_7bd931715687["test_chat_xai_extra_kwargs()"] d3aa2dec_5fef_73c8_892f_691289c5feaf["test_chat_models.py"] a7bd3b42_82f7_7a65_01fb_7bd931715687 -->|defined in| d3aa2dec_5fef_73c8_892f_691289c5feaf style a7bd3b42_82f7_7a65_01fb_7bd931715687 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/xai/tests/unit_tests/test_chat_models.py lines 52–65
def test_chat_xai_extra_kwargs() -> None:
"""Test extra kwargs to chat xai."""
# Check that foo is saved in extra_kwargs.
llm = ChatXAI(model=MODEL_NAME, 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 = ChatXAI(model=MODEL_NAME, 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):
ChatXAI(model=MODEL_NAME, foo=3, model_kwargs={"foo": 2}) # type: ignore[call-arg]
Domain
Subdomains
Source
Frequently Asked Questions
What does test_chat_xai_extra_kwargs() do?
test_chat_xai_extra_kwargs() is a function in the langchain codebase, defined in libs/partners/xai/tests/unit_tests/test_chat_models.py.
Where is test_chat_xai_extra_kwargs() defined?
test_chat_xai_extra_kwargs() is defined in libs/partners/xai/tests/unit_tests/test_chat_models.py at line 52.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free