Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/examples/pydantic-ai-cdp-chatbot/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ requires-python = "~=3.10"
readme = "README.md"
dependencies = [
"python-dotenv>=1.0.1,<2",
"pydantic-ai>=0.4.0,<0.5",
"pydantic-ai>=1.63,<2",
"coinbase-agentkit",
"coinbase-agentkit-pydantic-ai",
]
Expand Down
4,512 changes: 3,020 additions & 1,492 deletions python/examples/pydantic-ai-cdp-chatbot/uv.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bumped pydantic-ai
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,19 @@ def invoke_tool(**kwargs: Any) -> str:

tool_function = make_tool_function(action)

tool = Tool(
tool_function, name=action.name, description=action.description, takes_ctx=False
)
json_schema: dict[str, Any]
if action.args_schema:
tool.function_schema.json_schema = action.args_schema.model_json_schema()

json_schema = action.args_schema.model_json_schema()
else:
json_schema = {"type": "object", "properties": {}, "additionalProperties": False}

tool = Tool.from_schema(
tool_function,
name=action.name,
description=action.description or "",
json_schema=json_schema,
takes_ctx=False,
)
tools.append(tool)

return tools
4 changes: 2 additions & 2 deletions python/framework-extensions/pydantic-ai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ dependencies = [
"coinbase-agentkit>=0.7.2,<0.8",
"python-dotenv>=1.0.1,<2",
"pytest-asyncio>=0.25.3,<0.26",
"pydantic-ai>=0.4.0,<0.5",
"pydantic-ai>=1.63,<2",
"setuptools>=69.0.3,<70",
"nest-asyncio>=1.6.0,<2",
"openai<=1.99.1"
"openai>=2.11.0"
]

[dependency-groups]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,12 @@ async def test_tool_compatibility_with_pydantic_ai(agent_kit: AgentKit) -> None:

# Verify the agent was created successfully
assert agent is not None
assert len(agent._function_tools) == len(tools)
# pydantic-ai 1.x uses _function_toolset, 0.x used _function_tools
if hasattr(agent, "_function_toolset"):
tool_count = len(agent._function_toolset.tools)
else:
tool_count = len(agent._function_tools)
assert tool_count == len(tools)

except Exception as e:
pytest.fail(f"Failed to create PydanticAI Agent with AgentKit tools: {e}")
Expand Down
1,239 changes: 1,057 additions & 182 deletions python/framework-extensions/pydantic-ai/uv.lock

Large diffs are not rendered by default.

Loading