googleapis / googleapis/python-aiplatform

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

Đang mở
#5,454 0 bình luận 0 reaction 1 người được giao Được @DeanChensj nhận Xem trên GitHub
api: vertex-ai
Ngôn ngữ chính
Python
Star
905
Fork
465
Merge trung bình
1 ngày 13 giờ
Pull request đã merge (30 ngày)
44

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.