File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
pydantic_ai_slim/pydantic_ai/providers Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -98,10 +98,16 @@ def __init__(
98
98
'or pass the API key via `VercelProvider(api_key=...)` to use the Vercel provider.'
99
99
)
100
100
101
+ default_headers = {'http-referer' : 'https://ai.pydantic.dev/' , 'x-title' : 'pydantic-ai' }
102
+
101
103
if openai_client is not None :
102
104
self ._client = openai_client
103
105
elif http_client is not None :
104
- self ._client = AsyncOpenAI (base_url = self .base_url , api_key = api_key , http_client = http_client )
106
+ self ._client = AsyncOpenAI (
107
+ base_url = self .base_url , api_key = api_key , http_client = http_client , default_headers = default_headers
108
+ )
105
109
else :
106
110
http_client = cached_async_http_client (provider = 'vercel' )
107
- self ._client = AsyncOpenAI (base_url = self .base_url , api_key = api_key , http_client = http_client )
111
+ self ._client = AsyncOpenAI (
112
+ base_url = self .base_url , api_key = api_key , http_client = http_client , default_headers = default_headers
113
+ )
You can’t perform that action at this time.
0 commit comments