pydantic-ai 0.2.0__tar.gz → 0.2.2__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 (191) hide show
  1. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/PKG-INFO +3 -3
  2. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/test_anthropic.py +16 -0
  3. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/test_instrumented.py +2 -2
  4. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/test_cli.py +98 -0
  5. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/.gitignore +0 -0
  6. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/LICENSE +0 -0
  7. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/Makefile +0 -0
  8. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/README.md +0 -0
  9. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/pyproject.toml +0 -0
  10. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/__init__.py +0 -0
  11. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/assets/dummy.pdf +0 -0
  12. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/assets/kiwi.png +0 -0
  13. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/assets/marcelo.mp3 +0 -0
  14. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/assets/small_video.mp4 +0 -0
  15. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/cassettes/test_mcp/test_agent_with_stdio_server.yaml +0 -0
  16. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/cassettes/test_mcp/test_tool_returning_dict.yaml +0 -0
  17. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/cassettes/test_mcp/test_tool_returning_error.yaml +0 -0
  18. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/cassettes/test_mcp/test_tool_returning_image.yaml +0 -0
  19. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/cassettes/test_mcp/test_tool_returning_image_resource.yaml +0 -0
  20. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/cassettes/test_mcp/test_tool_returning_multiple_items.yaml +0 -0
  21. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/cassettes/test_mcp/test_tool_returning_none.yaml +0 -0
  22. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/cassettes/test_mcp/test_tool_returning_str.yaml +0 -0
  23. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/cassettes/test_mcp/test_tool_returning_text_resource.yaml +0 -0
  24. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/cassettes/test_settings/test_stop_settings[anthropic].yaml +0 -0
  25. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/cassettes/test_settings/test_stop_settings[bedrock].yaml +0 -0
  26. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/cassettes/test_settings/test_stop_settings[cohere].yaml +0 -0
  27. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/cassettes/test_settings/test_stop_settings[gemini].yaml +0 -0
  28. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/cassettes/test_settings/test_stop_settings[groq].yaml +0 -0
  29. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/cassettes/test_settings/test_stop_settings[mistral].yaml +0 -0
  30. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/cassettes/test_settings/test_stop_settings[openai].yaml +0 -0
  31. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/conftest.py +0 -0
  32. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/evals/__init__.py +0 -0
  33. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/evals/test_dataset.py +0 -0
  34. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/evals/test_evaluator_base.py +0 -0
  35. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/evals/test_evaluator_common.py +0 -0
  36. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/evals/test_evaluator_context.py +0 -0
  37. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/evals/test_evaluator_spec.py +0 -0
  38. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/evals/test_evaluators.py +0 -0
  39. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/evals/test_llm_as_a_judge.py +0 -0
  40. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/evals/test_otel.py +0 -0
  41. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/evals/test_render_numbers.py +0 -0
  42. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/evals/test_reporting.py +0 -0
  43. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/evals/test_reports.py +0 -0
  44. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/evals/test_utils.py +0 -0
  45. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/evals/utils.py +0 -0
  46. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/example_modules/README.md +0 -0
  47. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/example_modules/bank_database.py +0 -0
  48. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/example_modules/fake_database.py +0 -0
  49. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/example_modules/weather_service.py +0 -0
  50. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/graph/__init__.py +0 -0
  51. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/graph/test_file_persistence.py +0 -0
  52. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/graph/test_graph.py +0 -0
  53. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/graph/test_mermaid.py +0 -0
  54. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/graph/test_persistence.py +0 -0
  55. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/graph/test_state.py +0 -0
  56. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/graph/test_utils.py +0 -0
  57. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/import_examples.py +0 -0
  58. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/json_body_serializer.py +0 -0
  59. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/mcp_server.py +0 -0
  60. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/__init__.py +0 -0
  61. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_anthropic/test_anthropic_model_instructions.yaml +0 -0
  62. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_anthropic/test_document_binary_content_input.yaml +0 -0
  63. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_anthropic/test_document_url_input.yaml +0 -0
  64. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_anthropic/test_extra_headers.yaml +0 -0
  65. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_anthropic/test_image_as_binary_content_tool_response.yaml +0 -0
  66. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_anthropic/test_image_url_input.yaml +0 -0
  67. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_anthropic/test_image_url_input_invalid_mime_type.yaml +0 -0
  68. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_anthropic/test_multiple_parallel_tool_calls.yaml +0 -0
  69. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_anthropic/test_text_document_url_input.yaml +0 -0
  70. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_bedrock/test_bedrock_empty_system_prompt.yaml +0 -0
  71. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_bedrock/test_bedrock_model.yaml +0 -0
  72. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_bedrock/test_bedrock_model_anthropic_model_without_tools.yaml +0 -0
  73. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_bedrock/test_bedrock_model_guardrail_config.yaml +0 -0
  74. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_bedrock/test_bedrock_model_instructions.yaml +0 -0
  75. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_bedrock/test_bedrock_model_iter_stream.yaml +0 -0
  76. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_bedrock/test_bedrock_model_max_tokens.yaml +0 -0
  77. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_bedrock/test_bedrock_model_other_parameters.yaml +0 -0
  78. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_bedrock/test_bedrock_model_performance_config.yaml +0 -0
  79. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_bedrock/test_bedrock_model_retry.yaml +0 -0
  80. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_bedrock/test_bedrock_model_stream.yaml +0 -0
  81. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_bedrock/test_bedrock_model_structured_response.yaml +0 -0
  82. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_bedrock/test_bedrock_model_top_p.yaml +0 -0
  83. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_bedrock/test_bedrock_multiple_documents_in_history.yaml +0 -0
  84. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_bedrock/test_document_url_input.yaml +0 -0
  85. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_bedrock/test_image_as_binary_content_input.yaml +0 -0
  86. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_bedrock/test_image_url_input.yaml +0 -0
  87. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_bedrock/test_text_as_binary_content_input.yaml +0 -0
  88. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_bedrock/test_text_document_url_input.yaml +0 -0
  89. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_bedrock/test_video_as_binary_content_input.yaml +0 -0
  90. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_bedrock/test_video_url_input.yaml +0 -0
  91. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_cohere/test_cohere_model_instructions.yaml +0 -0
  92. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_cohere/test_request_simple_success_with_vcr.yaml +0 -0
  93. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_gemini/test_document_url_input.yaml +0 -0
  94. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_gemini/test_gemini_additional_properties_is_false.yaml +0 -0
  95. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_gemini/test_gemini_additional_properties_is_true.yaml +0 -0
  96. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_gemini/test_gemini_drop_exclusive_maximum.yaml +0 -0
  97. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_gemini/test_gemini_exclusive_minimum_and_maximum.yaml +0 -0
  98. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_gemini/test_gemini_model_instructions.yaml +0 -0
  99. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_gemini/test_image_as_binary_content_input.yaml +0 -0
  100. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_gemini/test_image_as_binary_content_tool_response.yaml +0 -0
  101. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_gemini/test_image_url_input.yaml +0 -0
  102. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_gemini/test_video_as_binary_content_input.yaml +0 -0
  103. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_gemini/test_video_url_input.yaml +0 -0
  104. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_groq/test_extra_headers.yaml +0 -0
  105. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_groq/test_groq_model_instructions.yaml +0 -0
  106. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_groq/test_image_as_binary_content_input.yaml +0 -0
  107. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_groq/test_image_as_binary_content_tool_response.yaml +0 -0
  108. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_groq/test_image_url_input.yaml +0 -0
  109. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_mistral/test_image_as_binary_content_tool_response.yaml +0 -0
  110. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_mistral/test_mistral_model_instructions.yaml +0 -0
  111. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai/test_audio_as_binary_content_input.yaml +0 -0
  112. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai/test_document_as_binary_content_input.yaml +0 -0
  113. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai/test_document_url_input.yaml +0 -0
  114. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai/test_extra_headers.yaml +0 -0
  115. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai/test_image_as_binary_content_input.yaml +0 -0
  116. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai/test_image_as_binary_content_tool_response.yaml +0 -0
  117. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai/test_image_url_tool_response.yaml +0 -0
  118. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai/test_max_completion_tokens[gpt-4.5-preview].yaml +0 -0
  119. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai/test_max_completion_tokens[gpt-4o-mini].yaml +0 -0
  120. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai/test_max_completion_tokens[o3-mini].yaml +0 -0
  121. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai/test_multiple_agent_tool_calls.yaml +0 -0
  122. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai/test_openai_audio_url_input.yaml +0 -0
  123. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai/test_openai_instructions.yaml +0 -0
  124. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai/test_openai_instructions_with_tool_calls_keep_instructions.yaml +0 -0
  125. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai/test_openai_model_without_system_prompt.yaml +0 -0
  126. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai/test_openai_o1_mini_system_role[developer].yaml +0 -0
  127. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai/test_openai_o1_mini_system_role[system].yaml +0 -0
  128. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai/test_user_id.yaml +0 -0
  129. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai_responses/test_audio_as_binary_content_input.yaml +0 -0
  130. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai_responses/test_image_as_binary_content_input.yaml +0 -0
  131. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai_responses/test_image_as_binary_content_tool_response.yaml +0 -0
  132. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai_responses/test_openai_responses_document_as_binary_content_input.yaml +0 -0
  133. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai_responses/test_openai_responses_document_url_input.yaml +0 -0
  134. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai_responses/test_openai_responses_image_url_input.yaml +0 -0
  135. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai_responses/test_openai_responses_model_builtin_tools.yaml +0 -0
  136. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai_responses/test_openai_responses_model_http_error.yaml +0 -0
  137. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai_responses/test_openai_responses_model_instructions.yaml +0 -0
  138. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai_responses/test_openai_responses_model_retry.yaml +0 -0
  139. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai_responses/test_openai_responses_model_simple_response.yaml +0 -0
  140. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai_responses/test_openai_responses_model_simple_response_with_tool_call.yaml +0 -0
  141. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai_responses/test_openai_responses_output_type.yaml +0 -0
  142. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai_responses/test_openai_responses_reasoning_effort.yaml +0 -0
  143. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai_responses/test_openai_responses_reasoning_generate_summary.yaml +0 -0
  144. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai_responses/test_openai_responses_stream.yaml +0 -0
  145. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai_responses/test_openai_responses_system_prompt.yaml +0 -0
  146. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/cassettes/test_openai_responses/test_openai_responses_text_document_url_input.yaml +0 -0
  147. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/mock_async_stream.py +0 -0
  148. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/test_bedrock.py +0 -0
  149. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/test_cohere.py +0 -0
  150. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/test_fallback.py +0 -0
  151. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/test_gemini.py +0 -0
  152. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/test_groq.py +0 -0
  153. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/test_mistral.py +0 -0
  154. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/test_model.py +0 -0
  155. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/test_model_function.py +0 -0
  156. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/test_model_names.py +0 -0
  157. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/test_model_request_parameters.py +0 -0
  158. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/test_model_test.py +0 -0
  159. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/test_openai.py +0 -0
  160. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/models/test_openai_responses.py +0 -0
  161. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/providers/__init__.py +0 -0
  162. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/providers/cassettes/test_azure/test_azure_provider_call.yaml +0 -0
  163. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/providers/cassettes/test_google_vertex/test_vertexai_provider.yaml +0 -0
  164. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/providers/test_anthropic.py +0 -0
  165. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/providers/test_azure.py +0 -0
  166. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/providers/test_bedrock.py +0 -0
  167. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/providers/test_cohere.py +0 -0
  168. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/providers/test_deepseek.py +0 -0
  169. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/providers/test_google_gla.py +0 -0
  170. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/providers/test_google_vertex.py +0 -0
  171. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/providers/test_groq.py +0 -0
  172. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/providers/test_mistral.py +0 -0
  173. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/providers/test_openai.py +0 -0
  174. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/providers/test_provider_names.py +0 -0
  175. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/test_agent.py +0 -0
  176. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/test_deps.py +0 -0
  177. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/test_examples.py +0 -0
  178. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/test_format_as_xml.py +0 -0
  179. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/test_json_body_serializer.py +0 -0
  180. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/test_live.py +0 -0
  181. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/test_logfire.py +0 -0
  182. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/test_mcp.py +0 -0
  183. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/test_messages.py +0 -0
  184. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/test_parts_manager.py +0 -0
  185. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/test_settings.py +0 -0
  186. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/test_streaming.py +0 -0
  187. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/test_tools.py +0 -0
  188. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/test_usage_limits.py +0 -0
  189. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/test_utils.py +0 -0
  190. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/tests/typed_agent.py +0 -0
  191. {pydantic_ai-0.2.0 → pydantic_ai-0.2.2}/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.0
