Skip to content

Commit 75845d1

Browse files
authored
Update Documentation for Provider arguments in google.md (#1946)
1 parent 4f257bd commit 75845d1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/models/google.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,22 @@ agent = Agent(model)
107107

108108
## Provider Argument
109109

110-
You can provide a custom `Provider` via the `provider` argument, for example to use a pre-initialized `genai.Client` or to customize authentication:
110+
You can supply a custom `GoogleProvider` instance using the `provider` argument to configure advanced client options, such as setting a custom `base_url`.
111+
112+
This is useful if you're using a custom-compatible endpoint with the Google Generative Language API.
111113

112114
```python
113115
from google import genai
116+
from google.genai.types import HttpOptions
114117

115118
from pydantic_ai import Agent
116119
from pydantic_ai.models.google import GoogleModel
117120
from pydantic_ai.providers.google import GoogleProvider
118121

119-
client = genai.Client()
122+
client = genai.Client(
123+
api_key='gemini-custom-api-key',
124+
http_options=HttpOptions(base_url='gemini-custom-base-url')
125+
)
120126
provider = GoogleProvider(client=client)
121127
model = GoogleModel('gemini-1.5-flash', provider=provider)
122128
agent = Agent(model)

0 commit comments

Comments
 (0)