mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-01 15:22:37 +00:00
fix: update Pydantic schema access (#337)
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
This commit is contained in:
@@ -16,7 +16,7 @@ def test_creating_a_tool_using_annotation():
|
|||||||
my_tool.description
|
my_tool.description
|
||||||
== "Tool Name: Name of my tool\nTool Arguments: {'question': {'description': None, 'type': 'str'}}\nTool Description: Clear description for what this tool is useful for, you agent will need this information to use it."
|
== "Tool Name: Name of my tool\nTool Arguments: {'question': {'description': None, 'type': 'str'}}\nTool Description: Clear description for what this tool is useful for, you agent will need this information to use it."
|
||||||
)
|
)
|
||||||
assert my_tool.args_schema.schema()["properties"] == {
|
assert my_tool.args_schema.model_json_schema()["properties"] == {
|
||||||
"question": {"title": "Question", "type": "string"}
|
"question": {"title": "Question", "type": "string"}
|
||||||
}
|
}
|
||||||
assert (
|
assert (
|
||||||
@@ -30,7 +30,7 @@ def test_creating_a_tool_using_annotation():
|
|||||||
converted_tool.description
|
converted_tool.description
|
||||||
== "Tool Name: Name of my tool\nTool Arguments: {'question': {'description': None, 'type': 'str'}}\nTool Description: Clear description for what this tool is useful for, you agent will need this information to use it."
|
== "Tool Name: Name of my tool\nTool Arguments: {'question': {'description': None, 'type': 'str'}}\nTool Description: Clear description for what this tool is useful for, you agent will need this information to use it."
|
||||||
)
|
)
|
||||||
assert converted_tool.args_schema.schema()["properties"] == {
|
assert converted_tool.args_schema.model_json_schema()["properties"] == {
|
||||||
"question": {"title": "Question", "type": "string"}
|
"question": {"title": "Question", "type": "string"}
|
||||||
}
|
}
|
||||||
assert (
|
assert (
|
||||||
@@ -54,7 +54,7 @@ def test_creating_a_tool_using_baseclass():
|
|||||||
my_tool.description
|
my_tool.description
|
||||||
== "Tool Name: Name of my tool\nTool Arguments: {'question': {'description': None, 'type': 'str'}}\nTool Description: Clear description for what this tool is useful for, you agent will need this information to use it."
|
== "Tool Name: Name of my tool\nTool Arguments: {'question': {'description': None, 'type': 'str'}}\nTool Description: Clear description for what this tool is useful for, you agent will need this information to use it."
|
||||||
)
|
)
|
||||||
assert my_tool.args_schema.schema()["properties"] == {
|
assert my_tool.args_schema.model_json_schema()["properties"] == {
|
||||||
"question": {"title": "Question", "type": "string"}
|
"question": {"title": "Question", "type": "string"}
|
||||||
}
|
}
|
||||||
assert (
|
assert (
|
||||||
@@ -68,7 +68,7 @@ def test_creating_a_tool_using_baseclass():
|
|||||||
converted_tool.description
|
converted_tool.description
|
||||||
== "Tool Name: Name of my tool\nTool Arguments: {'question': {'description': None, 'type': 'str'}}\nTool Description: Clear description for what this tool is useful for, you agent will need this information to use it."
|
== "Tool Name: Name of my tool\nTool Arguments: {'question': {'description': None, 'type': 'str'}}\nTool Description: Clear description for what this tool is useful for, you agent will need this information to use it."
|
||||||
)
|
)
|
||||||
assert converted_tool.args_schema.schema()["properties"] == {
|
assert converted_tool.args_schema.model_json_schema()["properties"] == {
|
||||||
"question": {"title": "Question", "type": "string"}
|
"question": {"title": "Question", "type": "string"}
|
||||||
}
|
}
|
||||||
assert (
|
assert (
|
||||||
|
|||||||
Reference in New Issue
Block a user