3
+ Version: 0.2.2
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,evals,groq,mcp,mistral,openai,vertexai]==0.2.0
31
+ Requires-Dist: pydantic-ai-slim[anthropic,bedrock,cli,cohere,evals,groq,mcp,mistral,openai,vertexai]==0.2.2
32
32
  Provides-Extra: examples
33
- Requires-Dist: pydantic-ai-examples==0.2.0; extra == 'examples'
33
+ Requires-Dist: pydantic-ai-examples==0.2.2; extra == 'examples'
34
34
  Provides-Extra: logfire
35
35
  Requires-Dist: logfire>=3.11.0; extra == 'logfire'
36
36
  Description-Content-Type: text/markdown
@@ -927,6 +927,22 @@ async def test_anthropic_model_instructions(allow_model_requests: None, anthropi
927
927
  )
928
928
 
929
929
 
930
+ async def test_multiple_system_prompt_formatting(allow_model_requests: None):
931
+ c = completion_message([TextBlock(text='world', type='text')], AnthropicUsage(input_tokens=5, output_tokens=10))
932
+ mock_client = MockAnthropic().create_mock(c)
933
+ m = AnthropicModel('claude-3-5-haiku-latest', provider=AnthropicProvider(anthropic_client=mock_client))
934
+ agent = Agent(m, system_prompt='this is the system prompt')
935
+
936
+ @agent.system_prompt
937
+ def system_prompt() -> str:
938
+ return 'and this is another'
939
+
940
+ await agent.run('hello')
941
+ completion_kwargs = get_mock_chat_completion_kwargs(mock_client)[0]
942
+ assert 'system' in completion_kwargs
943
+ assert completion_kwargs['system'] == 'this is the system prompt\n\nand this is another'
944
+
945
+
930
946
  def anth_msg(usage: AnthropicUsage) -> AnthropicMessage:
