Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Unable to deploy ADK Agent to Vertex AI Agent Engine due to type incompatibility #2018

@rlucasfm

Description

@rlucasfm

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:

  1. Install the dependencies:
    pip install google-adk google-cloud-aiplatform

  2. 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=[]
   )
  1. 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]"],
   )
  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent engine[Component] This issue is related to Agent Engine deploymentanswered[Status] This issue has been answered by the maintainerbot triaged[Bot] This issue is triaged by ADK bot

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions