pydantic-ai 0.0.42__tar.gz → 0.0.43__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/PKG-INFO +3 -3
  2. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/pyproject.toml +3 -3
  3. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/test_anthropic.py +1 -1
  4. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/test_bedrock.py +12 -3
  5. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/test_cohere.py +1 -1
  6. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/test_gemini.py +1 -1
  7. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/test_groq.py +1 -1
  8. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/test_mistral.py +6 -6
  9. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/test_model_function.py +1 -1
  10. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/test_openai.py +1 -1
  11. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/providers/test_google_vertex.py +6 -5
  12. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/test_agent.py +15 -10
  13. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/test_logfire.py +2 -2
  14. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/.gitignore +0 -0
  15. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/LICENSE +0 -0
  16. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/Makefile +0 -0
  17. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/README.md +0 -0
  18. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/__init__.py +0 -0
  19. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/assets/dummy.pdf +0 -0
  20. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/assets/kiwi.png +0 -0
  21. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/assets/marcelo.mp3 +0 -0
  22. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/cassettes/test_mcp/test_agent_with_stdio_server.yaml +0 -0
  23. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/conftest.py +0 -0
  24. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/example_modules/README.md +0 -0
  25. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/example_modules/bank_database.py +0 -0
  26. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/example_modules/fake_database.py +0 -0
  27. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/example_modules/weather_service.py +0 -0
  28. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/graph/__init__.py +0 -0
  29. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/graph/test_file_persistence.py +0 -0
  30. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/graph/test_graph.py +0 -0
  31. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/graph/test_mermaid.py +0 -0
  32. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/graph/test_persistence.py +0 -0
  33. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/graph/test_state.py +0 -0
  34. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/graph/test_utils.py +0 -0
  35. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/import_examples.py +0 -0
  36. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/json_body_serializer.py +0 -0
  37. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/mcp_server.py +0 -0
  38. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/__init__.py +0 -0
  39. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_anthropic/test_document_binary_content_input.yaml +0 -0
  40. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_anthropic/test_document_url_input.yaml +0 -0
  41. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_anthropic/test_image_url_input.yaml +0 -0
  42. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_anthropic/test_image_url_input_invalid_mime_type.yaml +0 -0
  43. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_anthropic/test_multiple_parallel_tool_calls.yaml +0 -0
  44. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_anthropic/test_text_document_url_input.yaml +0 -0
  45. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_bedrock/test_bedrock_model.yaml +0 -0
  46. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_bedrock/test_bedrock_model_anthropic_model_without_tools.yaml +0 -0
  47. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_bedrock/test_bedrock_model_iter_stream.yaml +0 -0
  48. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_bedrock/test_bedrock_model_max_tokens.yaml +0 -0
  49. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_bedrock/test_bedrock_model_retry.yaml +0 -0
  50. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_bedrock/test_bedrock_model_stream.yaml +0 -0
  51. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_bedrock/test_bedrock_model_structured_response.yaml +0 -0
  52. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_bedrock/test_bedrock_model_top_p.yaml +0 -0
  53. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_bedrock/test_document_url_input.yaml +0 -0
  54. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_bedrock/test_image_as_binary_content_input.yaml +0 -0
  55. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_bedrock/test_image_url_input.yaml +0 -0
  56. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_bedrock/test_text_as_binary_content_input.yaml +0 -0
  57. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_bedrock/test_text_document_url_input.yaml +0 -0
  58. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_gemini/test_document_url_input.yaml +0 -0
  59. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_gemini/test_image_as_binary_content_input.yaml +0 -0
  60. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_gemini/test_image_url_input.yaml +0 -0
  61. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_groq/test_image_as_binary_content_input.yaml +0 -0
  62. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_groq/test_image_url_input.yaml +0 -0
  63. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_openai/test_audio_as_binary_content_input.yaml +0 -0
  64. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_openai/test_document_url_input.yaml +0 -0
  65. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_openai/test_image_as_binary_content_input.yaml +0 -0
  66. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_openai/test_openai_o1_mini_system_role[developer].yaml +0 -0
  67. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/cassettes/test_openai/test_openai_o1_mini_system_role[system].yaml +0 -0
  68. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/mock_async_stream.py +0 -0
  69. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/test_fallback.py +0 -0
  70. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/test_instrumented.py +0 -0
  71. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/test_model.py +0 -0
  72. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/test_model_names.py +0 -0
  73. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/test_model_test.py +0 -0
  74. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/models/test_vertexai.py +0 -0
  75. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/providers/__init__.py +0 -0
  76. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/providers/cassettes/test_azure/test_azure_provider_call.yaml +0 -0
  77. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/providers/test_anthropic.py +0 -0
  78. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/providers/test_azure.py +0 -0
  79. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/providers/test_bedrock.py +0 -0
  80. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/providers/test_deepseek.py +0 -0
  81. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/providers/test_google_gla.py +0 -0
  82. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/providers/test_groq.py +0 -0
  83. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/providers/test_mistral.py +0 -0
  84. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/providers/test_provider_names.py +0 -0
  85. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/test_cli.py +0 -0
  86. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/test_deps.py +0 -0
  87. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/test_examples.py +0 -0
  88. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/test_format_as_xml.py +0 -0
  89. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/test_json_body_serializer.py +0 -0
  90. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/test_live.py +0 -0
  91. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/test_mcp.py +0 -0
  92. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/test_messages.py +0 -0
  93. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/test_parts_manager.py +0 -0
  94. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/test_streaming.py +0 -0
  95. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/test_tools.py +0 -0
  96. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/test_usage_limits.py +0 -0
  97. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/test_utils.py +0 -0
  98. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/typed_agent.py +0 -0
  99. {pydantic_ai-0.0.42 → pydantic_ai-0.0.43}/tests/typed_graph.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydantic-ai
