googleapis / googleapis/python-aiplatform

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

Open
#5,454 0 comments 0 reactions 1 assignee Claimed by @DeanChensj View on GitHub
api: vertex-ai
Dominant language
Python
Stars
905
Forks
465
Avg merge
1d 13h
Merged PRs (30d)
44

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.