We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 02f7396 commit 933cd10Copy full SHA for 933cd10
1 file changed
examples/pydantic_ai_integration.py
@@ -27,15 +27,17 @@
27
28
29
def _to_pydantic_ai_tool(stackone_tool) -> Tool:
30
- """Convert a StackOneTool to a Pydantic AI Tool using the public API."""
+ """Convert a StackOneTool to a Pydantic AI Tool with the proper JSON schema."""
31
+ params_schema = stackone_tool.to_openai_function()["function"]["parameters"]
32
33
def execute(**kwargs: object) -> str:
34
return json.dumps(stackone_tool.execute(kwargs))
35
- return Tool(
36
+ return Tool.from_schema(
37
execute,
38
name=stackone_tool.name,
39
description=stackone_tool.description,
40
+ json_schema=params_schema,
41
)
42
43
0 commit comments