Skip to content

Commit c1dfca6

Browse files
committed
Update tests to be compatible with new OpenAI, MistralAI and MCP versions
1 parent 81bd32b commit c1dfca6

File tree

7 files changed

+186
-14
lines changed

7 files changed

+186
-14
lines changed

docs/mcp/server.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ async def sampling_callback(
117117
SamplingMessage(
118118
role='user',
119119
content=TextContent(
120-
type='text', text='write a poem about socks', annotations=None
120+
type='text',
121+
text='write a poem about socks',
122+
annotations=None,
123+
meta=None,
121124
),
122125
)
123126
]

pydantic_ai_slim/pydantic_ai/mcp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def _map_tool_result_part(
240240
else:
241241
assert_never(resource)
242242
else:
243-
assert_never(part)
243+
assert_never(part) # type: ignore[arg-type]
244244

245245

246246
@dataclass

pydantic_ai_slim/pydantic_ai/models/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@
192192
'gpt-4o-audio-preview',
193193
'gpt-4o-audio-preview-2024-10-01',
194194
'gpt-4o-audio-preview-2024-12-17',
195+
'gpt-4o-audio-preview-2025-06-03',
195196
'gpt-4o-mini',
196197
'gpt-4o-mini-2024-07-18',
197198
'gpt-4o-mini-audio-preview',
@@ -242,6 +243,7 @@
242243
'o3-mini',
243244
'o3-mini-2025-01-31',
244245
'openai:chatgpt-4o-latest',
246+
'openai:codex-mini-latest',
245247
'openai:gpt-3.5-turbo',
246248
'openai:gpt-3.5-turbo-0125',
247249
'openai:gpt-3.5-turbo-0301',
@@ -274,6 +276,7 @@
274276
'openai:gpt-4o-audio-preview',
275277
'openai:gpt-4o-audio-preview-2024-10-01',
276278
'openai:gpt-4o-audio-preview-2024-12-17',
279+
'openai:gpt-4o-audio-preview-2025-06-03',
277280
'openai:gpt-4o-mini',
278281
'openai:gpt-4o-mini-2024-07-18',
279282
'openai:gpt-4o-mini-audio-preview',

pydantic_ai_slim/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ dependencies = [
6161
# WARNING if you add optional groups, please update docs/install.md
6262
logfire = ["logfire>=3.11.0"]
6363
# Models
64-
openai = ["openai>=1.76.0"]
64+
openai = ["openai>=1.86.0"]
6565
cohere = ["cohere>=5.13.11; platform_system != 'Emscripten'"]
6666
vertexai = ["google-auth>=2.36.0", "requests>=2.32.2"]
6767
google = ["google-genai>=1.15.0"]
@@ -75,7 +75,7 @@ tavily = ["tavily-python>=0.5.0"]
7575
# CLI
7676
cli = ["rich>=13", "prompt-toolkit>=3", "argcomplete>=3.5.0"]
7777
# MCP
78-
mcp = ["mcp>=1.9.4; python_version >= '3.10'"]
78+
mcp = ["mcp>=1.10.0; python_version >= '3.10'"]
7979
# Evals
8080
evals = ["pydantic-evals=={{ version }}"]
8181
# A2A

tests/models/test_mistral.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def completion_message(
123123
return MistralChatCompletionResponse(
124124
id='123',
125125
choices=[MistralChatCompletionChoice(finish_reason='stop', index=0, message=message)],
126-
created=1704067200 if with_created else None, # 2024-01-01
126+
created=1704067200 if with_created else 0, # 2024-01-01
127127
model='mistral-large-123',
128128
object='chat.completion',
129129
usage=usage or MistralUsageInfo(prompt_tokens=1, completion_tokens=1, total_tokens=1),

tests/test_mcp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ async def test_client_sampling():
982982
{
983983
'meta': None,
984984
'role': 'assistant',
985-
'content': {'type': 'text', 'text': 'sampling model response', 'annotations': None},
985+
'content': {'type': 'text', 'text': 'sampling model response', 'annotations': None, 'meta': None},
986986
'model': 'test',
987987
'stopReason': None,
988988
}

uv.lock

Lines changed: 174 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)