931
947
  return AnthropicMessage(
932
948
  id='x',
@@ -36,7 +36,7 @@ from pydantic_ai.models.instrumented import InstrumentationSettings, Instrumente
36
36
  from pydantic_ai.settings import ModelSettings
37
37
  from pydantic_ai.usage import Usage
38
38
 
39
- from ..conftest import try_import
39
+ from ..conftest import IsStr, try_import
40
40
 
41
41
  with try_import() as imports_successful:
42
42
  from logfire.testing import CaptureLogfire
@@ -796,7 +796,7 @@ def test_messages_to_otel_events_image_url(document_content: BinaryContent):
796
796
  'event.name': 'gen_ai.user.message',
797
797
  },
798
798
  {
799
- 'content': ['user_prompt6', {'kind': 'binary'}],
799
+ 'content': ['user_prompt6', {'kind': 'binary', 'content': IsStr(), 'media_type': 'application/pdf'}],
800
800
  'role': 'user',
801
801
  'gen_ai.message.index': 5,
802
802
  'event.name': 'gen_ai.user.message',
@@ -1,3 +1,4 @@
1
+ import sys
1
2
  from io import StringIO
2
3
  from typing import Any
3
4
 
@@ -36,6 +37,72 @@ def test_invalid_model(capfd: CaptureFixture[str]):
36
37
  )
37
38
 
38
39
 
40
+ def test_agent_flag(capfd: CaptureFixture[str], mocker: MockerFixture, env: TestEnv):
41
+ env.set('OPENAI_API_KEY', 'test')
42
+
43
+ # Create a dynamic module using types.ModuleType
44
+ import types
45
+
46
+ test_module = types.ModuleType('test_module')
47
+
48
+ # Create and add agent to the module
49
+ test_agent = Agent()
50
+ test_agent.model = TestModel(custom_output_text='Hello from custom agent')
51
+ setattr(test_module, 'custom_agent', test_agent)
52
+
53
+ # Register the module in sys.modules
54
+ sys.modules['test_module'] = test_module
55
+
56
+ try:
57
+ # Mock ask_agent to avoid actual execution but capture the agent
58
+ mock_ask = mocker.patch('pydantic_ai._cli.ask_agent')
59
+
60
+ # Test CLI with custom agent
61
+ assert cli(['--agent', 'test_module:custom_agent', 'hello']) == 0
62
+
63
+ # Verify the output contains the custom agent message
64
+ assert 'Using custom agent: test_module:custom_agent' in capfd.readouterr().out
65
+
66
+ # Verify ask_agent was called with our custom agent
67
+ mock_ask.assert_called_once()
68
+ assert mock_ask.call_args[0][0] is test_agent
69
+
70
+ finally:
71
+ # Clean up by removing the module from sys.modules
72
+ if 'test_module' in sys.modules:
73
+ del sys.modules['test_module']
74
+
75
+
76
+ def test_agent_flag_non_agent(capfd: CaptureFixture[str], mocker: MockerFixture, env: TestEnv):
77
+ env.set('OPENAI_API_KEY', 'test')
78
+
79
+ # Create a dynamic module using types.ModuleType
80
+ import types
81
+
82
+ test_module = types.ModuleType('test_module')
83
+
84
+ # Create and add agent to the module
85
+ test_agent = 'Not an Agent object'
86
+ setattr(test_module, 'custom_agent', test_agent)
87
+
88
+ # Register the module in sys.modules
89
+ sys.modules['test_module'] = test_module
90
+
91
+ try:
92
+ assert cli(['--agent', 'test_module:custom_agent', 'hello']) == 1
93
+ assert 'is not an Agent' in capfd.readouterr().out
94
+
95
+ finally:
96
+ # Clean up by removing the module from sys.modules
97
+ if 'test_module' in sys.modules:
98
+ del sys.modules['test_module']
99
+
100
+
101
+ def test_agent_flag_bad_module_variable_path(capfd: CaptureFixture[str], mocker: MockerFixture, env: TestEnv):
102
+ assert cli(['--agent', 'bad_path', 'hello']) == 1
103
+ assert 'Agent must be specified in "module:variable" format' in capfd.readouterr().out
104
+
105
+
39
106
  def test_list_models(capfd: CaptureFixture[str]):
