googleapis / googleapis/python-aiplatform

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

未关闭
#5,454 0 条评论 0 个 reaction 已指派 1 人 已被 @DeanChensj 认领 在 GitHub 查看
api: vertex-ai
主要语言
Python
星标
905
派生
465
平均合并
1 天 13 小时
30 天内合并 PR
44

描述

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.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。