googleapis / googleapis/python-aiplatform

Bug: `async_stream_query` not async

オープン
#5,773 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
api: vertex-ai
主要言語
Python
スター
905
フォーク
465
平均マージ
1日 13時間
マージ済み PR(30日)
44

説明

#### 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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。