-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Describe the bug
When trying to deploy an agent created with ADK using the agent_engines.create method from the Vertex AI SDK, the following type error occurs:
Argument of type "Agent" cannot be assigned to parameter "agent_engine" of type "Queryable | OperationRegistrable | None" in function "create"
"Agent" cannot be assigned to type "Queryable | OperationRegistrable | None"
"LlmAgent" is incompatible with protocol "Queryable"
"query" is missing
"LlmAgent" is incompatible with protocol "OperationRegistrable"
"register_operations" is missing
"LlmAgent" cannot be assigned to "None"
To Reproduce
Steps to reproduce the error:
-
Install the dependencies:
pip install google-adk google-cloud-aiplatform
-
Create an agent with ADK:
from google.adk.agents import Agent
root_agent = Agent(
name="metereology_agent",
model="gemini-2.5-flash",
instruction="...",
description="...",
tools=[]
)
- Try to deploy with Agent Engine:
from vertexai import agent_engines
remote_app = agent_engines.create(
agent_engine=root_agent,
requirements=["google-cloud-aiplatform[agent_engines,adk]"],
)
OR
from vertexai import agent_engines
remote_app = agent_engines.create(
agent_engine=app,
requirements=["google-cloud-aiplatform[agent_engines,adk]"],
)
- See the type error above
Expected behavior
It was expected to be possible to deploy an agent created with ADK directly to the Vertex AI Agent Engine, as suggested by the documentation and the integration between the libraries.
Screenshots Not applicable, type error at development time.
Desktop (please complete the following information):
OS: macOS Sonoma 14.5
Python version: 3.12.7
ADK version: 1.7.0
Model Information:
Model: gemini-2.0-flash
Additional context
The error suggests that the Agent type from ADK does not implement the expected protocols (Queryable or OperationRegistrable) required by the agent_engines.create method.