You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/models/openai.md
+15-1Lines changed: 15 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,21 @@ agent = Agent(model)
61
61
62
62
`OpenAIProvider` also accepts a custom`AsyncOpenAI` client via the`openai_client` parameter, so you can customise the`organization`,`project`,`base_url` etc. as defined in the[OpenAI API docs](https://platform.openai.com/docs/api-reference).
63
63
64
-
You could also use the[`AsyncAzureOpenAI`](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/switching-endpoints) client to use the Azure OpenAI API.
64
+
```python {title="custom_openai_client.py"}
65
+
from openaiimport AsyncOpenAI
66
+
67
+
from pydantic_aiimport Agent
68
+
from pydantic_ai.models.openaiimport OpenAIModel
69
+
from pydantic_ai.providers.openaiimport OpenAIProvider