Home / Function/ has_tool_choice() — langchain Function Reference

has_tool_choice() — langchain Function Reference

Architecture documentation for the has_tool_choice() function in chat_models.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  d6d27d09_54e0_612e_b33f_f444ed07eb9c["has_tool_choice()"]
  93a85b25_a139_159d_bcf5_03a6e2ed4dd3["ChatModelTests"]
  d6d27d09_54e0_612e_b33f_f444ed07eb9c -->|defined in| 93a85b25_a139_159d_bcf5_03a6e2ed4dd3
  style d6d27d09_54e0_612e_b33f_f444ed07eb9c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/standard-tests/langchain_tests/unit_tests/chat_models.py lines 99–104

    def has_tool_choice(self) -> bool:
        """Whether the model supports tool calling."""
        bind_tools_params = inspect.signature(
            self.chat_model_class.bind_tools
        ).parameters
        return "tool_choice" in bind_tools_params

Domain

Subdomains

Frequently Asked Questions

What does has_tool_choice() do?
has_tool_choice() is a function in the langchain codebase, defined in libs/standard-tests/langchain_tests/unit_tests/chat_models.py.
Where is has_tool_choice() defined?
has_tool_choice() is defined in libs/standard-tests/langchain_tests/unit_tests/chat_models.py at line 99.

Analyze Your Own Codebase

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

Try Supermodel Free