mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-28 23:07:11 +00:00
```python from typing_extensions import Annotated from langchain_core.tools import tool, InjectedToolArg from langchain_anthropic import ChatAnthropic @tool def multiply(x: int, y: int, not_for_model: Annotated[dict, InjectedToolArg]) -> str: """multiply.""" return x * y ChatAnthropic(model='claude-3-sonnet-20240229',).bind_tools([multiply]).invoke('5 times 3').tool_calls ''' -> [{'name': 'multiply', 'args': {'x': 5, 'y': 3}, 'id': 'toolu_01Y1QazYWhu4R8vF4hF4z9no', 'type': 'tool_call'}] ''' ``` --------- Co-authored-by: Bagatur <baskaryan@gmail.com> Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
LangChain Documentation
For more information on contributing to our documentation, see the Documentation Contributing Guide