Python: Fix user agent prefix (#5455)

* Fix hosting user agent missing

* Fix other providers

* Add more tests

* comments

* Fix tests
This commit is contained in:
Tao Chen
2026-04-23 23:40:38 +00:00
committed by GitHub
parent b084d0461d
commit 0989e68d1c
21 changed files with 290 additions and 130 deletions
@@ -11,7 +11,7 @@ from typing import Any, Literal, TypeVar, Union, overload
from uuid import uuid4
import httpx
from agent_framework import AGENT_FRAMEWORK_USER_AGENT
from agent_framework._telemetry import get_user_agent
from agent_framework.observability import get_tracer
from azure.core.credentials import TokenCredential
from azure.core.credentials_async import AsyncTokenCredential
@@ -189,7 +189,7 @@ class PurviewClient:
payload = model.model_dump(by_alias=True, exclude_none=True, mode="json")
request_headers = {
"Authorization": f"Bearer {token}",
"User-Agent": AGENT_FRAMEWORK_USER_AGENT,
"User-Agent": get_user_agent(),
"Content-Type": "application/json",
}
if correlation_id: