Skip to content

Commit ba4a598

Browse files
Docs fix: use model provider prefix in all examples (#806)
1 parent 273ebee commit ba4a598

File tree

8 files changed

+16
-14
lines changed

8 files changed

+16
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ from pydantic_ai import Agent
7575

7676
# Define a very simple agent including the model to use, you can also set the model when running the agent.
7777
agent = Agent(
78-
'gemini-1.5-flash',
78+
'google-gla:gemini-1.5-flash',
7979
# Register a static system prompt using a keyword argument to the agent.
8080
# For more complex dynamically-generated system prompts, see the example below.
8181
system_prompt='Be concise, reply with one sentence.',

docs/agents.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ from pydantic_ai import Agent
110110
from pydantic_ai.exceptions import UsageLimitExceeded
111111
from pydantic_ai.usage import UsageLimits
112112

113-
agent = Agent('claude-3-5-sonnet-latest')
113+
agent = Agent('anthropic:claude-3-5-sonnet-latest')
114114

115115
result_sync = agent.run_sync(
116116
'What is the capital of Italy? Answer with just the city.',
@@ -152,7 +152,7 @@ class NeverResultType(TypedDict):
152152

153153

154154
agent = Agent(
155-
'claude-3-5-sonnet-latest',
155+
'anthropic:claude-3-5-sonnet-latest',
156156
retries=3,
157157
result_type=NeverResultType,
158158
system_prompt='Any time you get a response, call the `infinite_retry_tool` to produce another response.',

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Here's a minimal example of PydanticAI:
5353
from pydantic_ai import Agent
5454

5555
agent = Agent( # (1)!
56-
'gemini-1.5-flash',
56+
'google-gla:gemini-1.5-flash',
5757
system_prompt='Be concise, reply with one sentence.', # (2)!
5858
)
5959

docs/models.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ You can then use [`AnthropicModel`][pydantic_ai.models.anthropic.AnthropicModel]
124124
```py title="anthropic_model_by_name.py"
125125
from pydantic_ai import Agent
126126

127-
agent = Agent('claude-3-5-sonnet-latest')
127+
agent = Agent('anthropic:claude-3-5-sonnet-latest')
128128
...
129129
```
130130

docs/multi-agent-applications.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ joke_selection_agent = Agent( # (1)!
3131
'You must return just a single joke.'
3232
),
3333
)
34-
joke_generation_agent = Agent('gemini-1.5-flash', result_type=list[str]) # (2)!
34+
joke_generation_agent = Agent( # (2)!
35+
'google-gla:gemini-1.5-flash', result_type=list[str]
36+
)
3537

3638

3739
@joke_selection_agent.tool

docs/results.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class CityLocation(BaseModel):
1414
country: str
1515

1616

17-
agent = Agent('gemini-1.5-flash', result_type=CityLocation)
17+
agent = Agent('google-gla:gemini-1.5-flash', result_type=CityLocation)
1818
result = agent.run_sync('Where were the olympics held in 2012?')
1919
print(result.data)
2020
#> city='London' country='United Kingdom'
@@ -129,7 +129,7 @@ class InvalidRequest(BaseModel):
129129

130130
Response = Union[Success, InvalidRequest]
131131
agent: Agent[DatabaseConn, Response] = Agent(
132-
'gemini-1.5-flash',
132+
'google-gla:gemini-1.5-flash',
133133
result_type=Response, # type: ignore
134134
deps_type=DatabaseConn,
135135
system_prompt='Generate PostgreSQL flavored SQL queries based on user input.',
@@ -171,7 +171,7 @@ Example of streamed text result:
171171
```python {title="streamed_hello_world.py" line_length="120"}
172172
from pydantic_ai import Agent
173173

174-
agent = Agent('gemini-1.5-flash') # (1)!
174+
agent = Agent('google-gla:gemini-1.5-flash') # (1)!
175175

176176

177177
async def main():
@@ -197,7 +197,7 @@ We can also stream text as deltas rather than the entire text in each item:
197197
```python {title="streamed_delta_hello_world.py"}
198198
from pydantic_ai import Agent
199199

200-
agent = Agent('gemini-1.5-flash')
200+
agent = Agent('google-gla:gemini-1.5-flash')
201201

202202

203203
async def main():

docs/testing-evals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ CREATE TABLE records (
346346

347347

348348
sql_agent = Agent(
349-
'gemini-1.5-flash',
349+
'google-gla:gemini-1.5-flash',
350350
deps_type=SqlSystemPrompt,
351351
)
352352

docs/tools.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import random
2525
from pydantic_ai import Agent, RunContext
2626

2727
agent = Agent(
28-
'gemini-1.5-flash', # (1)!
28+
'google-gla:gemini-1.5-flash', # (1)!
2929
deps_type=str, # (2)!
3030
system_prompt=(
3131
"You're a dice game, you should roll the die and see if the number "
@@ -202,12 +202,12 @@ def get_player_name(ctx: RunContext[str]) -> str:
202202

203203

204204
agent_a = Agent(
205-
'gemini-1.5-flash',
205+
'google-gla:gemini-1.5-flash',
206206
deps_type=str,
207207
tools=[roll_die, get_player_name], # (1)!
208208
)
209209
agent_b = Agent(
210-
'gemini-1.5-flash',
210+
'google-gla:gemini-1.5-flash',
211211
deps_type=str,
212212
tools=[ # (2)!
213213
Tool(roll_die, takes_ctx=False),

0 commit comments

Comments
 (0)