test_bind_tools() — langchain Function Reference
Architecture documentation for the test_bind_tools() function in test_chat_models.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD a03994b4_bf93_b529_bf83_3ed2227c0a1d["test_bind_tools()"] ab3fd66d_3ad7_be56_7427_66f2c1a9d0a8["test_chat_models.py"] a03994b4_bf93_b529_bf83_3ed2227c0a1d -->|defined in| ab3fd66d_3ad7_be56_7427_66f2c1a9d0a8 style a03994b4_bf93_b529_bf83_3ed2227c0a1d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/huggingface/tests/unit_tests/test_chat_models.py lines 209–222
def test_bind_tools(chat_hugging_face: Any) -> None:
tools = [MagicMock(spec=BaseTool)]
with (
patch(
"langchain_huggingface.chat_models.huggingface.convert_to_openai_tool",
side_effect=lambda x: x,
),
patch("langchain_core.runnables.base.Runnable.bind") as mock_super_bind,
):
chat_hugging_face.bind_tools(tools, tool_choice="auto")
mock_super_bind.assert_called_once()
_, kwargs = mock_super_bind.call_args
assert kwargs["tools"] == tools
assert kwargs["tool_choice"] == "auto"
Domain
Subdomains
Source
Frequently Asked Questions
What does test_bind_tools() do?
test_bind_tools() is a function in the langchain codebase, defined in libs/partners/huggingface/tests/unit_tests/test_chat_models.py.
Where is test_bind_tools() defined?
test_bind_tools() is defined in libs/partners/huggingface/tests/unit_tests/test_chat_models.py at line 209.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free