googleapis / googleapis/python-aiplatform

Bug: `async_stream_query` not async

Đang mở
#5,773 2 bình luận 0 reaction 0 người được giao 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ả

#### Environment details

- OS type and version: Linux 6.6.87.2-microsoft-standard-WSL2
- Python version: Python 3.11.9
- pip version: pip 25.2
- `google-cloud-aiplatform` version: 1.111.0

#### Steps to reproduce

1. Deploy a simple adk agent.
2. Run multiple async functions to call the agent's `async_stream_query` method.

#### Code example

```python
async def run_query(app, uid):
prompt = 'some prompts have delayed responses'
session = await app.async_create_session(user_id=uid)
async for event in app.async_stream_query(
user_id=uid,
session_id=session['id'],
message=prompt,
):
print(event)
await app.async_delete_session(user_id=uid, session_id=session['id'])

async def run():
agent = agent_engines.get(AGENT_ID)
await asyncio.gather(
run_query(agent, 'u1'),
run_query(agent, 'u2'),
run_query(agent, 'u3'),
)

if __name__ == '__main__':
asyncio.run(run())
```

#### Result

The requests are not sent concurrently to the Vertex AI Agent Engine.

Image

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.