William FH
c5a07e2dd8
core[patch]: add InjectedToolArg annotation (#24279)
```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>
2024-07-17 15:28:40 -07:00
..
2024-07-03 10:33:27 -07:00
2024-07-16 17:38:32 -04:00
2024-07-03 10:33:27 -07:00
2024-07-16 10:43:54 -04:00
2024-07-16 10:43:54 -04:00
2024-07-12 14:28:06 -04:00
2024-07-05 15:59:47 -04:00
2024-07-09 12:26:36 -07:00
2024-07-05 12:23:19 -04:00
2024-07-15 08:58:05 -07:00
2024-07-11 14:54:02 -07:00
2024-07-09 12:26:36 -07:00
2024-07-17 18:14:57 -04:00
2024-07-16 17:38:32 -04:00
2024-07-15 11:37:09 -04:00
2024-07-17 15:28:40 -07:00
2024-07-16 16:58:11 +00:00
2024-07-16 09:21:51 -04:00
2024-07-16 09:21:51 -04:00
2024-07-16 09:21:51 -04:00
2024-06-27 17:29:38 -04:00
2024-06-27 17:29:38 -04:00
2024-07-16 09:21:51 -04:00
2024-07-16 09:21:51 -04:00
2024-07-16 09:21:51 -04:00
2024-07-16 09:21:51 -04:00
2024-07-16 09:21:51 -04:00
2024-07-16 09:21:51 -04:00
2024-07-16 09:21:51 -04:00
2024-07-16 09:21:51 -04:00
2024-07-16 09:21:51 -04:00
2024-07-17 15:28:40 -07:00