pydantic-ai 0.2.3__tar.gz → 0.2.4__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.
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/PKG-INFO +3 -3
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/pyproject.toml +1 -1
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/test_cli.py +71 -48
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/.gitignore +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/LICENSE +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/Makefile +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/README.md +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/__init__.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/assets/dummy.pdf +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/assets/kiwi.png +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/assets/marcelo.mp3 +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/assets/small_video.mp4 +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_mcp/test_agent_with_stdio_server.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_mcp/test_tool_returning_dict.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_mcp/test_tool_returning_error.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_mcp/test_tool_returning_image.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_mcp/test_tool_returning_image_resource.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_mcp/test_tool_returning_multiple_items.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_mcp/test_tool_returning_none.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_mcp/test_tool_returning_str.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_mcp/test_tool_returning_text_resource.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_settings/test_stop_settings[anthropic].yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_settings/test_stop_settings[bedrock].yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_settings/test_stop_settings[cohere].yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_settings/test_stop_settings[gemini].yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_settings/test_stop_settings[groq].yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_settings/test_stop_settings[mistral].yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_settings/test_stop_settings[openai].yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/conftest.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/evals/__init__.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/evals/test_dataset.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/evals/test_evaluator_base.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/evals/test_evaluator_common.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/evals/test_evaluator_context.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/evals/test_evaluator_spec.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/evals/test_evaluators.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/evals/test_llm_as_a_judge.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/evals/test_otel.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/evals/test_render_numbers.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/evals/test_reporting.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/evals/test_reports.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/evals/test_utils.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/evals/utils.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/example_modules/README.md +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/example_modules/bank_database.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/example_modules/fake_database.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/example_modules/weather_service.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/fasta2a/__init__.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/graph/__init__.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/graph/test_file_persistence.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/graph/test_graph.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/graph/test_mermaid.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/graph/test_persistence.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/graph/test_state.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/graph/test_utils.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/import_examples.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/json_body_serializer.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/mcp_server.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/__init__.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_anthropic/test_anthropic_model_instructions.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_anthropic/test_document_binary_content_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_anthropic/test_document_url_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_anthropic/test_extra_headers.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_anthropic/test_image_as_binary_content_tool_response.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_anthropic/test_image_url_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_anthropic/test_image_url_input_invalid_mime_type.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_anthropic/test_multiple_parallel_tool_calls.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_anthropic/test_text_document_url_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_bedrock_empty_system_prompt.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_bedrock_model.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_bedrock_model_anthropic_model_without_tools.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_bedrock_model_guardrail_config.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_bedrock_model_instructions.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_bedrock_model_iter_stream.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_bedrock_model_max_tokens.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_bedrock_model_other_parameters.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_bedrock_model_performance_config.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_bedrock_model_retry.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_bedrock_model_stream.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_bedrock_model_structured_response.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_bedrock_model_top_p.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_bedrock_multiple_documents_in_history.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_document_url_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_image_as_binary_content_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_image_url_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_text_as_binary_content_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_text_document_url_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_video_as_binary_content_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_video_url_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_cohere/test_cohere_model_instructions.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_cohere/test_request_simple_success_with_vcr.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_gemini/test_document_url_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_gemini/test_gemini_additional_properties_is_false.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_gemini/test_gemini_additional_properties_is_true.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_gemini/test_gemini_drop_exclusive_maximum.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_gemini/test_gemini_exclusive_minimum_and_maximum.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_gemini/test_gemini_model_instructions.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_gemini/test_image_as_binary_content_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_gemini/test_image_as_binary_content_tool_response.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_gemini/test_image_url_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_gemini/test_video_as_binary_content_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_gemini/test_video_url_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_groq/test_extra_headers.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_groq/test_groq_model_instructions.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_groq/test_image_as_binary_content_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_groq/test_image_as_binary_content_tool_response.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_groq/test_image_url_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_mistral/test_image_as_binary_content_tool_response.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_mistral/test_mistral_model_instructions.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai/test_audio_as_binary_content_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai/test_document_as_binary_content_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai/test_document_url_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai/test_extra_headers.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai/test_image_as_binary_content_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai/test_image_as_binary_content_tool_response.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai/test_image_url_tool_response.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai/test_max_completion_tokens[gpt-4.5-preview].yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai/test_max_completion_tokens[gpt-4o-mini].yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai/test_max_completion_tokens[o3-mini].yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai/test_multiple_agent_tool_calls.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai/test_openai_audio_url_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai/test_openai_instructions.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai/test_openai_instructions_with_tool_calls_keep_instructions.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai/test_openai_model_without_system_prompt.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai/test_openai_o1_mini_system_role[developer].yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai/test_openai_o1_mini_system_role[system].yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai/test_user_id.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai_responses/test_audio_as_binary_content_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai_responses/test_image_as_binary_content_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai_responses/test_image_as_binary_content_tool_response.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai_responses/test_openai_responses_document_as_binary_content_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai_responses/test_openai_responses_document_url_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai_responses/test_openai_responses_image_url_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai_responses/test_openai_responses_model_builtin_tools.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai_responses/test_openai_responses_model_http_error.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai_responses/test_openai_responses_model_instructions.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai_responses/test_openai_responses_model_retry.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai_responses/test_openai_responses_model_simple_response.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai_responses/test_openai_responses_model_simple_response_with_tool_call.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai_responses/test_openai_responses_output_type.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai_responses/test_openai_responses_reasoning_effort.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai_responses/test_openai_responses_reasoning_generate_summary.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai_responses/test_openai_responses_stream.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai_responses/test_openai_responses_system_prompt.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai_responses/test_openai_responses_text_document_url_input.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/mock_async_stream.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/test_anthropic.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/test_bedrock.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/test_cohere.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/test_fallback.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/test_gemini.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/test_groq.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/test_instrumented.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/test_mistral.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/test_model.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/test_model_function.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/test_model_names.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/test_model_request_parameters.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/test_model_test.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/test_openai.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/test_openai_responses.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/providers/__init__.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/providers/cassettes/test_azure/test_azure_provider_call.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/providers/cassettes/test_google_vertex/test_vertexai_provider.yaml +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/providers/test_anthropic.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/providers/test_azure.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/providers/test_bedrock.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/providers/test_cohere.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/providers/test_deepseek.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/providers/test_google_gla.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/providers/test_google_vertex.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/providers/test_groq.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/providers/test_mistral.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/providers/test_openai.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/providers/test_provider_names.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/test_a2a.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/test_agent.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/test_deps.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/test_direct.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/test_examples.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/test_format_as_xml.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/test_json_body_serializer.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/test_live.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/test_logfire.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/test_mcp.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/test_messages.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/test_parts_manager.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/test_settings.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/test_streaming.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/test_tools.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/test_usage_limits.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/test_utils.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/typed_agent.py +0 -0
- {pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/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.
|
|
3
|
+
Version: 0.2.4
|
|
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,groq,mcp,mistral,openai,vertexai]==0.2.
|
|
31
|
+
Requires-Dist: pydantic-ai-slim[a2a,anthropic,bedrock,cli,cohere,evals,groq,mcp,mistral,openai,vertexai]==0.2.4
|
|
32
32
|
Provides-Extra: examples
|
|
33
|
-
Requires-Dist: pydantic-ai-examples==0.2.
|
|
33
|
+
Requires-Dist: pydantic-ai-examples==0.2.4; extra == 'examples'
|
|
34
34
|
Provides-Extra: logfire
|
|
35
35
|
Requires-Dist: logfire>=3.11.0; extra == 'logfire'
|
|
36
36
|
Description-Content-Type: text/markdown
|
|
@@ -60,7 +60,7 @@ Documentation = "https://ai.pydantic.dev"
|
|
|
60
60
|
Changelog = "https://github.com/pydantic/pydantic-ai/releases"
|
|
61
61
|
|
|
62
62
|
[project.scripts]
|
|
63
|
-
pai = "pydantic_ai._cli:cli_exit"
|
|
63
|
+
pai = "pydantic_ai._cli:cli_exit" # TODO remove this when clai has been out for a while
|
|
64
64
|
|
|
65
65
|
[tool.uv.sources]
|
|
66
66
|
pydantic-ai-slim = { workspace = true }
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import sys
|
|
2
|
+
import types
|
|
2
3
|
from io import StringIO
|
|
3
|
-
from typing import Any
|
|
4
|
+
from typing import Any, Callable
|
|
4
5
|
|
|
5
6
|
import pytest
|
|
6
7
|
from dirty_equals import IsInstance, IsStr
|
|
@@ -16,11 +17,13 @@ from pydantic_ai.models.test import TestModel
|
|
|
16
17
|
from .conftest import TestEnv, try_import
|
|
17
18
|
|
|
18
19
|
with try_import() as imports_successful:
|
|
20
|
+
from openai import OpenAIError
|
|
19
21
|
from prompt_toolkit.input import create_pipe_input
|
|
20
22
|
from prompt_toolkit.output import DummyOutput
|
|
21
23
|
from prompt_toolkit.shortcuts import PromptSession
|
|
22
24
|
|
|
23
25
|
from pydantic_ai._cli import cli, cli_agent, handle_slash_command
|
|
26
|
+
from pydantic_ai.models.openai import OpenAIModel
|
|
24
27
|
|
|
25
28
|
pytestmark = pytest.mark.skipif(not imports_successful(), reason='install cli extras to run cli tests')
|
|
26
29
|
|
|
@@ -32,70 +35,90 @@ def test_cli_version(capfd: CaptureFixture[str]):
|
|
|
32
35
|
|
|
33
36
|
def test_invalid_model(capfd: CaptureFixture[str]):
|
|
34
37
|
assert cli(['--model', 'potato']) == 1
|
|
35
|
-
assert capfd.readouterr().out.splitlines() == snapshot(
|
|
36
|
-
[IsStr(), 'Error initializing potato:', 'Unknown model: potato']
|
|
37
|
-
)
|
|
38
|
+
assert capfd.readouterr().out.splitlines() == snapshot(['Error initializing potato:', 'Unknown model: potato'])
|
|
38
39
|
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
@pytest.fixture
|
|
42
|
+
def create_test_module():
|
|
43
|
+
def _create_test_module(**namespace: Any) -> None:
|
|
44
|
+
assert 'test_module' not in sys.modules
|
|
42
45
|
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
test_module = types.ModuleType('test_module')
|
|
47
|
+
for key, value in namespace.items():
|
|
48
|
+
setattr(test_module, key, value)
|
|
45
49
|
|
|
46
|
-
|
|
50
|
+
sys.modules['test_module'] = test_module
|
|
47
51
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
try:
|
|
53
|
+
yield _create_test_module
|
|
54
|
+
finally:
|
|
55
|
+
if 'test_module' in sys.modules:
|
|
56
|
+
del sys.modules['test_module']
|
|
52
57
|
|
|
53
|
-
# Register the module in sys.modules
|
|
54
|
-
sys.modules['test_module'] = test_module
|
|
55
58
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
def test_agent_flag(
|
|
60
|
+
capfd: CaptureFixture[str],
|
|
61
|
+
mocker: MockerFixture,
|
|
62
|
+
env: TestEnv,
|
|
63
|
+
create_test_module: Callable[..., None],
|
|
64
|
+
):
|
|
65
|
+
env.remove('OPENAI_API_KEY')
|
|
59
66
|
|
|
60
|
-
|
|
61
|
-
|
|
67
|
+
test_agent = Agent(TestModel(custom_output_text='Hello from custom agent'))
|
|
68
|
+
create_test_module(custom_agent=test_agent)
|
|
62
69
|
|
|
63
|
-
|
|
64
|
-
|
|
70
|
+
# Mock ask_agent to avoid actual execution but capture the agent
|
|
71
|
+
mock_ask = mocker.patch('pydantic_ai._cli.ask_agent')
|
|
65
72
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
assert mock_ask.call_args[0][0] is test_agent
|
|
73
|
+
# Test CLI with custom agent
|
|
74
|
+
assert cli(['--agent', 'test_module:custom_agent', 'hello']) == 0
|
|
69
75
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if 'test_module' in sys.modules:
|
|
73
|
-
del sys.modules['test_module']
|
|
76
|
+
# Verify the output contains the custom agent message
|
|
77
|
+
assert 'using custom agent test_module:custom_agent' in capfd.readouterr().out
|
|
74
78
|
|
|
79
|
+
# Verify ask_agent was called with our custom agent
|
|
80
|
+
mock_ask.assert_called_once()
|
|
81
|
+
assert mock_ask.call_args[0][0] is test_agent
|
|
75
82
|
|
|
76
|
-
def test_agent_flag_non_agent(capfd: CaptureFixture[str], mocker: MockerFixture, env: TestEnv):
|
|
77
|
-
env.set('OPENAI_API_KEY', 'test')
|
|
78
83
|
|
|
79
|
-
|
|
80
|
-
|
|
84
|
+
def test_agent_flag_no_model(env: TestEnv, create_test_module: Callable[..., None]):
|
|
85
|
+
env.remove('OPENAI_API_KEY')
|
|
86
|
+
test_agent = Agent()
|
|
87
|
+
create_test_module(custom_agent=test_agent)
|
|
81
88
|
|
|
82
|
-
|
|
89
|
+
msg = 'The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable'
|
|
90
|
+
with pytest.raises(OpenAIError, match=msg):
|
|
91
|
+
cli(['--agent', 'test_module:custom_agent', 'hello'])
|
|
83
92
|
|
|
84
|
-
# Create and add agent to the module
|
|
85
|
-
test_agent = 'Not an Agent object'
|
|
86
|
-
setattr(test_module, 'custom_agent', test_agent)
|
|
87
93
|
|
|
88
|
-
|
|
89
|
-
|
|
94
|
+
def test_agent_flag_set_model(
|
|
95
|
+
capfd: CaptureFixture[str],
|
|
96
|
+
mocker: MockerFixture,
|
|
97
|
+
env: TestEnv,
|
|
98
|
+
create_test_module: Callable[..., None],
|
|
99
|
+
):
|
|
100
|
+
env.set('OPENAI_API_KEY', 'xxx')
|
|
90
101
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
assert 'is not an Agent' in capfd.readouterr().out
|
|
102
|
+
custom_agent = Agent(TestModel(custom_output_text='Hello from custom agent'))
|
|
103
|
+
create_test_module(custom_agent=custom_agent)
|
|
94
104
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
105
|
+
mocker.patch('pydantic_ai._cli.ask_agent')
|
|
106
|
+
|
|
107
|
+
assert cli(['--agent', 'test_module:custom_agent', '--model', 'gpt-4o', 'hello']) == 0
|
|
108
|
+
|
|
109
|
+
assert 'using custom agent test_module:custom_agent with openai:gpt-4o' in capfd.readouterr().out
|
|
110
|
+
|
|
111
|
+
assert isinstance(custom_agent.model, OpenAIModel)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def test_agent_flag_non_agent(
|
|
115
|
+
capfd: CaptureFixture[str], mocker: MockerFixture, create_test_module: Callable[..., None]
|
|
116
|
+
):
|
|
117
|
+
test_agent = 'Not an Agent object'
|
|
118
|
+
create_test_module(custom_agent=test_agent)
|
|
119
|
+
|
|
120
|
+
assert cli(['--agent', 'test_module:custom_agent', 'hello']) == 1
|
|
121
|
+
assert 'is not an Agent' in capfd.readouterr().out
|
|
99
122
|
|
|
100
123
|
|
|
101
124
|
def test_agent_flag_bad_module_variable_path(capfd: CaptureFixture[str], mocker: MockerFixture, env: TestEnv):
|
|
@@ -106,7 +129,7 @@ def test_agent_flag_bad_module_variable_path(capfd: CaptureFixture[str], mocker:
|
|
|
106
129
|
def test_list_models(capfd: CaptureFixture[str]):
|
|
107
130
|
assert cli(['--list-models']) == 0
|
|
108
131
|
output = capfd.readouterr().out.splitlines()
|
|
109
|
-
assert output[:
|
|
132
|
+
assert output[:3] == snapshot([IsStr(regex='pai - PydanticAI CLI .*'), '', 'Available models:'])
|
|
110
133
|
|
|
111
134
|
providers = (
|
|
112
135
|
'openai',
|
|
@@ -119,7 +142,7 @@ def test_list_models(capfd: CaptureFixture[str]):
|
|
|
119
142
|
'cohere',
|
|
120
143
|
'deepseek',
|
|
121
144
|
)
|
|
122
|
-
models = {line.strip().split(' ')[0] for line in output[
|
|
145
|
+
models = {line.strip().split(' ')[0] for line in output[3:]}
|
|
123
146
|
for provider in providers:
|
|
124
147
|
models = models - {model for model in models if model.startswith(provider)}
|
|
125
148
|
assert models == set(), models
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_mcp/test_agent_with_stdio_server.yaml
RENAMED
|
File without changes
|
{pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_mcp/test_tool_returning_dict.yaml
RENAMED
|
File without changes
|
{pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_mcp/test_tool_returning_error.yaml
RENAMED
|
File without changes
|
{pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_mcp/test_tool_returning_image.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_mcp/test_tool_returning_none.yaml
RENAMED
|
File without changes
|
{pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_mcp/test_tool_returning_str.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/cassettes/test_settings/test_stop_settings[groq].yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_bedrock/test_bedrock_model.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_gemini/test_image_url_input.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_gemini/test_video_url_input.yaml
RENAMED
|
File without changes
|
{pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_groq/test_extra_headers.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_groq/test_image_url_input.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai/test_extra_headers.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pydantic_ai-0.2.3 → pydantic_ai-0.2.4}/tests/models/cassettes/test_openai/test_user_id.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|