Skip to content

Agent Engine, ADK agent: no Response Returned for streamQuery for deployed Agent Engine instance #5454

Open
@adrianthompson-lh

Description

@adrianthompson-lh

I have a simple ADK agent written in Python working locally. However when i deploy to Agent Engine and try and query it, it does not return any response.

I've created and deployed an adk agent to Agent Engine which I can see is running and listed in the console. Everything seems to be working fine however if I call the api or interact via vertexai I do not receive any response

Using API call
https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/europe-west2/reasoningEngines/ENGINEID:streamQuery?alt=sse
The response I get is a 200 but is always empty.

Using VertexAI

def send_message(resource_id: str, message: str) -> None:
    """Send a message to the deployed agent."""
    remote_agent = agent_engines.get(resource_id)
   
    print(f"Trying remote agent: {resource_id}")
    for event in remote_agent.stream_query(
        user_id="user101",
        session_id="888888888888", //just hard coding this for now
        message=message,
    ):
        print(event)
    print("Done.")

The result is just an empty response.

This is my deployment code:

    remote_agent = agent_engines.create(
        app,
        requirements=[
        "google-cloud-aiplatform[adk,agent-engines]",
        "google-adk",
        "python-dotenv",
        "google-auth",
        "tqdm",
        "requests",
        "absl-py",
        ],
        extra_packages=[
            "./agent_aura",  # The main package
        ], 
        display_name="Agent Aura"
    )

If I create the adk app locally and try and query everything works as expected including trace logs.

app = AdkApp(
    agent=root_agent, 
    enable_tracing=True 
)

session  = app.create_session(user_id="user_123")
print(f"session created for{session}")


for event in app.stream_query(
    user_id="user_123",
    session_id=session.id,
    message="hello there"
):
    print(event)

I can't see any errors in the logs when I deploy the app and there are no trace logs if I try and interact with the deployed agent so there is definitely something wrong somewhere.

Metadata

Metadata

Assignees

Labels

api: vertex-aiIssues related to the googleapis/python-aiplatform API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions