googleapis / googleapis/python-aiplatform

Bug: `async_stream_query` not async

Offen
#5,773 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
api: vertex-ai
Vorherrschende Sprache
Python
Sterne
905
Forks
465
Ø Merge
1 T. 13 Std.
Gemergte PRs (30 T.)
44

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.