pydantic-ai 0.2.7__tar.gz → 0.2.9__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.

Potentially problematic release.


This version of pydantic-ai might be problematic. Click here for more details.

Files changed (221) hide show
  1. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/PKG-INFO +3 -3
  2. pydantic_ai-0.2.9/tests/models/cassettes/test_gemini/test_labels_are_ignored_with_gla_provider.yaml +62 -0
  3. pydantic_ai-0.2.9/tests/models/cassettes/test_gemini_vertexai/test_labels.yaml +110 -0
  4. pydantic_ai-0.2.9/tests/models/cassettes/test_google/test_google_model_vertex_labels.yaml +115 -0
  5. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/test_gemini.py +12 -0
  6. pydantic_ai-0.2.9/tests/models/test_gemini_vertexai.py +51 -0
  7. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/test_google.py +22 -0
  8. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/.gitignore +0 -0
  9. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/LICENSE +0 -0
  10. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/Makefile +0 -0
  11. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/README.md +0 -0
  12. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/pyproject.toml +0 -0
  13. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/__init__.py +0 -0
  14. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/assets/dummy.pdf +0 -0
  15. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/assets/kiwi.png +0 -0
  16. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/assets/marcelo.mp3 +0 -0
  17. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/assets/small_video.mp4 +0 -0
  18. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/cassettes/test_mcp/test_agent_with_stdio_server.yaml +0 -0
  19. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/cassettes/test_mcp/test_tool_returning_dict.yaml +0 -0
  20. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/cassettes/test_mcp/test_tool_returning_error.yaml +0 -0
  21. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/cassettes/test_mcp/test_tool_returning_image.yaml +0 -0
  22. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/cassettes/test_mcp/test_tool_returning_image_resource.yaml +0 -0
  23. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/cassettes/test_mcp/test_tool_returning_multiple_items.yaml +0 -0
  24. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/cassettes/test_mcp/test_tool_returning_none.yaml +0 -0
  25. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/cassettes/test_mcp/test_tool_returning_str.yaml +0 -0
  26. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/cassettes/test_mcp/test_tool_returning_text_resource.yaml +0 -0
  27. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/cassettes/test_settings/test_stop_settings[anthropic].yaml +0 -0
  28. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/cassettes/test_settings/test_stop_settings[bedrock].yaml +0 -0
  29. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/cassettes/test_settings/test_stop_settings[cohere].yaml +0 -0
  30. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/cassettes/test_settings/test_stop_settings[gemini].yaml +0 -0
  31. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/cassettes/test_settings/test_stop_settings[groq].yaml +0 -0
  32. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/cassettes/test_settings/test_stop_settings[mistral].yaml +0 -0
  33. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/cassettes/test_settings/test_stop_settings[openai].yaml +0 -0
  34. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/conftest.py +0 -0
  35. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/evals/__init__.py +0 -0
  36. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/evals/test_dataset.py +0 -0
  37. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/evals/test_evaluator_base.py +0 -0
  38. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/evals/test_evaluator_common.py +0 -0
  39. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/evals/test_evaluator_context.py +0 -0
  40. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/evals/test_evaluator_spec.py +0 -0
  41. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/evals/test_evaluators.py +0 -0
  42. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/evals/test_llm_as_a_judge.py +0 -0
  43. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/evals/test_otel.py +0 -0
  44. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/evals/test_render_numbers.py +0 -0
  45. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/evals/test_reporting.py +0 -0
  46. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/evals/test_reports.py +0 -0
  47. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/evals/test_utils.py +0 -0
  48. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/evals/utils.py +0 -0
  49. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/example_modules/README.md +0 -0
  50. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/example_modules/bank_database.py +0 -0
  51. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/example_modules/fake_database.py +0 -0
  52. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/example_modules/weather_service.py +0 -0
  53. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/fasta2a/__init__.py +0 -0
  54. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/fasta2a/test_applications.py +0 -0
  55. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/graph/__init__.py +0 -0
  56. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/graph/test_file_persistence.py +0 -0
  57. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/graph/test_graph.py +0 -0
  58. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/graph/test_mermaid.py +0 -0
  59. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/graph/test_persistence.py +0 -0
  60. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/graph/test_state.py +0 -0
  61. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/graph/test_utils.py +0 -0
  62. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/import_examples.py +0 -0
  63. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/json_body_serializer.py +0 -0
  64. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/mcp_server.py +0 -0
  65. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/__init__.py +0 -0
  66. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_anthropic/test_anthropic_model_instructions.yaml +0 -0
  67. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_anthropic/test_document_binary_content_input.yaml +0 -0
  68. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_anthropic/test_document_url_input.yaml +0 -0
  69. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_anthropic/test_extra_headers.yaml +0 -0
  70. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_anthropic/test_image_as_binary_content_tool_response.yaml +0 -0
  71. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_anthropic/test_image_url_input.yaml +0 -0
  72. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_anthropic/test_image_url_input_invalid_mime_type.yaml +0 -0
  73. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_anthropic/test_multiple_parallel_tool_calls.yaml +0 -0
  74. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_anthropic/test_text_document_url_input.yaml +0 -0
  75. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_bedrock/test_bedrock_empty_system_prompt.yaml +0 -0
  76. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_bedrock/test_bedrock_model.yaml +0 -0
  77. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_bedrock/test_bedrock_model_anthropic_model_without_tools.yaml +0 -0
  78. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_bedrock/test_bedrock_model_guardrail_config.yaml +0 -0
  79. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_bedrock/test_bedrock_model_instructions.yaml +0 -0
  80. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_bedrock/test_bedrock_model_iter_stream.yaml +0 -0
  81. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_bedrock/test_bedrock_model_max_tokens.yaml +0 -0
  82. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_bedrock/test_bedrock_model_other_parameters.yaml +0 -0
  83. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_bedrock/test_bedrock_model_performance_config.yaml +0 -0
  84. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_bedrock/test_bedrock_model_retry.yaml +0 -0
  85. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_bedrock/test_bedrock_model_stream.yaml +0 -0
  86. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_bedrock/test_bedrock_model_structured_response.yaml +0 -0
  87. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_bedrock/test_bedrock_model_top_p.yaml +0 -0
  88. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_bedrock/test_bedrock_multiple_documents_in_history.yaml +0 -0
  89. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_bedrock/test_document_url_input.yaml +0 -0
  90. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_bedrock/test_image_as_binary_content_input.yaml +0 -0
  91. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_bedrock/test_image_url_input.yaml +0 -0
  92. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_bedrock/test_text_as_binary_content_input.yaml +0 -0
  93. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_bedrock/test_text_document_url_input.yaml +0 -0
  94. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_bedrock/test_video_as_binary_content_input.yaml +0 -0
  95. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_bedrock/test_video_url_input.yaml +0 -0
  96. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_cohere/test_cohere_model_instructions.yaml +0 -0
  97. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_cohere/test_request_simple_success_with_vcr.yaml +0 -0
  98. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_gemini/test_document_url_input.yaml +0 -0
  99. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_gemini/test_gemini_additional_properties_is_false.yaml +0 -0
  100. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_gemini/test_gemini_additional_properties_is_true.yaml +0 -0
  101. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_gemini/test_gemini_drop_exclusive_maximum.yaml +0 -0
  102. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_gemini/test_gemini_exclusive_minimum_and_maximum.yaml +0 -0
  103. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_gemini/test_gemini_model_instructions.yaml +0 -0
  104. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_gemini/test_image_as_binary_content_input.yaml +0 -0
  105. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_gemini/test_image_as_binary_content_tool_response.yaml +0 -0
  106. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_gemini/test_image_url_input.yaml +0 -0
  107. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_gemini/test_video_as_binary_content_input.yaml +0 -0
  108. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_gemini/test_video_url_input.yaml +0 -0
  109. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_google/test_google_model.yaml +0 -0
  110. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_google/test_google_model_document_url_input.yaml +0 -0
  111. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_google/test_google_model_image_as_binary_content_input.yaml +0 -0
  112. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_google/test_google_model_image_url_input.yaml +0 -0
  113. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_google/test_google_model_instructions.yaml +0 -0
  114. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_google/test_google_model_iter_stream.yaml +0 -0
  115. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_google/test_google_model_max_tokens.yaml +0 -0
  116. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_google/test_google_model_multiple_documents_in_history.yaml +0 -0
  117. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_google/test_google_model_retry.yaml +0 -0
  118. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_google/test_google_model_safety_settings.yaml +0 -0
  119. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_google/test_google_model_stream.yaml +0 -0
  120. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_google/test_google_model_structured_response.yaml +0 -0
  121. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_google/test_google_model_text_as_binary_content_input.yaml +0 -0
  122. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_google/test_google_model_text_document_url_input.yaml +0 -0
  123. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_google/test_google_model_thinking_config.yaml +0 -0
  124. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_google/test_google_model_top_p.yaml +0 -0
  125. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_google/test_google_model_vertex_provider.yaml +0 -0
  126. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_google/test_google_model_video_as_binary_content_input.yaml +0 -0
  127. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_google/test_google_model_video_url_input.yaml +0 -0
  128. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_groq/test_extra_headers.yaml +0 -0
  129. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_groq/test_groq_model_instructions.yaml +0 -0
  130. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_groq/test_image_as_binary_content_input.yaml +0 -0
  131. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_groq/test_image_as_binary_content_tool_response.yaml +0 -0
  132. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_groq/test_image_url_input.yaml +0 -0
  133. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_mistral/test_image_as_binary_content_tool_response.yaml +0 -0
  134. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_mistral/test_mistral_model_instructions.yaml +0 -0
  135. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai/test_audio_as_binary_content_input.yaml +0 -0
  136. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai/test_document_as_binary_content_input.yaml +0 -0
  137. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai/test_document_url_input.yaml +0 -0
  138. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai/test_extra_headers.yaml +0 -0
  139. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai/test_image_as_binary_content_input.yaml +0 -0
  140. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai/test_image_as_binary_content_tool_response.yaml +0 -0
  141. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai/test_image_url_tool_response.yaml +0 -0
  142. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai/test_max_completion_tokens[gpt-4.5-preview].yaml +0 -0
  143. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai/test_max_completion_tokens[gpt-4o-mini].yaml +0 -0
  144. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai/test_max_completion_tokens[o3-mini].yaml +0 -0
  145. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai/test_multiple_agent_tool_calls.yaml +0 -0
  146. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai/test_openai_audio_url_input.yaml +0 -0
  147. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai/test_openai_instructions.yaml +0 -0
  148. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai/test_openai_instructions_with_tool_calls_keep_instructions.yaml +0 -0
  149. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai/test_openai_model_without_system_prompt.yaml +0 -0
  150. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai/test_openai_o1_mini_system_role[developer].yaml +0 -0
  151. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai/test_openai_o1_mini_system_role[system].yaml +0 -0
  152. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai/test_user_id.yaml +0 -0
  153. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai_responses/test_audio_as_binary_content_input.yaml +0 -0
  154. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai_responses/test_image_as_binary_content_input.yaml +0 -0
  155. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai_responses/test_image_as_binary_content_tool_response.yaml +0 -0
  156. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai_responses/test_openai_responses_document_as_binary_content_input.yaml +0 -0
  157. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai_responses/test_openai_responses_document_url_input.yaml +0 -0
  158. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai_responses/test_openai_responses_image_url_input.yaml +0 -0
  159. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai_responses/test_openai_responses_model_builtin_tools.yaml +0 -0
  160. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai_responses/test_openai_responses_model_http_error.yaml +0 -0
  161. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai_responses/test_openai_responses_model_instructions.yaml +0 -0
  162. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai_responses/test_openai_responses_model_retry.yaml +0 -0
  163. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai_responses/test_openai_responses_model_simple_response.yaml +0 -0
  164. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai_responses/test_openai_responses_model_simple_response_with_tool_call.yaml +0 -0
  165. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai_responses/test_openai_responses_output_type.yaml +0 -0
  166. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai_responses/test_openai_responses_reasoning_effort.yaml +0 -0
  167. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai_responses/test_openai_responses_reasoning_generate_summary.yaml +0 -0
  168. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai_responses/test_openai_responses_stream.yaml +0 -0
  169. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai_responses/test_openai_responses_system_prompt.yaml +0 -0
  170. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/cassettes/test_openai_responses/test_openai_responses_text_document_url_input.yaml +0 -0
  171. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/mock_async_stream.py +0 -0
  172. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/test_anthropic.py +0 -0
  173. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/test_bedrock.py +0 -0
  174. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/test_cohere.py +0 -0
  175. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/test_fallback.py +0 -0
  176. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/test_groq.py +0 -0
  177. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/test_instrumented.py +0 -0
  178. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/test_mistral.py +0 -0
  179. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/test_model.py +0 -0
  180. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/test_model_function.py +0 -0
  181. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/test_model_names.py +0 -0
  182. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/test_model_request_parameters.py +0 -0
  183. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/test_model_test.py +0 -0
  184. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/test_openai.py +0 -0
  185. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/models/test_openai_responses.py +0 -0
  186. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/providers/__init__.py +0 -0
  187. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/providers/cassettes/test_azure/test_azure_provider_call.yaml +0 -0
  188. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/providers/cassettes/test_google_vertex/test_vertexai_provider.yaml +0 -0
  189. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/providers/cassettes/test_openrouter/test_openrouter_with_google_model.yaml +0 -0
  190. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/providers/test_anthropic.py +0 -0
  191. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/providers/test_azure.py +0 -0
  192. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/providers/test_bedrock.py +0 -0
  193. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/providers/test_cohere.py +0 -0
  194. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/providers/test_deepseek.py +0 -0
  195. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/providers/test_google_gla.py +0 -0
  196. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/providers/test_google_vertex.py +0 -0
  197. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/providers/test_groq.py +0 -0
  198. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/providers/test_mistral.py +0 -0
  199. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/providers/test_openai.py +0 -0
  200. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/providers/test_openrouter.py +0 -0
  201. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/providers/test_provider_names.py +0 -0
  202. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/test_a2a.py +0 -0
  203. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/test_agent.py +0 -0
  204. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/test_cli.py +0 -0
  205. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/test_deps.py +0 -0
  206. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/test_direct.py +0 -0
  207. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/test_examples.py +0 -0
  208. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/test_format_as_xml.py +0 -0
  209. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/test_json_body_serializer.py +0 -0
  210. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/test_live.py +0 -0
  211. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/test_logfire.py +0 -0
  212. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/test_mcp.py +0 -0
  213. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/test_messages.py +0 -0
  214. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/test_parts_manager.py +0 -0
  215. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/test_settings.py +0 -0
  216. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/test_streaming.py +0 -0
  217. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/test_tools.py +0 -0
  218. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/test_usage_limits.py +0 -0
  219. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/test_utils.py +0 -0
  220. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/typed_agent.py +0 -0
  221. {pydantic_ai-0.2.7 → pydantic_ai-0.2.9}/tests/typed_graph.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydantic-ai