3
- Version: 0.0.42
3
+ Version: 0.0.43
4
4
  Summary: Agent Framework / shim to use Pydantic with LLMs
5
5
  Project-URL: Homepage, https://ai.pydantic.dev
6
6
  Project-URL: Source, https://github.com/pydantic/pydantic-ai
@@ -28,9 +28,9 @@ Classifier: Topic :: Internet
28
28
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
29
29
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
30
30
  Requires-Python: >=3.9
31
- Requires-Dist: pydantic-ai-slim[anthropic,bedrock,cli,cohere,groq,mcp,mistral,openai,vertexai]==0.0.42
31
+ Requires-Dist: pydantic-ai-slim[anthropic,bedrock,cli,cohere,groq,mcp,mistral,openai,vertexai]==0.0.43
32
32
  Provides-Extra: examples
33
- Requires-Dist: pydantic-ai-examples==0.0.42; extra == 'examples'
33
+ Requires-Dist: pydantic-ai-examples==0.0.43; extra == 'examples'
34
34
  Provides-Extra: logfire
35
35
  Requires-Dist: logfire>=2.3; extra == 'logfire'
36
36
  Description-Content-Type: text/markdown
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "pydantic-ai"
7
- version = "0.0.42"
7
+ version = "0.0.43"
8
8
  description = "Agent Framework / shim to use Pydantic with LLMs"
