mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-26 22:05:29 +00:00
standard-tests[patch]: test that bind_tools can accept regular python function (#24135)
This commit is contained in:
@@ -21,6 +21,11 @@ def my_adder_tool(a: int, b: int) -> int:
|
|||||||
return a + b
|
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):
|
class ChatModelTests(ABC):
|
||||||
@property
|
@property
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
@@ -108,7 +113,7 @@ class ChatModelUnitTests(ChatModelTests):
|
|||||||
return
|
return
|
||||||
|
|
||||||
tool_model = model.bind_tools(
|
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)
|
assert isinstance(tool_model, RunnableBinding)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user