Skip to content

Commit b017559

Browse files
authored
fix api types (#116)
1 parent d0293ef commit b017559

21 files changed

+1474
-263
lines changed

deploy/example.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const config: Config<ProviderKeys> = {
3737
},
3838
// providers
3939
providers: {
40-
// you would use this provider by using the model id `gateway:openai-chat/gpt-5` in Pydantic AI
40+
// you would use this provider by using the model id `gateway/openai-chat:gpt-5` in Pydantic AI
4141
a: {
4242
// providerId decides on the logic used to process the request and response
4343
providerId: 'openai',

examples/ex_openai.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
logfire.instrument_httpx(capture_all=True)
77

88
client = OpenAI(
9-
api_key='VOE4JMpVGr71RgvEEidPCXd4ov42L24ODw9q5RI7uYc',
9+
api_key='_api_key_',
1010
base_url='http://localhost:8787/openai',
11-
# base_url='https://pydantic-ai-gateway.pydantic.workers.dev/openai',
11+
# base_url='https://gateway.pydantic.dev/proxy/openai',
1212
)
1313

1414
response = client.responses.create(

examples/pai_anthropic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def validate_dob(cls, v: date) -> date:
2626

2727

2828
person_agent = Agent(
29-
'gateway:anthropic/claude-sonnet-4-0',
29+
'gateway/anthropic:claude-sonnet-4-0',
3030
output_type=Person,
3131
instructions='Extract information about the person',
3232
model_settings=AnthropicModelSettings(max_tokens=1024),

examples/pai_anthropic_builtin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
person_agent = Agent(
11-
'gateway:anthropic/claude-sonnet-4-0',
11+
'gateway/anthropic:claude-sonnet-4-0',
1212
instructions='Use the code execution tool to execute the code',
1313
model_settings=AnthropicModelSettings(max_tokens=1024),
1414
builtin_tools=[CodeExecutionTool()],

examples/pai_anthropic_otel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
agent = Agent(
18-
'gateway:anthropic/claude-sonnet-4-0',
18+
'gateway/anthropic:claude-sonnet-4-0',
1919
instructions='Extract information about the image.',
2020
model_settings=AnthropicModelSettings(
2121
anthropic_thinking={'type': 'enabled', 'budget_tokens': 1024},

examples/pai_anthropic_stream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
logfire.instrument_httpx(capture_all=True)
99

1010
person_agent = Agent(
11-
'gateway:anthropic/claude-sonnet-4-0',
11+
'gateway/anthropic:claude-sonnet-4-0',
1212
instructions='You are a helpful assistant.',
1313
model_settings={'max_tokens': 1024},
1414
retries=0,

examples/pai_anthropic_vertex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def validate_dob(cls, v: date) -> date:
3434
client = AsyncAnthropicVertex(
3535
base_url='http://localhost:8787/google-vertex', access_token=api_key, region='unknown', project_id='unknown'
3636
)
37-
provider = AnthropicProvider(anthropic_client=client) # type: ignore[reportUnknownArgumentType]
37+
provider = AnthropicProvider(anthropic_client=client)
3838
model = AnthropicModel('claude-sonnet-4', provider=provider)
3939

4040
person_agent = Agent(

examples/pai_google.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def validate_dob(cls, v: date) -> date:
2525

2626

2727
person_agent = Agent(
28-
'gateway:google-vertex/gemini-2.5-flash',
28+
'gateway/google-vertex:gemini-2.5-flash',
2929
output_type=Person,
3030
instructions='Extract information about the person',
3131
model_settings=GoogleModelSettings(stop_sequences=['potato'], temperature=0.5, top_p=0.9),

examples/pai_google_stream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
logfire.instrument_httpx(capture_all=True)
99

1010
person_agent = Agent(
11-
'gateway:google-vertex/gemini-2.5-flash',
11+
'gateway/google-vertex:gemini-2.5-flash',
1212
# 'google-vertex:gemini-2.5-flash',
1313
instructions='You are a helpful assistant.',
1414
model_settings={'max_tokens': 1024},

examples/pai_groq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def validate_dob(cls, v: date) -> date:
2626

2727

2828
person_agent = Agent(
29-
'gateway:groq/openai/gpt-oss-120b',
29+
'gateway/groq:openai/gpt-oss-120b',
3030
output_type=Person,
3131
instructions='Extract information about the person',
3232
model_settings=GroqModelSettings(stop_sequences=['potato'], temperature=0.5, top_p=0.9),

0 commit comments

Comments
 (0)