3
- Version: 0.2.7
3
+ Version: 0.2.9
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[a2a,anthropic,bedrock,cli,cohere,evals,google,groq,mcp,mistral,openai,vertexai]==0.2.7
31
+ Requires-Dist: pydantic-ai-slim[a2a,anthropic,bedrock,cli,cohere,evals,google,groq,mcp,mistral,openai,vertexai]==0.2.9
32
32
  Provides-Extra: examples
33
- Requires-Dist: pydantic-ai-examples==0.2.7; extra == 'examples'
33
+ Requires-Dist: pydantic-ai-examples==0.2.9; extra == 'examples'
34
34
  Provides-Extra: logfire
35
35
  Requires-Dist: logfire>=3.11.0; extra == 'logfire'
36
36
  Description-Content-Type: text/markdown
@@ -0,0 +1,62 @@
1
+ interactions:
2
+ - request:
3
+ headers:
4
+ accept:
5
+ - "*/*"
6
+ accept-encoding:
7
+ - gzip, deflate
8
+ connection:
9
+ - keep-alive
10
+ content-length:
11
+ - "82"
12
+ content-type:
13
+ - application/json
14
+ host:
15
+ - generativelanguage.googleapis.com
16
+ method: POST
17
+ parsed_body:
18
+ contents:
19
+ - parts:
20
+ - text: What is the capital of France?
21
+ role: user
22
+ uri: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent
23
+ response:
24
+ headers:
25
+ alt-svc:
26
+ - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
27
+ content-length:
28
+ - "637"
29
+ content-type:
30
+ - application/json; charset=UTF-8
31
+ server-timing:
32
+ - gfet4t7; dur=426
33
+ transfer-encoding:
34
+ - chunked
35
+ vary:
36
+ - Origin
37
+ - X-Origin
38
+ - Referer
39
+ parsed_body:
40
+ candidates:
41
+ - avgLogprobs: -0.02703852951526642
42
+ content:
43
+ parts:
44
+ - text: |
45
+ The capital of France is **Paris**.
46
+ role: model
47
+ finishReason: STOP
48
+ modelVersion: gemini-2.0-flash
49
+ usageMetadata:
50
+ candidatesTokenCount: 9
51
+ candidatesTokensDetails:
52
+ - modality: TEXT
53
+ tokenCount: 9
54
+ promptTokenCount: 7
55
+ promptTokensDetails:
56
+ - modality: TEXT
57
+ tokenCount: 7
58
+ totalTokenCount: 16
59
+ status:
60
+ code: 200
61
+ message: OK
62
+ version: 1
@@ -0,0 +1,110 @@
1
+ interactions:
2
+ - request:
3
+ body: grant_type=%5B%27refresh_token%27%5D&client_id=%5B%27764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com%27%5D&client_secret=%5B%27scrubbed%27%5D&refresh_token=%5B%27scrubbed%27%5D
4
+ headers:
5
+ accept:
6
+ - "*/*"
7
+ accept-encoding:
8
+ - gzip, deflate
9
+ connection:
10
+ - keep-alive
11
+ content-length:
12
+ - "268"
13
+ content-type:
14
+ - application/x-www-form-urlencoded
15
+ method: POST
16
+ uri: https://oauth2.googleapis.com/token
17
+ response:
18
+ headers:
19
+ alt-svc:
20
+ - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
21
+ cache-control:
22
+ - no-cache, no-store, max-age=0, must-revalidate
23
+ content-length:
24
+ - "1419"
25
+ content-type:
26
+ - application/json; charset=utf-8
27
+ expires:
28
+ - Mon, 01 Jan 1990 00:00:00 GMT
29
+ pragma:
30
+ - no-cache
31
+ transfer-encoding:
32
+ - chunked
33
+ vary:
34
+ - Origin
35
+ - X-Origin
36
+ - Referer
37
+ parsed_body:
38
+ access_token: scrubbed
39
+ expires_in: 3599
40
+ id_token: eyJhbGciOiJSUzI1NiIsImtpZCI6IjgyMWYzYmM2NmYwNzUxZjc4NDA2MDY3OTliMWFkZjllOWZiNjBkZmIiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJhenAiOiI3NjQwODYwNTE4NTAtNnFyNHA2Z3BpNmhuNTA2cHQ4ZWp1cTgzZGkzNDFodXIuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJhdWQiOiI3NjQwODYwNTE4NTAtNnFyNHA2Z3BpNmhuNTA2cHQ4ZWp1cTgzZGkzNDFodXIuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJzdWIiOiIxMDY1Njg0NzQzMTU3NzkyMTI1NTkiLCJoZCI6InB5ZGFudGljLmRldiIsImVtYWlsIjoibWFyY2Vsb0BweWRhbnRpYy5kZXYiLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiYXRfaGFzaCI6ImlyckNRNE00c0Z0Z2dfS2hRTVNjekEiLCJpYXQiOjE3NDM0MTM3NzcsImV4cCI6MTc0MzQxNzM3N30.BAvb4TlcIoYcQODNLFqwtUQoSNJJbpAR0lk2OyFxXK9rSZ7m1e1_Dp1O4ApxPUS7f_NX34eSCuDJN2IXgh8VBv4k3IhI7CbMydYeqXuwlbgOOp1Z0farGEKneU1M7TvdngigAJ9wT-2LHjKd_GEcGau-CUvzXpcT1IOnNNyXGVqtuGmEfcw5jjPkKJNECUheeNHE3zeImatTstOLuKmI1ZK-etl41l3poSNuQkZkrbQ80Vst8BdT-b1tnJnXP1KGATBIamDy99OOiB9a7a9m_ikXYEyN91yR76DYot3hpDPlOX0H9hF-BOSqoOtlSS2TMBkMvFiiYWjID1e_9VlNUg
41
+ scope: https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/userinfo.email openid https://www.googleapis.com/auth/sqlservice.login
42
+ token_type: Bearer
43
+ status:
44
+ code: 200
45
+ message: OK
46
+ - request:
47
+ headers:
48
+ accept:
49
+ - "*/*"
50
+ accept-encoding:
51
+ - gzip, deflate
52
+ connection:
53
+ - keep-alive
54
+ content-length:
55
+ - "133"
56
+ content-type:
57
+ - application/json
58
+ host:
59
+ - us-central1-aiplatform.googleapis.com
60
+ method: POST
61
+ parsed_body:
62
+ contents:
63
+ - parts:
64
+ - text: What is the capital of France?
65
+ role: user
66
+ labels:
67
+ environment: test
68
+ team: analytics
69
+ uri: https://us-central1-aiplatform.googleapis.com/v1/projects/pydantic-ai/locations/us-central1/publishers/google/models/gemini-2.0-flash:generateContent
70
+ response:
71
+ headers:
72
+ alt-svc:
73
+ - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
74
+ content-length:
75
+ - "759"
76
+ content-type:
77
+ - application/json; charset=UTF-8
78
+ transfer-encoding:
79
+ - chunked
80
+ vary:
81
+ - Origin
82
+ - X-Origin
83
+ - Referer
84
+ parsed_body:
85
+ candidates:
86
+ - avgLogprobs: -0.02703852951526642
87
+ content:
88
+ parts:
89
+ - text: |
90
+ The capital of France is **Paris**.
91
+ role: model
92
+ finishReason: STOP
93
+ createTime: "2025-05-23T07:53:55.494386Z"
94
+ modelVersion: gemini-2.0-flash
95
+ responseId: kykwaLKWHti5nvgPmN2T8AE
96
+ usageMetadata:
97
+ candidatesTokenCount: 9
98
+ candidatesTokensDetails:
99
+ - modality: TEXT
100
+ tokenCount: 9
101
+ promptTokenCount: 7
102
+ promptTokensDetails:
103
+ - modality: TEXT
104
+ tokenCount: 7
105
+ totalTokenCount: 16
106
+ trafficType: ON_DEMAND
107
+ status:
108
+ code: 200
109
+ message: OK
110
+ version: 1
@@ -0,0 +1,115 @@
1
+ interactions:
2
+ - request:
3
+ body: grant_type=%5B%27refresh_token%27%5D&client_id=%5B%27764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com%27%5D&client_secret=%5B%27scrubbed%27%5D&refresh_token=%5B%27scrubbed%27%5D
4
+ headers:
5
+ accept:
6
+ - "*/*"
7
+ accept-encoding:
8
+ - gzip, deflate
9
+ connection:
10
+ - keep-alive
11
+ content-length:
12
+ - "268"
13
+ content-type:
14
+ - application/x-www-form-urlencoded
15
+ method: POST
16
+ uri: https://oauth2.googleapis.com/token
17
+ response:
18
+ headers:
19
+ alt-svc:
20
+ - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
21
+ cache-control:
22
+ - no-cache, no-store, max-age=0, must-revalidate
23
+ content-length:
24
+ - "1420"
25
+ content-type:
26
+ - application/json; charset=utf-8
27
+ expires:
28
+ - Mon, 01 Jan 1990 00:00:00 GMT
29
+ pragma:
30
+ - no-cache
31
+ transfer-encoding:
32
+ - chunked
33
+ vary:
34
+ - Origin
35
+ - X-Origin
36
+ - Referer
37
+ parsed_body:
38
+ access_token: scrubbed
39
+ expires_in: 3599
40
+ id_token: eyJhbGciOiJSUzI1NiIsImtpZCI6IjY2MGVmM2I5Nzg0YmRmNTZlYmU4NTlmNTc3ZjdmYjJlOGMxY2VmZmIiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJhenAiOiI3NjQwODYwNTE4NTAtNnFyNHA2Z3BpNmhuNTA2cHQ4ZWp1cTgzZGkzNDFodXIuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJhdWQiOiI3NjQwODYwNTE4NTAtNnFyNHA2Z3BpNmhuNTA2cHQ4ZWp1cTgzZGkzNDFodXIuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJzdWIiOiIxMDY1Njg0NzQzMTU3NzkyMTI1NTkiLCJoZCI6InB5ZGFudGljLmRldiIsImVtYWlsIjoibWFyY2Vsb0BweWRhbnRpYy5kZXYiLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiYXRfaGFzaCI6Ii1CeV9XOWwtRHg1ekg0YTVOV25fV3ciLCJpYXQiOjE3NDc1NzQxOTEsImV4cCI6MTc0NzU3Nzc5MX0.dHg3qRlYoQ8WyIml7-kGqsuefvkl5deuZ0yTQM-RvKuuqtF_t6p8TrWbndEuSbZpRn9JhVPnsoEAYVPexbGy-pon4gu1aHH0dJNq3ghhdim7qp5JWpegLaZqvNvELvEHjj2VNLWXQ70-5wEaI_HCtAWTjlROAHQxvoWHJAdeH0Yf9zoljEBQvx3VLDLEpdCcMd-UGNCBucpQlFHcCJs5Qq8yj8R8f27BCEmRo7z9K3Axuedj_wcJ_tWV1x1tWxojUloJaKsIfztFOPFxzOdNPOlTHXsE47d4v43v87a8LhdDGloD72xN_kLapfIqyTIwRTj4cQvQp5H0u7As49fvMA
41
+ scope: https://www.googleapis.com/auth/userinfo.email openid https://www.googleapis.com/auth/sqlservice.login https://www.googleapis.com/auth/cloud-platform
42
+ token_type: Bearer
43
+ status:
44
+ code: 200
45
+ message: OK
46
+ - request:
47
+ headers:
48
+ accept:
49
+ - "*/*"
50
+ accept-encoding:
51
+ - gzip, deflate
52
+ connection:
53
+ - keep-alive
54
+ content-length:
55
+ - "257"
56
+ content-type:
57
+ - application/json
58
+ host:
59
+ - aiplatform.googleapis.com
60
+ method: POST
61
+ parsed_body:
62
+ contents:
63
+ - parts:
64
+ - text: What is the capital of France?
65
+ role: user
66
+ generationConfig: {}
67
+ labels:
68
+ environment: test
69
+ team: analytics
70
+ systemInstruction:
71
+ parts:
72
+ - text: You are a helpful chatbot.
73
+ role: user
74
+ uri: https://aiplatform.googleapis.com/v1beta1/projects/pydantic-ai/locations/global/publishers/google/models/gemini-2.0-flash:generateContent
75
+ response:
76
+ headers:
77
+ alt-svc:
78
+ - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
79
+ content-length:
80
+ - "759"
81
+ content-type:
82
+ - application/json; charset=UTF-8
83
+ transfer-encoding:
84
+ - chunked
85
+ vary:
86
+ - Origin
87
+ - X-Origin
88
+ - Referer
89
+ parsed_body:
90
+ candidates:
91
+ - avgLogprobs: -0.0005532301729544997
92
+ content:
93
+ parts:
94
+ - text: |
95
+ The capital of France is Paris.
96
+ role: model
97
+ finishReason: STOP
98
+ createTime: "2025-05-23T07:09:59.524624Z"
99
+ modelVersion: gemini-2.0-flash
100
+ responseId: sN0paKOZFtmtyOgPqMyL6AE
101
+ usageMetadata:
102
+ candidatesTokenCount: 8
103
+ candidatesTokensDetails:
104
+ - modality: TEXT
105
+ tokenCount: 8
106
+ promptTokenCount: 13
107
+ promptTokensDetails:
108
+ - modality: TEXT
109
+ tokenCount: 13
110
+ totalTokenCount: 21
111
+ trafficType: ON_DEMAND
112
+ status:
113
+ code: 200
114
+ message: OK
115
+ version: 1
@@ -1127,6 +1127,18 @@ I need to use the `get_image` tool to see the image first.
1127
1127
  )
