mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-22 06:39:52 +00:00
standard-tests[patch]: test that bind_tools can accept regular python function (#24135)
This commit is contained in:
parent
2428984205
commit
7a62d3dbd6
@ -21,6 +21,11 @@ def my_adder_tool(a: int, b: int) -> int:
|
||||
return a + b
|
||||
|
||||
|
||||
def my_adder(a: int, b: int) -> int:
|
||||
"""Takes two integers, a and b, and returns their sum."""
|
||||
return a + b
|
||||
|
||||
|
||||
class ChatModelTests(ABC):
|
||||
@property
|
||||
@abstractmethod
|
||||
@ -108,7 +113,7 @@ class ChatModelUnitTests(ChatModelTests):
|
||||
return
|
||||
|
||||
tool_model = model.bind_tools(
|
||||
[Person, Person.schema(), my_adder_tool], tool_choice="any"
|
||||
[Person, Person.schema(), my_adder_tool, my_adder], tool_choice="any"
|
||||
)
|
||||
assert isinstance(tool_model, RunnableBinding)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user