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-06-14 16:52:30 +00:00
2024-07-01 14:21:21 -04:00
2024-07-11 02:25:12 +00:00
2024-04-24 12:47:25 -04:00
2024-04-16 11:39:23 -04:00
2024-07-03 10:33:27 -07:00
2024-07-01 15:07:30 -04:00
2024-03-18 10:01:26 -07:00
2024-07-03 10:33:27 -07:00
2024-01-02 15:00:06 -08:00
2024-07-05 20:10:54 +00:00
2024-07-11 18:54:46 +00:00
2024-07-15 15:51:43 +00:00
2023-11-21 15:15:48 -08:00
2024-07-15 08:58:05 -07:00
2024-07-03 10:33:27 -07:00
2024-04-10 15:54:06 -07:00
2024-07-17 18:14:57 -04:00
2024-07-12 09:52:44 -07:00
2024-04-30 13:14:26 -04:00
2024-06-06 16:03:44 -04:00
2024-07-10 19:29:59 -04:00
2024-07-08 14:11:51 -07:00
2024-07-03 10:33:27 -07:00
2024-04-02 01:18:36 +00:00
2024-07-05 12:24:10 -04:00
2024-07-03 15:55:15 -04:00
2024-07-13 08:59:03 -07:00
2023-11-21 08:35:29 -08:00
2024-01-08 12:20:18 -08:00
2024-07-17 15:28:40 -07:00