40
107
  assert cli(['--list-models']) == 0
41
108
  output = capfd.readouterr().out.splitlines()
@@ -153,3 +220,34 @@ def test_code_theme_dark(mocker: MockerFixture, env: TestEnv):
153
220
  mock_run_chat.assert_awaited_once_with(
154
221
  IsInstance(PromptSession), True, IsInstance(Agent), IsInstance(Console), 'monokai', 'pai'
155
222
  )
223
+
224
+
225
+ def test_agent_to_cli_sync(mocker: MockerFixture, env: TestEnv):
226
+ env.set('OPENAI_API_KEY', 'test')
227
+ mock_run_chat = mocker.patch('pydantic_ai._cli.run_chat')
228
+ cli_agent.to_cli_sync()
229
+ mock_run_chat.assert_awaited_once_with(
230
+ session=IsInstance(PromptSession),
231
+ stream=True,
232
+ agent=IsInstance(Agent),
233
+ console=IsInstance(Console),
234
+ code_theme='monokai',
235
+ prog_name='pydantic-ai',
236
+ deps=None,
237
+ )
238
+
239
+
240
+ @pytest.mark.anyio
241
+ async def test_agent_to_cli_async(mocker: MockerFixture, env: TestEnv):
242
+ env.set('OPENAI_API_KEY', 'test')
243
+ mock_run_chat = mocker.patch('pydantic_ai._cli.run_chat')
244
+ await cli_agent.to_cli()
245
+ mock_run_chat.assert_awaited_once_with(
246
+ session=IsInstance(PromptSession),
247
+ stream=True,
248
+ agent=IsInstance(Agent),
249
+ console=IsInstance(Console),
250
+ code_theme='monokai',
251
+ prog_name='pydantic-ai',
252
+ deps=None,
253
+ )
File without changes
File without changes
File without changes
File without changes
File without changes