[azure-ai-projects] Support an HTTPX async transport for AnyIO/Trio applications

Aperta
#49,154 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
api, backend, devtools

Direzione di ricerca

The issue is about adding HTTPX async transport support to azure-ai-projects and azure-ai-inference. Start by reading the linked azure-core issue #41382 and the existing AsyncHttpXTransport in azure-core-experimental. Examine the generated async client in azure/ai/projects/aio/_client.py and the pyproject.toml dependencies. The goal is to allow using HTTPX instead of aiohttp, enabling Trio/AnyIO support while preserving the asyncio path. 'Done' means the async clients work with both asyncio and Trio backends via AnyIO, including authentication and streaming.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

AI Projects Client customer-reported question
Motivation

Microsoft Agent Framework is assessing support for applications running on either asyncio or Trio through AnyIO. Its Foundry integration uses azure.ai.projects.aio.AIProjectClient (and azure.ai.inference.aio for embeddings). The current azure-ai-projects package explicitly requires aiohttp, and these async clients use azure-core's pipeline, whose default async transport is aiohttp. HTTPX supports both asyncio and Trio; requiring aiohttp keeps this path tied to asyncio even if the calling framework uses AnyIO.

Request

Please make a supported HTTPX-based async transport available end to end for azure-ai-projects (and coordinate with azure-ai-inference and async identity/credential paths where needed), so callers can use Foundry async clients under Trio without requiring aiohttp. Replacing the default aiohttp transport with HTTPX would meet the need; if a change of default is too disruptive, a stable, documented HTTPX transport option that avoids a mandatory aiohttp dependency would also work. Preserve the existing asyncio path.

An application should be able to run the same AIProjectClient operation with anyio.run(main, backend="asyncio") and anyio.run(main, backend="trio"), including authentication, concurrent requests, response streaming, and clean cancellation/close. A transport substitution alone is insufficient if another layer still creates asyncio-only resources.

Related work and references
Lingua principale
Python
Stelle
5.6k
Fork
3.4k
Merge medio
1g 22h
PR unite (30g)
189

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Azure/azure-sdk-for-python

Tutte le issue di Azure/azure-sdk-for-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.