9
9
  authors = [
10
10
  { name = "Samuel Colvin", email = "samuel@pydantic.dev" },
@@ -36,7 +36,7 @@ classifiers = [
36
36
  ]
37
37
  requires-python = ">=3.9"
38
38
  dependencies = [
39
- "pydantic-ai-slim[openai,vertexai,groq,anthropic,mistral,cohere,bedrock,cli,mcp]==0.0.42",
39
+ "pydantic-ai-slim[openai,vertexai,groq,anthropic,mistral,cohere,bedrock,cli,mcp]==0.0.43",
40
40
  ]
41
41
 
42
42
  [project.urls]
@@ -46,7 +46,7 @@ Documentation = "https://ai.pydantic.dev"
46
46
  Changelog = "https://github.com/pydantic/pydantic-ai/releases"
47
47
 
48
48
  [project.optional-dependencies]
49
- examples = ["pydantic-ai-examples==0.0.42"]
49
+ examples = ["pydantic-ai-examples==0.0.43"]
50
50
  logfire = ["logfire>=2.3"]
51
51
 
52
52
  [tool.uv.sources]
@@ -254,7 +254,7 @@ async def test_request_tool_call(allow_model_requests: None):
254
254
  [
255
255
  ModelRequest(
256
256
  parts=[
257
- SystemPromptPart(content='this is the system prompt'),
257
+ SystemPromptPart(content='this is the system prompt', timestamp=IsNow(tz=timezone.utc)),
258
258
  UserPromptPart(content='hello', timestamp=IsNow(tz=timezone.utc)),
259
259
  ]
260
260
  ),
@@ -73,7 +73,10 @@ async def test_bedrock_model(allow_model_requests: None, bedrock_provider: Bedro
73
73
  [
74
74
  ModelRequest(
75
75
  parts=[
76
- SystemPromptPart(content='You are a chatbot.'),
76
+ SystemPromptPart(
77
+ content='You are a chatbot.',
78
+ timestamp=IsDatetime(),
79
+ ),
77
80
  UserPromptPart(
78
81
  content='Hello!',
79
82
  timestamp=IsDatetime(),
@@ -122,7 +125,10 @@ async def test_bedrock_model_structured_response(allow_model_requests: None, bed
122
125
  [
123
126
  ModelRequest(
124
127
  parts=[
125
- SystemPromptPart(content='You are a helpful chatbot.'),
128
+ SystemPromptPart(
129
+ content='You are a helpful chatbot.',
130
+ timestamp=IsDatetime(),
131
+ ),
126
132
  UserPromptPart(
127
133
  content='What was the temperature in London 1st January 2022?',
128
134
  timestamp=IsDatetime(),
@@ -242,7 +248,10 @@ async def test_bedrock_model_retry(allow_model_requests: None, bedrock_provider:
242
248
  [
243
249
  ModelRequest(
244
250
  parts=[
245
- SystemPromptPart(content='You are a helpful chatbot.'),
251
+ SystemPromptPart(
252
+ content='You are a helpful chatbot.',
253
+ timestamp=IsDatetime(),
254
+ ),
246
255
  UserPromptPart(
247
256
  content='What is the capital of France?',
248
257
  timestamp=IsDatetime(),
@@ -259,7 +259,7 @@ async def test_request_tool_call(allow_model_requests: None):
259
259
  [
260
260
  ModelRequest(
261
261
  parts=[
262
- SystemPromptPart(content='this is the system prompt'),
262
+ SystemPromptPart(content='this is the system prompt', timestamp=IsNow(tz=timezone.utc)),
263
263
  UserPromptPart(content='Hello', timestamp=IsNow(tz=timezone.utc)),
264
264
  ]
265
265
  ),
@@ -559,7 +559,7 @@ async def test_request_tool_call(get_gemini_client: GetGeminiClient):
559
559
  [
560
560
  ModelRequest(
561
561
  parts=[
562
- SystemPromptPart(content='this is the system prompt'),
562
+ SystemPromptPart(content='this is the system prompt', timestamp=IsNow(tz=timezone.utc)),
563
563
  UserPromptPart(content='Hello', timestamp=IsNow(tz=timezone.utc)),
564
564
  ]
565
565
  ),
@@ -273,7 +273,7 @@ async def test_request_tool_call(allow_model_requests: None):
273
273
  [
274
274
  ModelRequest(
275
275
  parts=[
276
- SystemPromptPart(content='this is the system prompt'),
276
+ SystemPromptPart(content='this is the system prompt', timestamp=IsNow(tz=timezone.utc)),
277
277
  UserPromptPart(content='Hello', timestamp=IsNow(tz=timezone.utc)),
278
278
  ]
279
279
  ),
@@ -504,7 +504,7 @@ async def test_request_result_type_with_arguments_str_response(allow_model_reque
504
504
  [
505
505
  ModelRequest(
506
506
  parts=[
507
- SystemPromptPart(content='System prompt value'),
507
+ SystemPromptPart(content='System prompt value', timestamp=IsNow(tz=timezone.utc)),
508
508
  UserPromptPart(content='User prompt value', timestamp=IsNow(tz=timezone.utc)),
509
509
  ]
510
510
  ),
@@ -1070,7 +1070,7 @@ async def test_request_tool_call(allow_model_requests: None):
1070
1070
  [
1071
1071
  ModelRequest(
1072
1072
  parts=[
1073
- SystemPromptPart(content='this is the system prompt'),
1073
+ SystemPromptPart(content='this is the system prompt', timestamp=IsNow(tz=timezone.utc)),
1074
1074
  UserPromptPart(content='Hello', timestamp=IsNow(tz=timezone.utc)),
1075
1075
  ]
1076
1076
  ),
@@ -1207,7 +1207,7 @@ async def test_request_tool_call_with_result_type(allow_model_requests: None):
1207
1207
  [
1208
1208
  ModelRequest(
1209
1209
  parts=[
1210
- SystemPromptPart(content='this is the system prompt'),
1210
+ SystemPromptPart(content='this is the system prompt', timestamp=IsNow(tz=timezone.utc)),
1211
1211
  UserPromptPart(content='Hello', timestamp=IsNow(tz=timezone.utc)),
1212
1212
  ]
1213
1213
  ),
@@ -1347,7 +1347,7 @@ async def test_stream_tool_call_with_return_type(allow_model_requests: None):
1347
1347
  [
1348
1348
  ModelRequest(
1349
1349
  parts=[
1350
- SystemPromptPart(content='this is the system prompt'),
1350
+ SystemPromptPart(content='this is the system prompt', timestamp=IsNow(tz=timezone.utc)),
1351
1351
  UserPromptPart(content='User prompt value', timestamp=IsNow(tz=timezone.utc)),
1352
1352
  ]
1353
1353
  ),
@@ -1447,7 +1447,7 @@ async def test_stream_tool_call(allow_model_requests: None):
1447
1447
  [
1448
1448
  ModelRequest(
1449
1449
  parts=[
1450
- SystemPromptPart(content='this is the system prompt'),
1450
+ SystemPromptPart(content='this is the system prompt', timestamp=IsNow(tz=timezone.utc)),
1451
1451
  UserPromptPart(content='User prompt value', timestamp=IsNow(tz=timezone.utc)),
1452
1452
  ]
1453
1453
  ),
@@ -1550,7 +1550,7 @@ async def test_stream_tool_call_with_retry(allow_model_requests: None):
1550
1550
  [
1551
1551
  ModelRequest(
1552
1552
  parts=[
1553
- SystemPromptPart(content='this is the system prompt'),
1553
+ SystemPromptPart(content='this is the system prompt', timestamp=IsNow(tz=timezone.utc)),
1554
1554
  UserPromptPart(content='User prompt value', timestamp=IsNow(tz=timezone.utc)),
1555
1555
  ]
1556
1556
  ),
@@ -339,7 +339,7 @@ def test_call_all():
339
339
  [
340
340
  ModelRequest(
341
341
  parts=[
342
- SystemPromptPart(content='foobar'),
342
+ SystemPromptPart(content='foobar', timestamp=IsNow(tz=timezone.utc)),
343
343
  UserPromptPart(content='Hello', timestamp=IsNow(tz=timezone.utc)),
344
344
  ]
345
345
  ),
@@ -322,7 +322,7 @@ async def test_request_tool_call(allow_model_requests: None):
322
322
  [
323
323
  ModelRequest(
324
324
  parts=[
325
- SystemPromptPart(content='this is the system prompt'),
325
+ SystemPromptPart(content='this is the system prompt', timestamp=IsNow(tz=timezone.utc)),
326
326
  UserPromptPart(content='Hello', timestamp=IsNow(tz=timezone.utc)),
327
327
  ]
328
328
  ),
@@ -57,7 +57,10 @@ async def test_google_vertex_provider_auth(allow_model_requests: None, http_clie
57
57
  await provider.client.post('/gemini-1.0-pro:generateContent')
58
58
  assert provider.region == 'us-central1'
59
59
  assert getattr(provider.client.auth, 'project_id') == 'my-project-id'
60
- assert getattr(provider.client.auth, 'token_created') is not None
60
+
61
+
62
+ async def mock_refresh_token():
63
+ return 'my-token'
61
64
 
62
65
 
63
66
  async def test_google_vertex_provider_service_account_file(
@@ -67,11 +70,10 @@ async def test_google_vertex_provider_service_account_file(
67
70
  save_service_account(service_account_path, 'my-project-id')
68
71
 
69
72
  provider = GoogleVertexProvider(service_account_file=service_account_path)
70
- monkeypatch.setattr(provider.client.auth, '_refresh_token', lambda: 'my-token')
73
+ monkeypatch.setattr(provider.client.auth, '_refresh_token', mock_refresh_token)
71
74
  await provider.client.post('/gemini-1.0-pro:generateContent')
72
75
  assert provider.region == 'us-central1'
73
76
  assert getattr(provider.client.auth, 'project_id') == 'my-project-id'
74
- assert getattr(provider.client.auth, 'token_created') is not None
75
77
 
76
78
 
77
79
  async def test_google_vertex_provider_service_account_file_info(
@@ -80,11 +82,10 @@ async def test_google_vertex_provider_service_account_file_info(
80
82
  account_info = prepare_service_account_contents('my-project-id')
81
83
 
82
84
  provider = GoogleVertexProvider(service_account_info=account_info)
83
- monkeypatch.setattr(provider.client.auth, '_refresh_token', lambda: 'my-token')
85
+ monkeypatch.setattr(provider.client.auth, '_refresh_token', mock_refresh_token)
84
86
  await provider.client.post('/gemini-1.0-pro:generateContent')
85
87
  assert provider.region == 'us-central1'
86
88
  assert getattr(provider.client.auth, 'project_id') == 'my-project-id'
87
- assert getattr(provider.client.auth, 'token_created') is not None
88
89
 
89
90
 
90
91
  async def test_google_vertex_provider_service_account_xor(allow_model_requests: None):
@@ -514,7 +514,7 @@ def test_run_with_history_new():
514
514
  [
515
515
  ModelRequest(
516
516
  parts=[
517
- SystemPromptPart(content='Foobar'),
517
+ SystemPromptPart(content='Foobar', timestamp=IsNow(tz=timezone.utc)),
518
518
  UserPromptPart(content='Hello', timestamp=IsNow(tz=timezone.utc)),
519
519
  ]
520
520
  ),
@@ -538,7 +538,7 @@ def test_run_with_history_new():
538
538
  [
539
539
  ModelRequest(
540
540
  parts=[
541
- SystemPromptPart(content='Foobar'),
541
+ SystemPromptPart(content='Foobar', timestamp=IsNow(tz=timezone.utc)),
542
542
  UserPromptPart(content='Hello', timestamp=IsNow(tz=timezone.utc)),
543
543
  ]
544
544
  ),
@@ -586,7 +586,7 @@ def test_run_with_history_new():
586
586
  [
587
587
  ModelRequest(
588
588
  parts=[
589
- SystemPromptPart(content='Foobar'),
589
+ SystemPromptPart(content='Foobar', timestamp=IsNow(tz=timezone.utc)),
590
590
  UserPromptPart(content='Hello', timestamp=IsNow(tz=timezone.utc)),
591
591
  ]
592
592
  ),
@@ -632,7 +632,7 @@ def test_run_with_history_new_structured():
632
632
  [
633
633
  ModelRequest(
634
634
  parts=[
635
- SystemPromptPart(content='Foobar'),
635
+ SystemPromptPart(content='Foobar', timestamp=IsNow(tz=timezone.utc)),
636
636
  UserPromptPart(content='Hello', timestamp=IsNow(tz=timezone.utc)),
637
637
  ]
638
638
  ),
@@ -670,7 +670,7 @@ def test_run_with_history_new_structured():
670
670
  [
671
671
  ModelRequest(
672
672
  parts=[
673
- SystemPromptPart(content='Foobar'),
673
+ SystemPromptPart(content='Foobar', timestamp=IsNow(tz=timezone.utc)),
674
674
  UserPromptPart(content='Hello', timestamp=IsNow(tz=timezone.utc)),
675
675
  ],
676
676
  ),
@@ -1374,8 +1374,10 @@ def test_dynamic_false_no_reevaluate():
1374
1374
  [
1375
1375
  ModelRequest(
1376
1376
  parts=[
1377
- SystemPromptPart(content='Foobar', part_kind='system-prompt'),
1378
- SystemPromptPart(content=dynamic_value, part_kind='system-prompt'),
1377
+ SystemPromptPart(content='Foobar', part_kind='system-prompt', timestamp=IsNow(tz=timezone.utc)),
1378
+ SystemPromptPart(
1379
+ content=dynamic_value, part_kind='system-prompt', timestamp=IsNow(tz=timezone.utc)
1380
+ ),
1379
1381
  UserPromptPart(content='Hello', timestamp=IsNow(tz=timezone.utc), part_kind='user-prompt'),
1380
1382
  ],
1381
1383
  kind='request',
@@ -1397,10 +1399,11 @@ def test_dynamic_false_no_reevaluate():
1397
1399
  [
1398
1400
  ModelRequest(
1399
1401
  parts=[
1400
- SystemPromptPart(content='Foobar', part_kind='system-prompt'),
1402
+ SystemPromptPart(content='Foobar', part_kind='system-prompt', timestamp=IsNow(tz=timezone.utc)),
1401
1403
  SystemPromptPart(
1402
1404
  content='A', # Remains the same
1403
1405
  part_kind='system-prompt',
1406
+ timestamp=IsNow(tz=timezone.utc),
1404
1407
  ),
1405
1408
  UserPromptPart(content='Hello', timestamp=IsNow(tz=timezone.utc), part_kind='user-prompt'),
1406
1409
  ],
@@ -1446,11 +1449,12 @@ def test_dynamic_true_reevaluate_system_prompt():
1446
1449
  [
1447
1450
  ModelRequest(
1448
1451
  parts=[
1449
- SystemPromptPart(content='Foobar', part_kind='system-prompt'),
1452
+ SystemPromptPart(content='Foobar', part_kind='system-prompt', timestamp=IsNow(tz=timezone.utc)),
1450
1453
  SystemPromptPart(
1451
1454
  content=dynamic_value,
1452
1455
  part_kind='system-prompt',
1453
1456
  dynamic_ref=func.__qualname__,
1457
+ timestamp=IsNow(tz=timezone.utc),
1454
1458
  ),
1455
1459
  UserPromptPart(content='Hello', timestamp=IsNow(tz=timezone.utc), part_kind='user-prompt'),
1456
1460
  ],
@@ -1473,11 +1477,12 @@ def test_dynamic_true_reevaluate_system_prompt():
1473
1477
  [
1474
1478
  ModelRequest(
1475
1479
  parts=[
1476
- SystemPromptPart(content='Foobar', part_kind='system-prompt'),
1480
+ SystemPromptPart(content='Foobar', part_kind='system-prompt', timestamp=IsNow(tz=timezone.utc)),
1477
1481
  SystemPromptPart(
1478
1482
  content='B',
1479
1483
  part_kind='system-prompt',
1480
1484
  dynamic_ref=func.__qualname__,
1485
+ timestamp=IsNow(tz=timezone.utc),
1481
1486
  ),
1482
1487
  UserPromptPart(content='Hello', timestamp=IsNow(tz=timezone.utc), part_kind='user-prompt'),
1483
1488
  ],
@@ -230,14 +230,14 @@ def test_instrument_all():
230
230
  m = get_model()
231
231
  assert isinstance(m, InstrumentedModel)
232
232
  assert m.wrapped is model
233
- assert m.options.event_mode == InstrumentationSettings().event_mode
233
+ assert m.settings.event_mode == InstrumentationSettings().event_mode
234
234
 
235
235
  options = InstrumentationSettings(event_mode='logs')
236
236
  Agent.instrument_all(options)
237
237
  m = get_model()
238
238
  assert isinstance(m, InstrumentedModel)
239
239
  assert m.wrapped is model
240
- assert m.options is options
240
+ assert m.settings is options
241
241
 
242
242
  Agent.instrument_all(False)
243
243
  assert get_model() is model
File without changes
File without changes
File without changes
File without changes