1128
1128
 
1129
1129
 
1130
+ @pytest.mark.vcr()
1131
+ async def test_labels_are_ignored_with_gla_provider(allow_model_requests: None, gemini_api_key: str) -> None:
1132
+ m = GeminiModel('gemini-2.0-flash', provider=GoogleGLAProvider(api_key=gemini_api_key))
1133
+ agent = Agent(m)
1134
+
1135
+ result = await agent.run(
1136
+ 'What is the capital of France?',
1137
+ model_settings=GeminiModelSettings(gemini_labels={'environment': 'test', 'team': 'analytics'}),
1138
+ )
1139
+ assert result.output == snapshot('The capital of France is **Paris**.\n')
1140
+
1141
+
1130
1142
  @pytest.mark.vcr()
1131
1143
  async def test_image_as_binary_content_input(
1132
1144
  allow_model_requests: None, gemini_api_key: str, image_content: BinaryContent
@@ -0,0 +1,51 @@
1
+ import os
2
+ from dataclasses import dataclass
3
+
4
+ import pytest
5
+ from inline_snapshot import snapshot
6
+ from pytest_mock import MockerFixture
7
+
8
+ from pydantic_ai import Agent
9
+ from pydantic_ai.models.gemini import GeminiModel, GeminiModelSettings
10
+
11
+ from ..conftest import try_import
12
+
13
+ with try_import() as imports_successful:
14
+ from google.auth.transport.requests import Request
15
+
16
+
17
+ pytestmark = [
18
+ pytest.mark.skipif(not imports_successful(), reason='google-auth not installed'),
19
+ pytest.mark.anyio,
20
+ ]
21
+
22
+
23
+ @pytest.fixture(autouse=True)
24
+ def vertex_provider_auth(mocker: MockerFixture) -> None: # pragma: lax no cover
25
+ # Locally, we authenticate via `gcloud` CLI, so we don't need to patch anything.
26
+ if not os.getenv('CI'):
27
+ return
28
+
29
+ @dataclass
30
+ class NoOpCredentials:
31
+ token = 'my-token'
32
+
33
+ def refresh(self, request: Request): ...
34
+
35
+ return_value = (NoOpCredentials(), 'pydantic-ai')
36
+ mocker.patch('pydantic_ai.providers.google_vertex.google.auth.default', return_value=return_value)
37
+
38
+
39
+ @pytest.mark.skipif(
40
+ not os.getenv('CI', False), reason='Requires properly configured local google vertex config to pass'
41
+ )
42
+ @pytest.mark.vcr()
43
+ async def test_labels(allow_model_requests: None) -> None:
44
+ m = GeminiModel('gemini-2.0-flash', provider='google-vertex')
45
+ agent = Agent(m)
46
+
47
+ result = await agent.run(
48
+ 'What is the capital of France?',
49
+ model_settings=GeminiModelSettings(gemini_labels={'environment': 'test', 'team': 'analytics'}),
50
+ )
51
+ assert result.output == snapshot('The capital of France is **Paris**.\n')
@@ -262,6 +262,28 @@ async def test_google_model_thinking_config(allow_model_requests: None, google_p
262
262
  assert result.output == snapshot('The capital of France is **Paris**.')
263
263
 
264
264
 
265
+ @pytest.mark.skipif(
266
+ not os.getenv('CI', False), reason='Requires properly configured local google vertex config to pass'
267
+ )
268
+ async def test_google_model_vertex_labels(allow_model_requests: None):
269
+ provider = GoogleProvider(location='global', project='pydantic-ai')
270
+ model = GoogleModel('gemini-2.0-flash', provider=provider)
271
+ settings = GoogleModelSettings(google_labels={'environment': 'test', 'team': 'analytics'})
272
+ agent = Agent(model=model, system_prompt='You are a helpful chatbot.', model_settings=settings)
273
+ result = await agent.run('What is the capital of France?')
274
+ assert result.output == snapshot('The capital of France is Paris.\n')
275
+
276
+
277
+ async def test_google_model_gla_labels_raises_value_error(allow_model_requests: None, google_provider: GoogleProvider):
278
+ model = GoogleModel('gemini-2.0-flash', provider=google_provider)
279
+ settings = GoogleModelSettings(google_labels={'environment': 'test', 'team': 'analytics'})
280
+ agent = Agent(model=model, system_prompt='You are a helpful chatbot.', model_settings=settings)
281
+
282
+ # Raises before any request is made.
283
+ with pytest.raises(ValueError, match='labels parameter is not supported in Gemini API.'):
284
+ await agent.run('What is the capital of France?')
285
+
286
+
265
287
  @pytest.fixture(autouse=True)
266
288
  def vertex_provider_auth(mocker: MockerFixture) -> None: # pragma: lax no cover
267
289
  # Locally, we authenticate via `gcloud` CLI, so we don't need to patch anything.
File without changes
File without changes
File without changes
File without changes
File without changes