Build AI methods with your coding agent, then run them anywhere: as an MCP for chatbots, as a webapp for people, or via API for your software.
chore/Bumping · L-260927-61a69f (#1289)
Louis Choquel85729dfd3fbe
diff --git a/.pipelex/inference/backends/bedrock.toml b/.pipelex/inference/backends/bedrock.tomlindex 4a6ac6bf9..e876def7c 100644--- a/.pipelex/inference/backends/bedrock.toml+++ b/.pipelex/inference/backends/bedrock.toml@@ -22,7 +22,7 @@[defaults]model_type = "llm"-sdk = "bedrock_aioboto3"+sdk = "bedrock_aioboto"thinking_mode = "none"################################################################################diff --git a/.pipelex/inference/backends/google.toml b/.pipelex/inference/backends/google.tomlindex 5c93038ac..69d8ddf68 100644--- a/.pipelex/inference/backends/google.toml+++ b/.pipelex/inference/backends/google.toml@@ -23,7 +23,7 @@[defaults]model_type = "llm"sdk = "google"-structure_method = "instructor/genai_tools"+structure_method = "instructor/genai_structured_outputs" # Gemini's native JSON outputthinking_mode = "manual"################################################################################diff --git a/.test_durations b/.test_durationsindex 6011f6fe4..89ff33cd0 100644--- a/.test_durations+++ b/.test_durations@@ -177,8 +177,8 @@"tests/e2e/test_signature_validation_mthds.py::TestSignatureValidationE2E::test_signature_only_bundle_strict_reports_pending": 1.358,"tests/e2e/test_signature_validation_mthds.py::TestSignatureValidationE2E::test_structured_output_signature_lenient_passes": 0.4509,"tests/helpers/test_instructor_test_utils.py::TestInstructorTestUtils::test_dummy_schema_has_single_text_field": 0.1404,- "tests/helpers/test_instructor_test_utils.py::TestInstructorTestUtils::test_wrap_with_failed_attempts_exposes_sdk_exception": 0.9458,- "tests/helpers/test_instructor_test_utils.py::TestInstructorTestUtils::test_wrap_without_failed_attempts_leaves_attempts_empty": 0.0003,+ "tests/helpers/test_instructor_test_utils.py::TestInstructorTestUtils::test_wrap_chains_from_the_sdk_exception": 0.4308,+ "tests/helpers/test_instructor_test_utils.py::TestInstructorTestUtils::test_wrap_records_earlier_parse_failures_only": 0.0062,"tests/helpers/test_ts_toolchain.py::TestTsToolchainResolversReturnAbsolutePaths::test_resolve_node_absolutizes_a_relative_path_entry": 0.2726,"tests/helpers/test_ts_toolchain.py::TestTsToolchainResolversReturnAbsolutePaths::test_resolve_prettier_absolutizes_a_relative_path_entry": 3.3773,"tests/helpers/test_ts_toolchain.py::TestTsToolchainResolversReturnAbsolutePaths::test_resolve_zod_package_absolutizes_a_relative_env_value": 0.0542,@@ -3958,9 +3958,11 @@"tests/unit/pipelex/cogt/inference/test_error_classification_unknown.py::TestInferenceErrorCategoryUnknown::test_unknown_is_not_retryable": 0.0004,"tests/unit/pipelex/cogt/inference/test_error_classification_unknown.py::TestInferenceErrorCategoryUnknown::test_unknown_member_exists_with_string_value": 0.8232,"tests/unit/pipelex/cogt/inference/test_error_classification_unwrap.py::TestExtractUnderlyingSdkException::test_does_not_raise_on_malformed_input": 0.0901,- "tests/unit/pipelex/cogt/inference/test_error_classification_unwrap.py::TestExtractUnderlyingSdkException::test_falls_back_to_cause_last_attempt": 0.0006,+ "tests/unit/pipelex/cogt/inference/test_error_classification_unwrap.py::TestExtractUnderlyingSdkException::test_falls_back_to_the_last_failed_attempt_without_a_cause": 0.0006,+ "tests/unit/pipelex/cogt/inference/test_error_classification_unwrap.py::TestExtractUnderlyingSdkException::test_prefers_the_sdk_exception_over_an_earlier_parse_failure": 0.0014,"tests/unit/pipelex/cogt/inference/test_error_classification_unwrap.py::TestExtractUnderlyingSdkException::test_returns_none_when_both_paths_empty": 0.0005,- "tests/unit/pipelex/cogt/inference/test_error_classification_unwrap.py::TestExtractUnderlyingSdkException::test_returns_sdk_exception_from_failed_attempts": 0.7392,+ "tests/unit/pipelex/cogt/inference/test_error_classification_unwrap.py::TestExtractUnderlyingSdkException::test_returns_the_last_attempt_of_a_spent_retry_budget": 0.3906,+ "tests/unit/pipelex/cogt/inference/test_error_classification_unwrap.py::TestExtractUnderlyingSdkException::test_returns_the_sdk_exception_the_wrapper_is_chained_from": 0.0819,"tests/unit/pipelex/cogt/inference/test_gateway_request_limits.py::TestClassification::test_a_413_without_the_code_is_left_to_the_status_ladder": 0.0011,"tests/unit/pipelex/cogt/inference/test_gateway_request_limits.py::TestClassification::test_each_limit_classifies_as_a_caller_error[pig-07-413-body_too_large-content-change_input]": 0.0008,"tests/unit/pipelex/cogt/inference/test_gateway_request_limits.py::TestClassification::test_each_limit_classifies_as_a_caller_error[pig-08-411-body_length_required-configuration-contact_support]": 0.0004,@@ -4300,8 +4302,10 @@"tests/unit/pipelex/cogt/inference/test_user_action.py::TestUserAction::test_user_action_requires_kind": 0.0003,"tests/unit/pipelex/cogt/inference/test_user_action.py::TestUserAction::test_user_action_round_trips": 0.0917,"tests/unit/pipelex/cogt/llm/test_instructor_retry.py::TestInstructorSchemaRetrying::test_json_decode_error_is_retried": 0.0047,+ "tests/unit/pipelex/cogt/llm/test_instructor_retry.py::TestInstructorSchemaRetrying::test_predicate_matches_what_instructor_itself_reasks": 0.0023,"tests/unit/pipelex/cogt/llm/test_instructor_retry.py::TestInstructorSchemaRetrying::test_transport_error_is_not_retried[transport_exc0]": 0.0022,"tests/unit/pipelex/cogt/llm/test_instructor_retry.py::TestInstructorSchemaRetrying::test_transport_error_is_not_retried[transport_exc1]": 0.0112,+ "tests/unit/pipelex/cogt/llm/test_instructor_retry.py::TestInstructorSchemaRetrying::test_unparseable_response_is_retried": 0.0629,"tests/unit/pipelex/cogt/llm/test_instructor_retry.py::TestInstructorSchemaRetrying::test_validation_error_is_retried_up_to_stop": 0.7685,"tests/unit/pipelex/cogt/llm/test_instructor_retry.py::TestInstructorSchemaRetrying::test_validation_error_then_success_returns_value": 0.1063,"tests/unit/pipelex/cogt/llm/test_llm_config_reasoning.py::TestLLMConfigReasoning::test_all_effort_levels_retrievable[high]": 0.0009,@@ -4359,6 +4363,7 @@"tests/unit/pipelex/cogt/llm/test_llm_setting_reasoning.py::TestLLMSettingReasoning::test_reasoning_budget_alone_is_valid": 0.0005,"tests/unit/pipelex/cogt/llm/test_llm_setting_reasoning.py::TestLLMSettingReasoning::test_reasoning_effort_alone_is_valid": 0.0011,"tests/unit/pipelex/cogt/llm/test_llm_worker_current_span.py::TestLLMWorkerCurrentSpan::test_a_failed_call_restores_the_previous_span_and_is_recorded_once": 0.0081,+ "tests/unit/pipelex/cogt/llm/test_llm_worker_current_span.py::TestLLMWorkerCurrentSpan::test_a_no_op_tracer_holds_no_span_in_the_call": 0.4277,"tests/unit/pipelex/cogt/llm/test_llm_worker_current_span.py::TestLLMWorkerCurrentSpan::test_gen_object_runs_the_provider_call_under_its_span": 0.005,"tests/unit/pipelex/cogt/llm/test_llm_worker_current_span.py::TestLLMWorkerCurrentSpan::test_gen_text_runs_the_provider_call_under_its_span": 0.0762,"tests/unit/pipelex/cogt/llm/test_llm_worker_current_span.py::TestLLMWorkerCurrentSpan::test_the_call_never_makes_its_span_opentelemetrys_current_one": 0.0067,@@ -4366,7 +4371,7 @@"tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py::TestLLMWorkerFactory::test_cached_sdk_instance_skips_client_factory": 0.0032,"tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py::TestLLMWorkerFactory::test_cold_registry_creates_then_reuses_sdk_instance": 0.0022,"tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py::TestLLMWorkerFactory::test_missing_dependency_raises[anthropic]": 0.0063,- "tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py::TestLLMWorkerFactory::test_missing_dependency_raises[bedrock_aioboto3]": 0.0091,+ "tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py::TestLLMWorkerFactory::test_missing_dependency_raises[bedrock_aioboto]": 0.0091,"tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py::TestLLMWorkerFactory::test_missing_dependency_raises[bedrock_anthropic]": 0.0092,"tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py::TestLLMWorkerFactory::test_missing_dependency_raises[bedrock_boto3]": 0.0015,"tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py::TestLLMWorkerFactory::test_missing_dependency_raises[google]": 0.0014,@@ -4374,7 +4379,7 @@"tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py::TestLLMWorkerFactory::test_routing_builds_expected_worker[anthropic]": 0.0017,"tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py::TestLLMWorkerFactory::test_routing_builds_expected_worker[azure_openai]": 0.0021,"tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py::TestLLMWorkerFactory::test_routing_builds_expected_worker[azure_openai_responses]": 0.0027,- "tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py::TestLLMWorkerFactory::test_routing_builds_expected_worker[bedrock_aioboto3]": 0.0028,+ "tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py::TestLLMWorkerFactory::test_routing_builds_expected_worker[bedrock_aioboto]": 0.0028,"tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py::TestLLMWorkerFactory::test_routing_builds_expected_worker[bedrock_anthropic]": 0.0037,"tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py::TestLLMWorkerFactory::test_routing_builds_expected_worker[bedrock_boto3]": 0.0044,"tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py::TestLLMWorkerFactory::test_routing_builds_expected_worker[gateway_completions]": 1.3915,@@ -4386,37 +4391,67 @@"tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py::TestLLMWorkerFactory::test_routing_builds_expected_worker[portkey_completions]": 0.0021,"tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py::TestLLMWorkerFactory::test_routing_builds_expected_worker[portkey_responses]": 0.0025,"tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py::TestLLMWorkerFactory::test_unknown_sdk_raises_backend_not_found": 0.152,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/anthropic_json]": 0.0009,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/anthropic_reasoning_tools]": 0.0004,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/anthropic_tools]": 0.0004,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/bedrock_json]": 0.0003,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/bedrock_tools]": 0.0003,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/cerebras_json]": 0.0003,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/cerebras_tools]": 0.0008,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/cohere_json_schema]": 0.0011,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/cohere_tools]": 0.0004,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/fireworks_json]": 0.0008,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/fireworks_tools]": 0.0003,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/genai_structured_outputs]": 0.0004,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/genai_tools]": 0.0007,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/json]": 0.0069,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/json_schema]": 0.0004,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/md_json]": 0.0005,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/mistral_structured_outputs]": 0.0061,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/mistral_tools]": 0.0004,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/openai_json_o1]": 0.0003,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/openai_parallel_tools]": 0.0004,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/openai_responses_tools]": 0.0004,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/openai_responses_tools_with_inbuilt_tools]": 0.0005,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/openai_structured_outputs]": 0.0004,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/openai_tools]": 0.0004,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/openrouter_structured_outputs]": 0.1222,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/perplexity_json]": 0.0003,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/vertexai_json]": 0.0004,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/vertexai_parallel_tools]": 0.0008,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/vertexai_tools]": 0.0008,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode[instructor/writer_tools]": 0.0007,- "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_expected_modes_cover_every_member": 1.5278,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/anthropic_json]": 0.0004,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/anthropic_reasoning_tools]": 0.0004,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/anthropic_tools]": 0.0011,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/bedrock_json]": 0.0003,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/bedrock_tools]": 0.0005,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/cerebras_json]": 0.0009,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/cerebras_tools]": 0.0007,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/cohere_json_schema]": 0.0007,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/cohere_tools]": 0.0003,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/fireworks_json]": 0.0011,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/fireworks_tools]": 0.4145,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/genai_structured_outputs]": 0.4154,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/genai_tools]": 0.0004,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/json]": 0.0006,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/json_schema]": 0.0012,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/md_json]": 0.0009,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/mistral_structured_outputs]": 0.4211,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/mistral_tools]": 0.0009,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/openai_json_o1]": 0.0004,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/openai_parallel_tools]": 0.4081,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/openai_responses_tools]": 0.0008,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/openai_responses_tools_with_inbuilt_tools]": 0.3885,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/openai_structured_outputs]": 0.0004,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/openai_tools]": 0.0004,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/openrouter_structured_outputs]": 0.0004,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/perplexity_json]": 0.3724,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/vertexai_json]": 0.0007,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/vertexai_parallel_tools]": 0.0004,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/vertexai_tools]": 0.0003,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to[instructor/writer_tools]": 0.0007,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/anthropic_json]": 0.0067,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/anthropic_reasoning_tools]": 0.0057,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/anthropic_tools]": 0.3298,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/bedrock_json]": 0.0066,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/bedrock_tools]": 0.0071,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/cerebras_json]": 0.0079,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/cerebras_tools]": 0.3154,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/cohere_json_schema]": 0.1329,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/cohere_tools]": 0.0158,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/fireworks_json]": 0.0118,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/fireworks_tools]": 0.711,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/genai_structured_outputs]": 0.7472,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/genai_tools]": 0.3136,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/json]": 0.326,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/json_schema]": 0.4416,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/md_json]": 0.0053,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/mistral_structured_outputs]": 0.6994,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/mistral_tools]": 0.2909,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/openai_json_o1]": 0.2954,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/openai_parallel_tools]": 0.7453,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/openai_responses_tools]": 0.0116,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/openai_responses_tools_with_inbuilt_tools]": 0.4344,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/openai_structured_outputs]": 0.3657,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/openai_tools]": 0.0123,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/openrouter_structured_outputs]": 0.0045,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/perplexity_json]": 0.7329,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/vertexai_json]": 0.008,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/vertexai_parallel_tools]": 0.2971,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/vertexai_tools]": 0.0083,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_every_structure_method_is_accepted_on_the_openai_sdk[instructor/writer_tools]": 0.0121,+ "tests/unit/pipelex/cogt/llm/test_structured_output.py::TestStructureMethod::test_legacy_modes_cover_every_member": 0.0638,"tests/unit/pipelex/cogt/model_backends/test_backend_boot_tolerance.py::TestAStaleBackendDirectory::test_a_file_the_ledger_only_half_explains_raises_the_users_own_error[False]": 0.1716,"tests/unit/pipelex/cogt/model_backends/test_backend_boot_tolerance.py::TestAStaleBackendDirectory::test_a_file_the_ledger_only_half_explains_raises_the_users_own_error[True]": 0.1165,"tests/unit/pipelex/cogt/model_backends/test_backend_boot_tolerance.py::TestAStaleBackendDirectory::test_a_healthy_directory_loads_and_says_nothing[False]": 0.0183,@@ -9305,7 +9340,7 @@"tests/unit/pipelex/plugins/test_inference_backend_coverage.py::TestInferenceBackendCoverage::test_backend_is_registered[llm:anthropic]": 0.0005,"tests/unit/pipelex/plugins/test_inference_backend_coverage.py::TestInferenceBackendCoverage::test_backend_is_registered[llm:azure_openai]": 0.0012,"tests/unit/pipelex/plugins/test_inference_backend_coverage.py::TestInferenceBackendCoverage::test_backend_is_registered[llm:azure_openai_responses]": 0.0009,- "tests/unit/pipelex/plugins/test_inference_backend_coverage.py::TestInferenceBackendCoverage::test_backend_is_registered[llm:bedrock_aioboto3]": 0.0006,+ "tests/unit/pipelex/plugins/test_inference_backend_coverage.py::TestInferenceBackendCoverage::test_backend_is_registered[llm:bedrock_aioboto]": 0.0006,"tests/unit/pipelex/plugins/test_inference_backend_coverage.py::TestInferenceBackendCoverage::test_backend_is_registered[llm:bedrock_anthropic]": 0.0005,"tests/unit/pipelex/plugins/test_inference_backend_coverage.py::TestInferenceBackendCoverage::test_backend_is_registered[llm:bedrock_boto3]": 0.0018,"tests/unit/pipelex/plugins/test_inference_backend_coverage.py::TestInferenceBackendCoverage::test_backend_is_registered[llm:gateway_completions]": 0.0005,@@ -9334,7 +9369,7 @@"tests/unit/pipelex/plugins/test_model_lister_coverage.py::TestModelListerCoverage::test_registered_sdk_resolves_to_a_lister[azure_openai]": 0.0006,"tests/unit/pipelex/plugins/test_model_lister_coverage.py::TestModelListerCoverage::test_registered_sdk_resolves_to_a_lister[azure_openai_responses]": 0.001,"tests/unit/pipelex/plugins/test_model_lister_coverage.py::TestModelListerCoverage::test_registered_sdk_resolves_to_a_lister[bedrock]": 0.001,- "tests/unit/pipelex/plugins/test_model_lister_coverage.py::TestModelListerCoverage::test_registered_sdk_resolves_to_a_lister[bedrock_aioboto3]": 0.0004,+ "tests/unit/pipelex/plugins/test_model_lister_coverage.py::TestModelListerCoverage::test_registered_sdk_resolves_to_a_lister[bedrock_aioboto]": 0.0004,"tests/unit/pipelex/plugins/test_model_lister_coverage.py::TestModelListerCoverage::test_registered_sdk_resolves_to_a_lister[google]": 0.0008,"tests/unit/pipelex/plugins/test_model_lister_coverage.py::TestModelListerCoverage::test_registered_sdk_resolves_to_a_lister[mistral]": 0.0004,"tests/unit/pipelex/plugins/test_model_lister_coverage.py::TestModelListerCoverage::test_registered_sdk_resolves_to_a_lister[openai]": 0.8565,@@ -9415,6 +9450,8 @@"tests/unit/pipelex/providers/anthropic/test_anthropic_reasoning.py::TestAnthropicReasoning::test_manual_mode_effort_maps_to_budget[xhigh-32768]": 0.0346,"tests/unit/pipelex/providers/anthropic/test_anthropic_reasoning.py::TestAnthropicReasoning::test_manual_mode_effort_none_disables_thinking": 0.0017,"tests/unit/pipelex/providers/anthropic/test_anthropic_reasoning.py::TestAnthropicReasoning::test_thinking_mode_none_raises_capability_error": 0.088,+ "tests/unit/pipelex/providers/anthropic/test_anthropic_structure_method.py::TestAnthropicStructureMethod::test_reasoning_tools_leaves_the_tool_choice_on_auto": 0.6873,+ "tests/unit/pipelex/providers/anthropic/test_anthropic_structure_method.py::TestAnthropicStructureMethod::test_tools_forces_the_response_tool": 0.6455,"tests/unit/pipelex/providers/anthropic/test_anthropic_worker_error_handling.py::TestAnthropicWorkerErrorHandling::test_auth_error_is_configuration": 0.0764,"tests/unit/pipelex/providers/anthropic/test_anthropic_worker_error_handling.py::TestAnthropicWorkerErrorHandling::test_bad_request[content_policy-Your request was rejected due to content_policy_violation-content-safety filters]": 0.1068,"tests/unit/pipelex/providers/anthropic/test_anthropic_worker_error_handling.py::TestAnthropicWorkerErrorHandling::test_bad_request[generic_bad_request-Invalid parameter: max_tokens must be positive-content-None]": 0.0918,@@ -9434,7 +9471,7 @@"tests/unit/pipelex/providers/anthropic/test_anthropic_worker_object_error_handling.py::TestAnthropicWorkerObjectErrorHandling::test_raw_sdk_transport_error_is_classified[sdk_exc1-transient]": 0.0033,"tests/unit/pipelex/providers/anthropic/test_anthropic_worker_object_error_handling.py::TestAnthropicWorkerObjectErrorHandling::test_raw_sdk_transport_error_is_classified[sdk_exc2-transient]": 0.0064,"tests/unit/pipelex/providers/anthropic/test_anthropic_worker_object_error_handling.py::TestAnthropicWorkerObjectErrorHandling::test_raw_sdk_transport_error_is_classified[sdk_exc3-transient]": 0.107,- "tests/unit/pipelex/providers/anthropic/test_anthropic_worker_object_error_handling.py::TestAnthropicWorkerObjectErrorHandling::test_real_instructor_propagates_transport_error_raw": 0.0144,+ "tests/unit/pipelex/providers/anthropic/test_anthropic_worker_object_error_handling.py::TestAnthropicWorkerObjectErrorHandling::test_real_instructor_transport_error_is_unwrapped": 0.1112,"tests/unit/pipelex/providers/anthropic/test_anthropic_worker_object_error_handling.py::TestAnthropicWorkerObjectErrorHandling::test_unrecognized_underlying_falls_back_to_unknown": 0.0046,"tests/unit/pipelex/providers/anthropic/test_anthropic_worker_object_error_handling.py::TestAnthropicWorkerObjectErrorHandling::test_wrapped_auth_error_is_configuration": 0.0028,"tests/unit/pipelex/providers/anthropic/test_anthropic_worker_object_error_handling.py::TestAnthropicWorkerObjectErrorHandling::test_wrapped_bad_request_content_policy": 0.0027,@@ -9709,7 +9746,7 @@"tests/unit/pipelex/providers/google/test_google_llm_worker_object_error_handling.py::TestGoogleLLMWorkerObjectErrorHandling::test_raw_sdk_transport_error_is_classified[sdk_exc1-transient]": 0.0022,"tests/unit/pipelex/providers/google/test_google_llm_worker_object_error_handling.py::TestGoogleLLMWorkerObjectErrorHandling::test_raw_sdk_transport_error_is_classified[sdk_exc2-transient]": 0.0024,"tests/unit/pipelex/providers/google/test_google_llm_worker_object_error_handling.py::TestGoogleLLMWorkerObjectErrorHandling::test_raw_sdk_transport_error_is_classified[sdk_exc3-transient]": 0.1268,- "tests/unit/pipelex/providers/google/test_google_llm_worker_object_error_handling.py::TestGoogleLLMWorkerObjectErrorHandling::test_real_instructor_propagates_client_error_raw": 0.0352,+ "tests/unit/pipelex/providers/google/test_google_llm_worker_object_error_handling.py::TestGoogleLLMWorkerObjectErrorHandling::test_real_instructor_client_error_is_unwrapped": 0.132,"tests/unit/pipelex/providers/google/test_google_llm_worker_object_error_handling.py::TestGoogleLLMWorkerObjectErrorHandling::test_unrecognized_underlying_falls_back_to_unknown": 0.0037,"tests/unit/pipelex/providers/google/test_google_llm_worker_object_error_handling.py::TestGoogleLLMWorkerObjectErrorHandling::test_wrapped_auth_error_is_configuration": 0.0029,"tests/unit/pipelex/providers/google/test_google_llm_worker_object_error_handling.py::TestGoogleLLMWorkerObjectErrorHandling::test_wrapped_bad_request_content_policy": 0.0092,@@ -9919,11 +9956,14 @@"tests/unit/pipelex/providers/mistral/test_extract_mistral_metadata.py::TestExtractMistralMetadata::test_httpx_read_error_marked_as_network_error": 0.0013,"tests/unit/pipelex/providers/mistral/test_extract_mistral_metadata.py::TestExtractMistralMetadata::test_httpx_remote_protocol_error_marked_as_network_error": 0.1098,"tests/unit/pipelex/providers/mistral/test_extract_mistral_metadata.py::TestExtractMistralMetadata::test_retry_after_seconds_is_none_when_header_absent": 0.0004,+ "tests/unit/pipelex/providers/mistral/test_mistral_extract_worker_semantic.py::TestMistralExtractWorkerSemantic::test_a_caption_request_is_refused_before_either_path_starts[None-https://example.com/doc.pdf]": 0.287,+ "tests/unit/pipelex/providers/mistral/test_mistral_extract_worker_semantic.py::TestMistralExtractWorkerSemantic::test_a_caption_request_is_refused_before_either_path_starts[https://example.com/test.png-None]": 0.2842,"tests/unit/pipelex/providers/mistral/test_mistral_extract_worker_semantic.py::TestMistralExtractWorkerSemantic::test_httpx_transport_error_document_path_is_wrapped_as_transient": 0.0043,"tests/unit/pipelex/providers/mistral/test_mistral_extract_worker_semantic.py::TestMistralExtractWorkerSemantic::test_httpx_transport_error_image_path_is_wrapped_as_transient[ConnectError-ConnectError]": 0.0027,"tests/unit/pipelex/providers/mistral/test_mistral_extract_worker_semantic.py::TestMistralExtractWorkerSemantic::test_httpx_transport_error_image_path_is_wrapped_as_transient[ConnectTimeout-ConnectTimeout]": 0.0026,"tests/unit/pipelex/providers/mistral/test_mistral_extract_worker_semantic.py::TestMistralExtractWorkerSemantic::test_httpx_transport_error_image_path_is_wrapped_as_transient[ReadError-TransportError]": 0.0045,"tests/unit/pipelex/providers/mistral/test_mistral_extract_worker_semantic.py::TestMistralExtractWorkerSemantic::test_httpx_transport_error_image_path_is_wrapped_as_transient[RemoteProtocolError-TransportError]": 0.0036,+ "tests/unit/pipelex/providers/mistral/test_mistral_extract_worker_semantic.py::TestMistralExtractWorkerSemantic::test_image_path_asks_for_the_figures_it_finds": 0.0816,"tests/unit/pipelex/providers/mistral/test_mistral_extract_worker_semantic.py::TestMistralExtractWorkerSemantic::test_mistral_404_raises_extract_model_not_found_error": 0.1104,"tests/unit/pipelex/providers/mistral/test_mistral_extract_worker_semantic.py::TestMistralExtractWorkerSemantic::test_mistral_error_carries_semantic_user_action[400-Invalid request-content-change_input]": 0.0017,"tests/unit/pipelex/providers/mistral/test_mistral_extract_worker_semantic.py::TestMistralExtractWorkerSemantic::test_mistral_error_carries_semantic_user_action[400-Request blocked by content_policy-content-change_input]": 0.0022,@@ -9978,7 +10018,7 @@"tests/unit/pipelex/providers/mistral/test_mistral_llm_worker_object_error_handling.py::TestMistralLLMWorkerObjectErrorHandling::test_raw_sdk_transport_error_is_classified[sdk_exc1-transient]": 0.0033,"tests/unit/pipelex/providers/mistral/test_mistral_llm_worker_object_error_handling.py::TestMistralLLMWorkerObjectErrorHandling::test_raw_sdk_transport_error_is_classified[sdk_exc2-transient]": 0.0027,"tests/unit/pipelex/providers/mistral/test_mistral_llm_worker_object_error_handling.py::TestMistralLLMWorkerObjectErrorHandling::test_raw_sdk_transport_error_is_classified[sdk_exc3-transient]": 0.0936,- "tests/unit/pipelex/providers/mistral/test_mistral_llm_worker_object_error_handling.py::TestMistralLLMWorkerObjectErrorHandling::test_real_instructor_propagates_transport_error_raw": 0.019,+ "tests/unit/pipelex/providers/mistral/test_mistral_llm_worker_object_error_handling.py::TestMistralLLMWorkerObjectErrorHandling::test_real_instructor_transport_error_is_unwrapped": 0.4685,"tests/unit/pipelex/providers/mistral/test_mistral_llm_worker_object_error_handling.py::TestMistralLLMWorkerObjectErrorHandling::test_unrecognized_underlying_falls_back_to_unknown": 0.0056,"tests/unit/pipelex/providers/mistral/test_mistral_llm_worker_object_error_handling.py::TestMistralLLMWorkerObjectErrorHandling::test_wrapped_auth_error_is_configuration": 0.0051,"tests/unit/pipelex/providers/mistral/test_mistral_llm_worker_object_error_handling.py::TestMistralLLMWorkerObjectErrorHandling::test_wrapped_bad_request_content_policy": 0.003,@@ -10010,6 +10050,7 @@"tests/unit/pipelex/providers/mistral/test_mistral_worker_error_handling.py::TestMistralWorkerErrorHandling::test_extract_worker_not_found_raises_extract_model_not_found_error": 0.0025,"tests/unit/pipelex/providers/mistral/test_mistral_worker_error_handling.py::TestMistralWorkerErrorHandling::test_llm_error_report_capacity_not_retryable": 0.0029,"tests/unit/pipelex/providers/mistral/test_mistral_worker_error_handling.py::TestMistralWorkerErrorHandling::test_llm_error_report_transient_is_retryable": 0.0025,+ "tests/unit/pipelex/providers/mistral/test_mistral_worker_error_handling.py::TestMistralWorkerErrorHandling::test_llm_worker_choice_without_message_is_transient": 0.101,"tests/unit/pipelex/providers/mistral/test_mistral_worker_error_handling.py::TestMistralWorkerErrorHandling::test_llm_worker_error_classification[auth_error_401-401-Invalid API key provided-configuration-None]": 0.003,"tests/unit/pipelex/providers/mistral/test_mistral_worker_error_handling.py::TestMistralWorkerErrorHandling::test_llm_worker_error_classification[bad_request_content_policy_400-400-Your request was rejected due to content_policy_violation-content-safety filters]": 0.0037,"tests/unit/pipelex/providers/mistral/test_mistral_worker_error_handling.py::TestMistralWorkerErrorHandling::test_llm_worker_error_classification[bad_request_generic_400-400-Invalid parameter: temperature must be between 0 and 1-content-None]": 0.0025,@@ -10064,7 +10105,8 @@"tests/unit/pipelex/providers/openai/test_openai_completions_worker_object_error_handling.py::TestOpenAICompletionsWorkerObjectErrorHandling::test_raw_sdk_transport_error_is_classified[sdk_exc0-transient]": 0.0034,"tests/unit/pipelex/providers/openai/test_openai_completions_worker_object_error_handling.py::TestOpenAICompletionsWorkerObjectErrorHandling::test_raw_sdk_transport_error_is_classified[sdk_exc1-transient]": 0.0037,"tests/unit/pipelex/providers/openai/test_openai_completions_worker_object_error_handling.py::TestOpenAICompletionsWorkerObjectErrorHandling::test_raw_sdk_transport_error_is_classified[sdk_exc2-transient]": 0.1098,- "tests/unit/pipelex/providers/openai/test_openai_completions_worker_object_error_handling.py::TestOpenAICompletionsWorkerObjectErrorHandling::test_real_instructor_propagates_transport_error_raw": 0.5977,+ "tests/unit/pipelex/providers/openai/test_openai_completions_worker_object_error_handling.py::TestOpenAICompletionsWorkerObjectErrorHandling::test_real_instructor_transport_error_after_a_reask_is_unwrapped": 0.4593,+ "tests/unit/pipelex/providers/openai/test_openai_completions_worker_object_error_handling.py::TestOpenAICompletionsWorkerObjectErrorHandling::test_real_instructor_transport_error_is_unwrapped": 0.4148,"tests/unit/pipelex/providers/openai/test_openai_completions_worker_object_error_handling.py::TestOpenAICompletionsWorkerObjectErrorHandling::test_unrecognized_underlying_falls_back_to_unknown": 0.0025,"tests/unit/pipelex/providers/openai/test_openai_completions_worker_object_error_handling.py::TestOpenAICompletionsWorkerObjectErrorHandling::test_wrapped_auth_error_is_configuration": 0.0036,"tests/unit/pipelex/providers/openai/test_openai_completions_worker_object_error_handling.py::TestOpenAICompletionsWorkerObjectErrorHandling::test_wrapped_bad_request_content_policy": 0.0051,@@ -10105,7 +10147,7 @@"tests/unit/pipelex/providers/openai/test_openai_responses_worker_object_error_handling.py::TestOpenAIResponsesWorkerObjectErrorHandling::test_raw_sdk_transport_error_is_classified[sdk_exc0-transient]": 0.0029,"tests/unit/pipelex/providers/openai/test_openai_responses_worker_object_error_handling.py::TestOpenAIResponsesWorkerObjectErrorHandling::test_raw_sdk_transport_error_is_classified[sdk_exc1-transient]": 0.0027,"tests/unit/pipelex/providers/openai/test_openai_responses_worker_object_error_handling.py::TestOpenAIResponsesWorkerObjectErrorHandling::test_raw_sdk_transport_error_is_classified[sdk_exc2-transient]": 0.1272,- "tests/unit/pipelex/providers/openai/test_openai_responses_worker_object_error_handling.py::TestOpenAIResponsesWorkerObjectErrorHandling::test_real_instructor_propagates_transport_error_raw": 0.055,+ "tests/unit/pipelex/providers/openai/test_openai_responses_worker_object_error_handling.py::TestOpenAIResponsesWorkerObjectErrorHandling::test_real_instructor_transport_error_is_unwrapped": 0.2004,"tests/unit/pipelex/providers/openai/test_openai_responses_worker_object_error_handling.py::TestOpenAIResponsesWorkerObjectErrorHandling::test_unrecognized_underlying_falls_back_to_unknown": 0.0033,"tests/unit/pipelex/providers/openai/test_openai_responses_worker_object_error_handling.py::TestOpenAIResponsesWorkerObjectErrorHandling::test_wrapped_auth_error_is_configuration": 0.004,"tests/unit/pipelex/providers/openai/test_openai_responses_worker_object_error_handling.py::TestOpenAIResponsesWorkerObjectErrorHandling::test_wrapped_bad_request_content_policy": 0.0049,@@ -11799,7 +11841,6 @@"tests/unit/pipelex/tools/storage/test_s3_storage_provider.py::TestS3StorageProvider::test_load_with_nonexistent_key_raises_error": 0.0111,"tests/unit/pipelex/tools/storage/test_s3_storage_provider.py::TestS3StorageProvider::test_public_url_falls_back_to_public_url_on_botocore_error": 0.0046,"tests/unit/pipelex/tools/storage/test_s3_storage_provider.py::TestS3StorageProvider::test_public_url_falls_back_to_public_url_on_client_error": 0.006,- "tests/unit/pipelex/tools/storage/test_s3_storage_provider.py::TestS3StorageProvider::test_public_url_handles_sync_presigned_url": 0.0049,"tests/unit/pipelex/tools/storage/test_s3_storage_provider.py::TestS3StorageProvider::test_public_url_returns_presigned_url_when_signed_urls_enabled": 0.0041,"tests/unit/pipelex/tools/storage/test_s3_storage_provider.py::TestS3StorageProvider::test_public_url_returns_public_url_when_signed_urls_disabled": 0.006,"tests/unit/pipelex/tools/storage/test_s3_storage_provider.py::TestS3StorageProvider::test_session_is_reused": 0.1828,@@ -12623,11 +12664,9 @@"tests/unit/pipelex/tools/test_log_json_sink.py::TestJsonLogSink::test_redirect_to_stderr_moves_the_stream": 0.0028,"tests/unit/pipelex/tools/test_log_json_sink.py::TestJsonLogSink::test_the_exception_is_a_field_and_not_part_of_the_message": 0.0304,"tests/unit/pipelex/tools/test_log_json_sink.py::TestJsonLogSink::test_the_sinks_own_keys_are_reserved_with_or_without_an_exception": 0.0878,- "tests/unit/pipelex/tools/test_log_json_trace_context.py::TestJsonSinkTraceContext::test_a_boot_line_held_until_the_sink_arrives_keeps_the_span_it_was_logged_in": 0.0091,"tests/unit/pipelex/tools/test_log_json_trace_context.py::TestJsonSinkTraceContext::test_a_boot_line_held_until_the_sink_arrives_keeps_the_spans_it_was_logged_in": 0.2675,"tests/unit/pipelex/tools/test_log_json_trace_context.py::TestJsonSinkTraceContext::test_a_line_in_a_run_under_a_host_span_names_the_host_span_and_the_pipelex_one_beside_it": 0.0985,"tests/unit/pipelex/tools/test_log_json_trace_context.py::TestJsonSinkTraceContext::test_a_line_in_a_run_with_no_host_span_carries_only_the_pipelex_keys": 0.0774,- "tests/unit/pipelex/tools/test_log_json_trace_context.py::TestJsonSinkTraceContext::test_a_line_logged_in_a_pipelex_span_carries_it_rather_than_the_hosts": 0.0026,"tests/unit/pipelex/tools/test_log_json_trace_context.py::TestJsonSinkTraceContext::test_a_line_logged_inside_a_span_carries_its_trace_context_in_hex": 0.0704,"tests/unit/pipelex/tools/test_log_json_trace_context.py::TestJsonSinkTraceContext::test_a_line_logged_outside_any_span_carries_none_of_the_keys": 0.0029,"tests/unit/pipelex/tools/test_log_json_trace_context.py::TestJsonSinkTraceContext::test_a_line_outside_a_run_under_a_host_span_carries_only_the_standard_keys": 0.0033,@@ -12635,7 +12674,6 @@"tests/unit/pipelex/tools/test_log_json_trace_context.py::TestJsonSinkTraceContext::test_the_ids_are_zero_padded_and_the_flags_written_as_they_are": 0.003,"tests/unit/pipelex/tools/test_log_json_trace_context.py::TestJsonSinkTraceContext::test_the_line_leaving_the_span_no_longer_carries_it": 0.0117,"tests/unit/pipelex/tools/test_log_json_trace_context.py::TestJsonSinkTraceContext::test_the_trace_keys_are_reserved_with_or_without_a_span": 0.2124,- "tests/unit/pipelex/tools/test_log_json_trace_context.py::TestJsonSinkTraceContext::test_the_trace_keys_follow_the_fixed_keys_and_precede_the_fields": 0.002,"tests/unit/pipelex/tools/test_log_json_trace_context.py::TestJsonSinkTraceContext::test_the_trace_keys_follow_the_fixed_keys_the_pipelex_ones_follow_them_and_the_fields_come_last": 0.0048,"tests/unit/pipelex/tools/test_log_levels.py::TestLogLevels::test_from_int_converts_to_enum[10-DEBUG]": 0.0008,"tests/unit/pipelex/tools/test_log_levels.py::TestLogLevels::test_from_int_converts_to_enum[15-DEV]": 0.0007,@@ -12670,12 +12708,9 @@"tests/unit/pipelex/tools/test_log_otlp_sink.py::TestOtlpLogSink::test_the_sdks_own_record_is_rejected_before_the_handler_lock_is_taken": 0.0038,"tests/unit/pipelex/tools/test_log_otlp_sink.py::TestOtlpLogSink::test_the_semantic_convention_keys_are_reserved_with_or_without_an_exception": 0.0131,"tests/unit/pipelex/tools/test_log_otlp_sink.py::TestOtlpLogSink::test_the_stacktrace_is_the_scrubbed_text_and_no_message_attribute_carries_the_secret": 0.0179,- "tests/unit/pipelex/tools/test_log_otlp_trace_context.py::TestOtlpSinkTraceContext::test_a_boot_line_held_until_the_sink_arrives_keeps_the_span_it_was_logged_in": 0.0071,"tests/unit/pipelex/tools/test_log_otlp_trace_context.py::TestOtlpSinkTraceContext::test_a_boot_line_held_until_the_sink_arrives_keeps_the_spans_it_was_logged_in": 0.0051,"tests/unit/pipelex/tools/test_log_otlp_trace_context.py::TestOtlpSinkTraceContext::test_a_record_in_a_run_under_a_host_span_is_filed_under_the_host_span_and_names_the_pipelex_one": 0.004,"tests/unit/pipelex/tools/test_log_otlp_trace_context.py::TestOtlpSinkTraceContext::test_a_record_in_a_run_with_no_host_span_is_filed_under_none_and_names_the_pipelex_span": 0.0047,- "tests/unit/pipelex/tools/test_log_otlp_trace_context.py::TestOtlpSinkTraceContext::test_a_record_logged_in_a_pipelex_span_is_filed_under_it_rather_than_the_hosts": 0.0065,- "tests/unit/pipelex/tools/test_log_otlp_trace_context.py::TestOtlpSinkTraceContext::test_a_record_logged_inside_a_span_is_filed_under_it": 0.0717,"tests/unit/pipelex/tools/test_log_otlp_trace_context.py::TestOtlpSinkTraceContext::test_a_record_outside_a_run_under_a_host_span_is_filed_under_it_with_no_pipelex_attributes": 0.0997,"tests/unit/pipelex/tools/test_log_otlp_trace_context.py::TestOtlpSinkTraceContext::test_a_record_outside_any_span_carries_neither": 0.0903,"tests/unit/pipelex/tools/test_log_otlp_trace_context.py::TestOtlpSinkTraceContext::test_the_pipelex_keys_are_reserved_with_or_without_a_pipelex_span": 0.0114,diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 4c3474c73..8ffeca761 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -12,6 +12,9 @@- **NaN and the infinities are refused at `Number`, `JSON` and `Anything` inputs (Breaking)**: a TOML inputs file can spell `nan` and `inf`, which JSON cannot hold, so a `Number` or `Anything` input given one raises `WrongScalarKindError`, and an object holding one anywhere inside it raises `StructureValidationError`, where each used to store a number that JSON serialization turns into `null`. A `JSONContent` or a `NumberContent` holding one raises a pydantic `ValidationError`, which is also what an explicit envelope building one reports.- **Chaining an `Anything` value through `--with-memory` changes it (Breaking)**: an `Anything` stuff's content is dumped as its content class's fields, so a bare `"hi"` sent to an `Anything` input is dumped as `{"text": "hi"}`, and a method reading that memory at an `Anything` input receives that object rather than the string; a list is dumped as one object holding its `items`. It used to travel as `native.Text`, since a bare string at an `Anything` input became a `native.Text` stuff.- **The `Anything` input schema excludes array and null**: the JSON Schema published for an `Anything` input carries `"not": {"type": ["array", "null"]}`, and so does each item of an `Anything[]` input's schema.+- **`aiobotocore` replaces `aioboto3`, and the `bedrock_aioboto3` SDK handle is renamed `bedrock_aioboto` (Breaking)**: the `bedrock` and `s3` extras depend on `aiobotocore` 3.x instead of `aioboto3`, whose latest release pins `boto3` below 1.40.62, so both extras now take `boto3>=1.42.42`. The new handle names the async Bedrock client rather than the library under it, so a later change of library will not rename it again. **Migration:** a backend file that still sets `sdk = "bedrock_aioboto3"` keeps loading but fails on every call to its models, with an error that points at `pipelex migrate`, which names each such file under `inference-backend@3` without rewriting it, so replace the handle with `bedrock_aioboto` by hand.+- **`instructor` 1.17, and the `mistralai` extra on `mistralai` 2.x (Breaking)**: pipelex now requires `instructor>=1.17.0,<2.0.0`, and the `mistralai` extra takes `mistralai>=2.10.0`, whose client lives under `mistralai.client`, so a project that imports `mistralai` 1.x beside pipelex must move to 2.x with it. `instructor` 1.17 dropped its strict tool mode, so the `instructor/openai_structured_outputs` structure method now sends the same non-strict tool schema as `instructor/openai_tools`, and OpenAI no longer enforces the schema on its side: pipelex still validates the response and re-asks on a mismatch.+- **`opentelemetry-api` and `opentelemetry-sdk` 1.39 or later**: pipelex now requires both at `>=1.39.0` instead of `>=1.38.0`.### Fixed@@ -22,6 +25,17 @@- **The result files of an `Anything` output render its value**: a delivery whose main output is `Anything` renders `main_stuff.json`, `.md` and `.html` from the hydrated content, where it fell back to a raw dump of the transport form.- **A prebuilt list is refused where one value belongs**: a `ListContent` given as an item of a plural input, or as the content of an `Anything` envelope at a single input, is refused instead of being stored nested or in a singular slot.- **`bedrock_anthropic` models run with `AWS_BEARER_TOKEN_BEDROCK` set**: under `bedrock_access_variant = "aws_access"`, the default, Anthropic models on Bedrock sign their requests with the configured AWS access keys and ignore a Bedrock bearer token in the environment, where every one of them used to fail at client construction with a raw `ValueError`. When the access keys are missing and the environment carries such a token, the `AwsCredentialsError` now says so and names `bedrock_access_variant = "bedrock_token"` as the way to authenticate with a bearer token.+- **Structured output on the `google` backend accepts enum fields**: under `instructor/genai_tools`, `instructor` validated Gemini's function-call arguments strictly and refused a string for any enum field, so every schema with an enum failed on every attempt; those arguments are now validated in lax mode, so a `google.toml` an earlier `pipelex init` copied keeps working unchanged. The backend file we ship now sets `structure_method = "instructor/genai_structured_outputs"`, Gemini's native JSON output.+- **Structured output on the `google` backend sends the system prompt, temperature and token limit**: `instructor` ignored the Google config pipelex handed it, so every structured call ran with no system prompt, the default temperature and the model's default output token limit, whichever structure method the backend used; they now reach Gemini.+- **A transport error inside a structured-output call is classified again under `instructor` 1.16 and later**: those releases wrap a provider's rate limit, timeout or refused connection in their own retry exception, which pipelex classified as an unknown error, or after a re-ask as the earlier parse failure; the provider's error is now read first, so it keeps its category, its retryability and its provider metadata.+- **A structured-output call is re-asked when the model returns no tool call or no JSON**: under `instructor` 1.16 and later such a response raises a parse error that pipelex's re-ask loop did not retry, so it failed at once; the loop now retries exactly the parse errors `instructor` itself re-asks.+- **A model whose `structure_method` names a provider-specific `instructor` mode sets up again**: `instructor` 1.17 refuses another provider's mode on an OpenAI-compatible client, which failed the setup of such a model, the gateway's `mistral-large` among them; each structure method now builds with the core mode `instructor` itself resolves it to.+- **Mistral OCR on an image returns the figures it finds**: an extract from an image, rather than a document, failed with `MistralExtractResponseError` whenever Mistral OCR detected a figure inside it, because the request never asked for the figures' pixels; it now sends the same image options as a document extract, so `max_nb_images` and `image_min_size` apply to images too, and a request for captions, which Mistral OCR cannot write, is refused on an image as it already was on a document instead of returning none.+- **A no-op tracer no longer stamps a fake Pipelex span on log lines**: from `opentelemetry-api` 1.40, the no-op tracer `OTEL_SDK_DISABLED` hands out returns its parent instead of an invalid span, so every line of a run carried `pipelex.trace_id` and a `pipelex.span_id` of `0000000000000001` naming no span; a pipe or an LLM call now starts no span under such a tracer, as with no tracer at all.++### Removed++- **`pipelex.providers.openai.openai_func` (Breaking)**: the module and its `create_pydantic_model_from_function`, `create_openai_schema_from_function` and `list_openai_tools` helpers are removed; nothing in pipelex called them.## [v0.68.0] - 2026-09-27diff --git a/docs/configuration/config-technical/inference-backend-config.md b/docs/configuration/config-technical/inference-backend-config.mdindex 4f152ae4b..ede243735 100644--- a/docs/configuration/config-technical/inference-backend-config.md+++ b/docs/configuration/config-technical/inference-backend-config.md@@ -185,7 +185,7 @@ If you need to customize how a specific model behaves through the Gateway, you c- `sdk`: The SDK to use for the model (e.g., `gateway_completions`)- `structure_method`: The method for structured output (e.g., `instructor/openai_tools`)-All other keys will be ignored.+All other keys will be ignored. What each structure method sends is described under [Structure methods](#structure-methods).```toml# .pipelex/inference/backends/pipelex_gateway.toml@@ -297,7 +297,10 @@ Each backend has its own model specification file in `.pipelex/inference/backend```toml# openai.toml-default_sdk = "openai"+[defaults]+model_type = "llm"+sdk = "openai_responses"+structure_method = "instructor/openai_responses_tools"[gpt-4o-mini]model_id = "gpt-4o-mini"@@ -313,11 +316,23 @@ costs = { input = 2.5, output = 15.0 }[gpt-image-1]model_id = "gpt-image-1"+sdk = "openai_img_gen"+model_type = "img_gen"inputs = ["text"]outputs = ["image"]costs = { input = 0.04, output = 0.0 }```+The `[defaults]` table applies to every model of the file, and a model table overrides any key of it.++#### Structure methods++`structure_method` says how a model is asked for structured output. A structure method names a provider, but the SDK decides how the request is sent. Each method stands for one of `instructor`'s core modes: every `*_tools` method is tool calling, and so is `instructor/openai_structured_outputs`, which sends OpenAI a non-strict tool schema; `instructor/mistral_structured_outputs` or `instructor/openrouter_structured_outputs` is a JSON-schema response format. So a method named after another provider still works through the Gateway's OpenAI-compatible SDKs.++One method keeps a behaviour of its own on the `anthropic` and `bedrock_anthropic` SDKs: tool calling forces the model to call the response tool, and `instructor/anthropic_reasoning_tools` leaves that choice to the model instead, steering it to the tool with a system line, for a model that refuses a forced tool choice.++The `google` backend uses `instructor/genai_structured_outputs`, Gemini's native JSON output. `instructor/genai_tools` works on it too: Gemini returns the function-call arguments as plain values, so pipelex validates them in pydantic's lax mode, where a string reaches an enum field as its member.+#### Sending extra request headers per modelA model table may carry keys beyond the model-spec fields. A key shaped like a request header — it contains a hyphen and its value is a string — is sent to the provider **as an HTTP request header** on each call to that model; this is how, for example, the Portkey backend routes each model to its upstream provider:diff --git a/docs/tools/logging.md b/docs/tools/logging.mdindex 281a53ba1..7501cd22c 100644--- a/docs/tools/logging.md+++ b/docs/tools/logging.md@@ -137,7 +137,7 @@ The runtime holds each span it starts as the active Pipelex span from its start- **A pipe run's span**: `live_run_pipe` starts the span, then runs the pipe with it held, so a line logged by the pipe's own work, a controller's or an operator's and the lines of the extract, image-generation, search or function call an operator makes, names the pipe's span under `pipelex.*`, and a nested pipe's lines name the nested pipe's span until it returns. The line announcing the run is logged before the span starts, under the enclosing span.- **An LLM call's span**: the LLM worker runs the provider call with its generation span held, so the lines of the call and of its failure name that span under `pipelex.*`, a provider SDK's own lines included.-The runtime starts these spans only when it traces a live run, which it does once telemetry has created its tracer: with the Pipelex Gateway's telemetry on, which is automatic when the Gateway serves your inference, or with AI span tracing enabled on your own PostHog, as [Telemetry](../setup/telemetry.md#pipelexs-spans-in-your-process) describes. Otherwise it holds no span, as it does when its tracer is a no-op one that starts spans naming no trace, under `OTEL_SDK_DISABLED` for instance, and a line carries no `pipelex.*` fields. A boot line held until the sink arrives is replayed in the context it was logged in, so it keeps both its spans, and a thread started with `asyncio.to_thread` or `contextvars.copy_context` inherits both from the code that started it.+The runtime starts these spans only when it traces a live run, which it does once telemetry has created its tracer: with the Pipelex Gateway's telemetry on, which is automatic when the Gateway serves your inference, or with AI span tracing enabled on your own PostHog, as [Telemetry](../setup/telemetry.md#pipelexs-spans-in-your-process) describes. Otherwise it holds no span, as it does when its tracer is a no-op one, under `OTEL_SDK_DISABLED` for instance, which starts no span of its own, and a line carries no `pipelex.*` fields. A boot line held until the sink arrives is replayed in the context it was logged in, so it keeps both its spans, and a thread started with `asyncio.to_thread` or `contextvars.copy_context` inherits both from the code that started it.Holding a span is in-process plumbing, like binding the log context: it lives in a context variable of Pipelex's own. **Pipelex never makes its spans current in your process's OpenTelemetry context**, so your own instrumentation, an HTTP client's or a provider SDK's, is never re-parented under a Pipelex span, and an error tracker that reads OpenTelemetry's current span sees yours, not Pipelex's. A span's children take their parent from the job metadata, so a step running in another process gets the parent it always did, and a line that process logs carries `pipelex.*` fields only while the process runs a span of its own, the LLM call's for instance.diff --git a/docs/under-the-hood/error-model.md b/docs/under-the-hood/error-model.mdindex aa13a9e0f..8f4b12fcc 100644--- a/docs/under-the-hood/error-model.md+++ b/docs/under-the-hood/error-model.md@@ -387,7 +387,7 @@ The gateway's remaining codes belong to no family and classify on their status l### The `instructor` Unwrap-On structured-generation paths, `instructor` wraps the real SDK exception in an `InstructorRetryException`. `extract_underlying_sdk_exception()` recovers it, so it routes through the same per-provider categorization as the plain-text path. A genuinely unrecognized inner exception (e.g. a `pydantic.ValidationError` from a schema mismatch) lands in `UNKNOWN` rather than being mis-labelled as a `CONTENT`-policy violation.+On structured-generation paths, `instructor` raises an `InstructorRetryException` from the exception that ended its retry loop. The loop re-asks only a response that fails the schema, so that exception is either the raw SDK exception of a call that failed in transport, or, once the re-ask budget is spent, the last parse failure. `extract_underlying_sdk_exception()` recovers it from the wrapper's cause, not from `failed_attempts`, which lists only parse failures and would name an earlier one when a re-ask then fails in transport. The recovered exception routes through the same per-provider categorization as the plain-text path. A genuinely unrecognized inner exception (e.g. a `pydantic.ValidationError` from a schema mismatch) lands in `UNKNOWN` rather than being mis-labelled as a `CONTENT`-policy violation.### Model and Provider Attributiondiff --git a/docs/under-the-hood/reasoning-controls.md b/docs/under-the-hood/reasoning-controls.mdindex 37f062dc7..2248a2ba3 100644--- a/docs/under-the-hood/reasoning-controls.md+++ b/docs/under-the-hood/reasoning-controls.md@@ -158,7 +158,7 @@ flowchart TBC -->|Anthropic| E["_build_thinking_params()<br>-> _ThinkingParams"]C -->|Google| F["_build_thinking_config()<br>-> ThinkingConfig"]C -->|Mistral| G["_resolve_prompt_mode()<br>-> prompt_mode"]- C -->|Bedrock (aioboto3)| H["_validate_no_reasoning_params()<br>-> LLMCapabilityError if set"]+ C -->|Bedrock (aiobotocore)| H["_validate_no_reasoning_params()<br>-> LLMCapabilityError if set"]```---@@ -308,9 +308,9 @@ Mistral does not support `reasoning_budget` or `thinking_mode = "adaptive"`. BotTemperature is passed normally to the Mistral API regardless of reasoning mode.-### Bedrock (aioboto3 native models)+### Bedrock (aiobotocore native models)-Bedrock native models using the `bedrock_aioboto3` SDK do not support reasoning parameters. Any `reasoning_effort` or `reasoning_budget` raises `LLMCapabilityError`.+Bedrock native models using the `bedrock_aioboto` SDK do not support reasoning parameters. Any `reasoning_effort` or `reasoning_budget` raises `LLMCapabilityError`.!!! noteClaude models accessed through Bedrock use the `bedrock_anthropic` SDK variant and go through the Anthropic worker, which does support reasoning.@@ -423,7 +423,7 @@ All reasoning-related errors use `LLMCapabilityError` (`pipelex/cogt/exceptions.| `reasoning_effort` on a `thinking_mode = "none"` model | "does not support reasoning" || `reasoning_budget` on a provider that doesn't support it | "does not support reasoning_budget" || `thinking_mode = "adaptive"` on OpenAI or Mistral | "adaptive ... not supported" |-| Any reasoning param on Bedrock (aioboto3) models | "does not support reasoning parameters" |+| Any reasoning param on Bedrock (aiobotocore) models | "does not support reasoning parameters" || Reasoning params during structured generation | "does not support reasoning parameters for structured generation" || Both `reasoning_effort` and `reasoning_budget` set | `ValueError` / `LLMSettingValueError` (mutual exclusivity) |diff --git a/docs/under-the-hood/storage-provider-plugins.md b/docs/under-the-hood/storage-provider-plugins.mdindex ca597fcf4..c740f5885 100644--- a/docs/under-the-hood/storage-provider-plugins.md+++ b/docs/under-the-hood/storage-provider-plugins.md@@ -73,7 +73,7 @@ registrar.add_storage_provider(method="azure", factory=_make_azure_storage_proviThe factory is a plain callable stored at registration and **invoked only at the boot apply-point**. Two invariants follow, and they are what let an SDK-backed provider ship without weighing down every boot:-- **Import-light.** The plugin module must import no backend SDK at module load. Registering the built-in `s3`/`gcp` factories pulls in neither `aioboto3` nor `google-cloud-storage` — the SDK guard lives *inside* the provider's I/O methods (`_get_session` / `_get_bucket`), not its `__init__`. Selecting `s3` therefore *constructs* an `S3StorageProvider` even with the extra absent; the guard fires only on the first actual load/store.+- **Import-light.** The plugin module must import no backend SDK at module load. Registering the built-in `s3`/`gcp` factories pulls in neither `aiobotocore` nor `google-cloud-storage` — the SDK guard lives *inside* the provider's I/O methods (`_get_session` / `_get_bucket`), not its `__init__`. Selecting `s3` therefore *constructs* an `S3StorageProvider` even with the extra absent; the guard fires only on the first actual load/store.- **Fail at use, not at boot.** An optional dependency raises `MissingDependencyError` (naming the package and the `pipelex[<extra>]` install hint) when the backend is *used*, not when it is registered or selected.---diff --git a/docs/under-the-hood/writing-an-inference-plugin.md b/docs/under-the-hood/writing-an-inference-plugin.mdindex 562a927cb..aba5fa3a5 100644--- a/docs/under-the-hood/writing-an-inference-plugin.md+++ b/docs/under-the-hood/writing-an-inference-plugin.md@@ -322,7 +322,7 @@ disabled = ["hello_inference"]`pipelex plugins list` now shows the plugin as `disabled`, and running the method again fails loudly when the pipe asks for its worker:```-No inference backend registered for sdk 'hello' in the llm family. Is its plugin installed and enabled?+No inference backend registered for sdk 'hello' in the llm family. Is its plugin installed and enabled? If it is, 'hello' may be a handle a release renamed: `pipelex migrate` reports each backend file that still sets a retired handle.```The model configuration still resolves, since `hello-1` is still declared and routed. Only the worker factory is missing, and Pipelex says so rather than falling back to another backend. A dry run of the method still passes without the plugin, because a dry run never builds a worker.diff --git a/pipelex/cogt/inference/error_classification.py b/pipelex/cogt/inference/error_classification.pyindex b88be7721..38f146372 100644--- a/pipelex/cogt/inference/error_classification.py+++ b/pipelex/cogt/inference/error_classification.py@@ -644,13 +644,15 @@ def _stringify_for_scan(body: Any) -> str:def extract_underlying_sdk_exception(instructor_exc: Any) -> BaseException | None:- """Recover the SDK exception that caused an ``InstructorRetryException``.+ """Recover the exception that ended instructor's retry loop, from an ``InstructorRetryException``.- instructor's retry loop wraps the last failed attempt's exception inside- ``InstructorRetryException``. We prefer ``failed_attempts[-1].exception``- (the documented public attribute) and fall back to walking ``__cause__``- (a tenacity ``RetryError`` whose ``last_attempt._exception`` holds the- original exception) when ``failed_attempts`` is unset.+ instructor raises ``InstructorRetryException`` ``from`` the last exception its loop saw. With the+ schema-only retrying pipelex passes, that is either the raw SDK exception of a call that failed in+ transport, which is never re-asked, or tenacity's ``RetryError`` once the re-ask budget is spent,+ whose last attempt holds the final parse failure. So ``__cause__`` is read first.+ ``failed_attempts`` records only the attempts whose response failed to parse: after a re-ask, a+ transport failure that follows is not in it, and its last entry would name the wrong exception.+ It remains the fallback for a wrapper that carries no cause.Args:instructor_exc: The ``InstructorRetryException`` to unwrap. Typed as@@ -658,25 +660,27 @@ def extract_underlying_sdk_exception(instructor_exc: Any) -> BaseException | Nonjust for the call site, and so malformed inputs are tolerated.Returns:- The underlying SDK exception when one can be recovered, ``None`` when+ The underlying exception when one can be recovered, ``None`` whenneither path yields a ``BaseException``."""+ cause: Any = getattr(instructor_exc, "__cause__", None)+ retry_last_attempt: Any = getattr(cause, "last_attempt", None)+ if retry_last_attempt is not None:+ underlying = getattr(retry_last_attempt, "_exception", None)+ if isinstance(underlying, BaseException):+ return underlying+ elif isinstance(cause, BaseException):+ return causefailed_attempts: Any = getattr(instructor_exc, "failed_attempts", None)if failed_attempts:try:- last_attempt = failed_attempts[-1]+ last_failed_attempt = failed_attempts[-1]except (TypeError, KeyError, IndexError):- last_attempt = None- if last_attempt is not None:- last_exc = getattr(last_attempt, "exception", None)+ last_failed_attempt = None+ if last_failed_attempt is not None:+ last_exc = getattr(last_failed_attempt, "exception", None)if isinstance(last_exc, BaseException):return last_exc- cause: Any = getattr(instructor_exc, "__cause__", None)- last_attempt = getattr(cause, "last_attempt", None)- if last_attempt is not None:- underlying = getattr(last_attempt, "_exception", None)- if isinstance(underlying, BaseException):- return underlyingreturn Nonediff --git a/pipelex/cogt/llm/instructor_retry.py b/pipelex/cogt/llm/instructor_retry.pyindex 6d7381b2c..583d93a95 100644--- a/pipelex/cogt/llm/instructor_retry.py+++ b/pipelex/cogt/llm/instructor_retry.py@@ -7,14 +7,15 @@ from tenacity import AsyncRetrying, retry_if_exception_type, stop_after_attemptdef make_instructor_schema_retrying(*, max_attempts: int) -> AsyncRetrying:"""Build a ``tenacity.AsyncRetrying`` that confines ``instructor``'s retry to schema re-ask.- Passed a bare ``int``, ``instructor``'s ``max_retries`` builds a retry loop whose default- predicate retries *any* exception — transport / API errors included — so it re-runs the whole- completion on transient failures, a second retry loop nested on top of the SDK client's own- transport retry (Tier 1). ``instructor.core.retry.initialize_retrying`` accepts a pre-built- ``AsyncRetrying`` and uses it as-is, so passing this object instead scopes the retry to genuine- schema re-ask: a malformed / invalid LLM output is re-asked, while a transport error is *not*- retried by ``instructor`` and propagates immediately as the raw SDK exception for the worker's- own ``except`` clause to classify.+ ``instructor`` accepts a pre-built ``AsyncRetrying`` as ``max_retries`` and drives its loop with+ it as-is. This one re-asks only a malformed / invalid LLM output and never retries a transport+ or API error, whose retry belongs to the SDK client alone (Tier 1): such an error ends the loop+ at once, ``instructor`` raises an ``InstructorRetryException`` from it, and the worker unwraps+ it with ``extract_underlying_sdk_exception`` to classify the SDK exception.++ A bare ``int`` would leave that scope to ``instructor``'s own default predicate. Building the+ loop here keeps it a decision of this codebase, pinned by a unit test that compares the retried+ set with ``instructor``'s, rather than one an upgrade can widen silently.Args:max_attempts: Total number of attempts for the schema re-ask loop — the caller passes@@ -23,13 +24,13 @@ def make_instructor_schema_retrying(*, max_attempts: int) -> AsyncRetrying:Returns:A fresh ``AsyncRetrying`` whose retry predicate matches only validation failures."""- # `instructor` raises its own validation-error types alongside pydantic's; mirror the exact- # set `instructor` itself treats as re-askable (see `instructor.core.retry.retry_async`) so a- # genuine schema failure is still re-asked regardless of which of the two it surfaces as.- from instructor.core import AsyncValidationError # ruff: ignore[import-outside-top-level]- from instructor.core import ValidationError as InstructorValidationError # ruff: ignore[import-outside-top-level]+ # Mirror the exact set `instructor` itself re-asks (`_RETRYABLE_PARSE_ERRORS` in+ # `instructor.v2.core.retry`), so a genuine schema failure is re-asked whichever type it surfaces as:+ # pydantic's, a JSON decode error, or `ResponseParsingError` for a response with no tool call or no JSON.+ # A unit test compares this tuple with instructor's, so an upgrade that changes the set fails it.+ from instructor.core import AsyncValidationError, ResponseParsingError # ruff: ignore[import-outside-top-level]return AsyncRetrying(- retry=retry_if_exception_type((ValidationError, json.JSONDecodeError, AsyncValidationError, InstructorValidationError)),+ retry=retry_if_exception_type((ValidationError, json.JSONDecodeError, AsyncValidationError, ResponseParsingError)),stop=stop_after_attempt(max_attempts),)diff --git a/pipelex/cogt/llm/llm_worker_abstract.py b/pipelex/cogt/llm/llm_worker_abstract.pyindex c5d1daecc..6a6477297 100644--- a/pipelex/cogt/llm/llm_worker_abstract.py+++ b/pipelex/cogt/llm/llm_worker_abstract.py@@ -20,6 +20,7 @@ from pipelex.system.telemetry.current_span import pipelex_span_activefrom pipelex.system.telemetry.otel_constants import (GenAISpanAttr,LangfuseSpanAttr,+ OTelAttributeValue,PipelexSpanAttr,SpanCategory,make_otel_gen_ai_output_type,@@ -31,7 +32,6 @@ from pipelex.tools.misc.filetype_utils import UNKNOWN_FILE_TYPEfrom pipelex.tools.misc.package_utils import get_package_versionif TYPE_CHECKING:- from opentelemetry.util.types import AttributeValuefrom pydantic import BaseModelfrom pipelex.cogt.llm.llm_job import LLMJob@@ -141,7 +141,7 @@ class LLMWorkerAbstract(InferenceWorkerAbstract, ABC):# Build all span attributes with FULL (non-redacted) values# PostHog exporters will apply redaction based on their TelemetryRedactionConfig- span_attributes: dict[str, AttributeValue] = {+ span_attributes: dict[str, OTelAttributeValue] = {# GenAI standard attributesGenAISpanAttr.OPERATION_NAME: unit_job_id,GenAISpanAttr.OUTPUT_TYPE: make_otel_gen_ai_output_type(output_type=output_type).value,@@ -227,6 +227,10 @@ class LLMWorkerAbstract(InferenceWorkerAbstract, ABC):context=parent_ctx,attributes=span_attributes,)+ # A tracer that records nothing, the no-op tracer `OTEL_SDK_DISABLED` hands out for one, gives back the+ # parent it was handed rather than a span of its own; that is no span, exactly as with no tracer.+ if span.get_span_context() == parent_span_context:+ return None# Debug logging, under the span it announces, so the line's `pipelex.*` fields name that spanspan_ctx = span.get_span_context()diff --git a/pipelex/cogt/llm/structured_output.py b/pipelex/cogt/llm/structured_output.pyindex bb2cd1ede..6724735bf 100644--- a/pipelex/cogt/llm/structured_output.py+++ b/pipelex/cogt/llm/structured_output.py@@ -48,76 +48,52 @@ class StructureMethod(StrEnum):INSTRUCTOR_OPENROUTER_STRUCTURED_OUTPUTS = "instructor/openrouter_structured_outputs"def as_instructor_mode(self) -> "InstructorMode":+ """The core instructor mode this structure method stands for.++ instructor deprecates its provider-specific modes, because the provider now comes from the client,+ and resolves each one to a core mode, the same one whichever provider it is used with. That+ resolution is done here instead, because an OpenAI client refuses another provider's mode rather+ than resolving it, and a gateway serves every model through an OpenAI client, whichever provider's+ method its spec names.+ """from instructor import Mode as InstructorMode # ruff: ignore[import-outside-top-level]match self:- # generic- case StructureMethod.INSTRUCTOR_JSON:+ case (+ StructureMethod.INSTRUCTOR_OPENAI_TOOLS+ | StructureMethod.INSTRUCTOR_OPENAI_STRUCTURED_OUTPUTS+ | StructureMethod.INSTRUCTOR_ANTHROPIC_TOOLS+ | StructureMethod.INSTRUCTOR_ANTHROPIC_REASONING_TOOLS+ | StructureMethod.INSTRUCTOR_MISTRAL_TOOLS+ | StructureMethod.INSTRUCTOR_VERTEXAI_TOOLS+ | StructureMethod.INSTRUCTOR_GENAI_TOOLS+ | StructureMethod.INSTRUCTOR_COHERE_TOOLS+ | StructureMethod.INSTRUCTOR_CEREBRAS_TOOLS+ | StructureMethod.INSTRUCTOR_FIREWORKS_TOOLS+ | StructureMethod.INSTRUCTOR_BEDROCK_TOOLS+ | StructureMethod.INSTRUCTOR_WRITER_TOOLS+ ):+ return InstructorMode.TOOLS+ case StructureMethod.INSTRUCTOR_OPENAI_PARALLEL_TOOLS | StructureMethod.INSTRUCTOR_VERTEXAI_PARALLEL_TOOLS:+ return InstructorMode.PARALLEL_TOOLS+ case StructureMethod.INSTRUCTOR_JSON | StructureMethod.INSTRUCTOR_ANTHROPIC_JSON | StructureMethod.INSTRUCTOR_GENAI_STRUCTURED_OUTPUTS:return InstructorMode.JSON- case StructureMethod.INSTRUCTOR_MD_JSON:+ case (+ StructureMethod.INSTRUCTOR_MD_JSON+ | StructureMethod.INSTRUCTOR_VERTEXAI_JSON+ | StructureMethod.INSTRUCTOR_CEREBRAS_JSON+ | StructureMethod.INSTRUCTOR_FIREWORKS_JSON+ | StructureMethod.INSTRUCTOR_BEDROCK_JSON+ | StructureMethod.INSTRUCTOR_PERPLEXITY_JSON+ ):return InstructorMode.MD_JSON- case StructureMethod.INSTRUCTOR_JSON_SCHEMA:+ case (+ StructureMethod.INSTRUCTOR_JSON_SCHEMA+ | StructureMethod.INSTRUCTOR_OPENAI_JSON_O1+ | StructureMethod.INSTRUCTOR_MISTRAL_STRUCTURED_OUTPUTS+ | StructureMethod.INSTRUCTOR_COHERE_JSON_SCHEMA+ | StructureMethod.INSTRUCTOR_OPENROUTER_STRUCTURED_OUTPUTS+ ):return InstructorMode.JSON_SCHEMA- # openai- case StructureMethod.INSTRUCTOR_OPENAI_PARALLEL_TOOLS:- return InstructorMode.PARALLEL_TOOLS- case StructureMethod.INSTRUCTOR_OPENAI_TOOLS:- return InstructorMode.TOOLS- case StructureMethod.INSTRUCTOR_OPENAI_STRUCTURED_OUTPUTS:- return InstructorMode.TOOLS_STRICT- case StructureMethod.INSTRUCTOR_OPENAI_JSON_O1:- return InstructorMode.JSON_O1- case StructureMethod.INSTRUCTOR_OPENAI_RESPONSES_TOOLS:+ case StructureMethod.INSTRUCTOR_OPENAI_RESPONSES_TOOLS | StructureMethod.INSTRUCTOR_OPENAI_RESPONSES_TOOLS_WITH_INBUILT_TOOLS:return InstructorMode.RESPONSES_TOOLS- case StructureMethod.INSTRUCTOR_OPENAI_RESPONSES_TOOLS_WITH_INBUILT_TOOLS:- return InstructorMode.RESPONSES_TOOLS_WITH_INBUILT_TOOLS- # anthropic- case StructureMethod.INSTRUCTOR_ANTHROPIC_TOOLS:- return InstructorMode.ANTHROPIC_TOOLS- case StructureMethod.INSTRUCTOR_ANTHROPIC_REASONING_TOOLS:- return InstructorMode.ANTHROPIC_REASONING_TOOLS- case StructureMethod.INSTRUCTOR_ANTHROPIC_JSON:- return InstructorMode.ANTHROPIC_JSON- # mistral- case StructureMethod.INSTRUCTOR_MISTRAL_TOOLS:- return InstructorMode.MISTRAL_TOOLS- case StructureMethod.INSTRUCTOR_MISTRAL_STRUCTURED_OUTPUTS:- return InstructorMode.MISTRAL_STRUCTURED_OUTPUTS- # vertexai & google- case StructureMethod.INSTRUCTOR_VERTEXAI_TOOLS:- return InstructorMode.VERTEXAI_TOOLS- case StructureMethod.INSTRUCTOR_VERTEXAI_JSON:- return InstructorMode.VERTEXAI_JSON- case StructureMethod.INSTRUCTOR_VERTEXAI_PARALLEL_TOOLS:- return InstructorMode.VERTEXAI_PARALLEL_TOOLS- case StructureMethod.INSTRUCTOR_GENAI_TOOLS:- return InstructorMode.GENAI_TOOLS- case StructureMethod.INSTRUCTOR_GENAI_STRUCTURED_OUTPUTS:- return InstructorMode.GENAI_STRUCTURED_OUTPUTS- # cohere- case StructureMethod.INSTRUCTOR_COHERE_TOOLS:- return InstructorMode.COHERE_TOOLS- case StructureMethod.INSTRUCTOR_COHERE_JSON_SCHEMA:- return InstructorMode.COHERE_JSON_SCHEMA- # cerebras- case StructureMethod.INSTRUCTOR_CEREBRAS_TOOLS:- return InstructorMode.CEREBRAS_TOOLS- case StructureMethod.INSTRUCTOR_CEREBRAS_JSON:- return InstructorMode.CEREBRAS_JSON- # fireworks- case StructureMethod.INSTRUCTOR_FIREWORKS_TOOLS:- return InstructorMode.FIREWORKS_TOOLS- case StructureMethod.INSTRUCTOR_FIREWORKS_JSON:- return InstructorMode.FIREWORKS_JSON- # bedrock- case StructureMethod.INSTRUCTOR_BEDROCK_TOOLS:- return InstructorMode.BEDROCK_TOOLS- case StructureMethod.INSTRUCTOR_BEDROCK_JSON:- return InstructorMode.BEDROCK_JSON- # other providers- case StructureMethod.INSTRUCTOR_WRITER_TOOLS:- return InstructorMode.WRITER_TOOLS- case StructureMethod.INSTRUCTOR_PERPLEXITY_JSON:- return InstructorMode.PERPLEXITY_JSON- case StructureMethod.INSTRUCTOR_OPENROUTER_STRUCTURED_OUTPUTS:- return InstructorMode.OPENROUTER_STRUCTURED_OUTPUTSdiff --git a/pipelex/kit/configs/inference/backends/bedrock.toml b/pipelex/kit/configs/inference/backends/bedrock.tomlindex 4a6ac6bf9..e876def7c 100644--- a/pipelex/kit/configs/inference/backends/bedrock.toml+++ b/pipelex/kit/configs/inference/backends/bedrock.toml@@ -22,7 +22,7 @@[defaults]model_type = "llm"-sdk = "bedrock_aioboto3"+sdk = "bedrock_aioboto"thinking_mode = "none"################################################################################diff --git a/pipelex/kit/configs/inference/backends/google.toml b/pipelex/kit/configs/inference/backends/google.tomlindex 5c93038ac..69d8ddf68 100644--- a/pipelex/kit/configs/inference/backends/google.toml+++ b/pipelex/kit/configs/inference/backends/google.toml@@ -23,7 +23,7 @@[defaults]model_type = "llm"sdk = "google"-structure_method = "instructor/genai_tools"+structure_method = "instructor/genai_structured_outputs" # Gemini's native JSON outputthinking_mode = "manual"################################################################################diff --git a/pipelex/migration/goldens/inference-backend/[email protected] b/pipelex/migration/goldens/inference-backend/[email protected]new file mode 100644index 000000000..f46825eb1--- /dev/null+++ b/pipelex/migration/goldens/inference-backend/[email protected]@@ -0,0 +1,291 @@+################################################################################+# Portkey Configuration+################################################################################+#+# This file defines the model specifications for the Portkey backend.+# It contains model definitions for various AI models.+#+# Configuration structure:+# - Each model is defined in its own section with the model name as the header+# - Headers with dots must be quoted (e.g., ["gpt-4.1"])+# - Model costs are in USD per million tokens (input/output)+#+# Documentation: https://docs.pipelex.com+# Support: https://go.pipelex.com/discord+#+################################################################################++################################################################################+# MODEL DEFAULTS+################################################################################++[defaults]+model_type = "llm"+sdk = "portkey_completions"+structure_method = "instructor/openai_tools"+thinking_mode = "none"++################################################################################+# LANGUAGE MODELS+################################################################################++# --- OpenAI LLMs --------------------------------------------------------------+[gpt-4o-mini]+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+costs = { input = 0.15, output = 0.6 }+sdk = "portkey_responses"+structure_method = "instructor/openai_responses_tools"+thinking_mode = "none"+x-portkey-provider = "@openai"++[gpt-4o]+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+costs = { input = 2.5, output = 10.0 }+sdk = "portkey_responses"+structure_method = "instructor/openai_responses_tools"+thinking_mode = "none"+x-portkey-provider = "@openai"++["gpt-4.1-nano"]+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+costs = { input = 0.1, output = 0.4 }+sdk = "portkey_responses"+structure_method = "instructor/openai_responses_tools"+thinking_mode = "none"+x-portkey-provider = "@openai"++["gpt-4.1-mini"]+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+costs = { input = 0.4, output = 1.6 }+sdk = "portkey_responses"+structure_method = "instructor/openai_responses_tools"+thinking_mode = "none"+x-portkey-provider = "@openai"++["gpt-4.1"]+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+costs = { input = 2, output = 8 }+sdk = "portkey_responses"+structure_method = "instructor/openai_responses_tools"+thinking_mode = "none"+x-portkey-provider = "@openai"++[o1]+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+costs = { input = 15.0, output = 60.0 }+valued_constraints = { fixed_temperature = 1 }+sdk = "portkey_responses"+structure_method = "instructor/openai_responses_tools"+thinking_mode = "manual"+x-portkey-provider = "@openai"++[o3-mini]+inputs = ["text"]+outputs = ["text", "structured"]+costs = { input = 1.1, output = 4.4 }+valued_constraints = { fixed_temperature = 1 }+sdk = "portkey_responses"+structure_method = "instructor/openai_responses_tools"+thinking_mode = "manual"+x-portkey-provider = "@openai"++[o3]+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+costs = { input = 2, output = 8 }+valued_constraints = { fixed_temperature = 1 }+sdk = "portkey_responses"+structure_method = "instructor/openai_responses_tools"+thinking_mode = "manual"+x-portkey-provider = "@openai"++[gpt-5-nano]+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+costs = { input = 0.05, output = 0.4 }+valued_constraints = { fixed_temperature = 1 }+sdk = "portkey_responses"+structure_method = "instructor/openai_responses_tools"+thinking_mode = "manual"+x-portkey-provider = "@openai"++[gpt-5-mini]+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+costs = { input = 0.25, output = 2.0 }+valued_constraints = { fixed_temperature = 1 }+sdk = "portkey_responses"+structure_method = "instructor/openai_responses_tools"+thinking_mode = "manual"+x-portkey-provider = "@openai"++[gpt-5]+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+costs = { input = 1.25, output = 10.0 }+valued_constraints = { fixed_temperature = 1 }+sdk = "portkey_responses"+structure_method = "instructor/openai_responses_tools"+thinking_mode = "manual"+x-portkey-provider = "@openai"++["gpt-5.1"]+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+costs = { input = 1.25, output = 10.0 }+valued_constraints = { fixed_temperature = 1 }+sdk = "portkey_responses"+structure_method = "instructor/openai_responses_tools"+thinking_mode = "manual"+x-portkey-provider = "@openai"++["gpt-5.1-codex"]+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+costs = { input = 1.25, output = 10.0 }+valued_constraints = { fixed_temperature = 1 }+sdk = "portkey_responses"+structure_method = "instructor/openai_responses_tools"+thinking_mode = "manual"+x-portkey-provider = "@openai"++# --- Claude LLMs --------------------------------------------------------------+[claude-3-haiku]+model_id = "claude-3-haiku-20240307"+max_tokens = 4096+inputs = ["text", "images"]+outputs = ["text", "structured"]+max_prompt_images = 100+costs = { input = 0.25, output = 1.25 }+thinking_mode = "none"+x-portkey-provider = "@anthropic"++["claude-3.7-sonnet"]+model_id = "claude-3-7-sonnet-20250219"+max_tokens = 8192+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+max_prompt_images = 100+costs = { input = 3.0, output = 15.0 }+thinking_mode = "manual"+x-portkey-provider = "@anthropic"++[claude-4-sonnet]+model_id = "claude-sonnet-4-20250514"+max_tokens = 64000+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+max_prompt_images = 100+costs = { input = 3.0, output = 15.0 }+thinking_mode = "manual"+x-portkey-provider = "@anthropic"++[claude-4-opus]+model_id = "claude-opus-4-20250514"+max_tokens = 32000+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+max_prompt_images = 100+costs = { input = 3.0, output = 15.0 }+thinking_mode = "manual"+x-portkey-provider = "@anthropic"++["claude-4.1-opus"]+model_id = "claude-opus-4-1-20250805"+max_tokens = 32000+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+max_prompt_images = 100+costs = { input = 3.0, output = 15.0 }+thinking_mode = "manual"+x-portkey-provider = "@anthropic"++["claude-4.5-sonnet"]+model_id = "claude-sonnet-4-5-20250929"+max_tokens = 64000+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+max_prompt_images = 100+costs = { input = 3.0, output = 15.0 }+thinking_mode = "manual"+x-portkey-provider = "@anthropic"++["claude-4.5-haiku"]+model_id = "claude-haiku-4-5-20251001"+max_tokens = 64000+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+max_prompt_images = 100+costs = { input = 1.0, output = 5.0 }+thinking_mode = "manual"+x-portkey-provider = "@anthropic"++["claude-4.5-opus"]+model_id = "claude-opus-4-5-20251101"+max_tokens = 64000+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+max_prompt_images = 100+costs = { input = 5.0, output = 25.0 }+thinking_mode = "manual"+x-portkey-provider = "@anthropic"++["claude-4.6-opus"]+model_id = "claude-opus-4-6"+max_tokens = 64000+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+max_prompt_images = 100+costs = { input = 5.0, output = 25.0 }+thinking_mode = "adaptive"+x-portkey-provider = "@anthropic"++# --- Gemini LLMs --------------------------------------------------------------+["gemini-2.5-pro"]+model_id = "gemini-2.5-pro"+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+max_prompt_images = 3000+costs = { input = 1.25, output = 10.0 }+thinking_mode = "manual"+x-portkey-provider = "@google"++["gemini-2.5-flash"]+model_id = "gemini-2.5-flash"+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+costs = { input = 0.30, output = 2.50 }+thinking_mode = "manual"+x-portkey-provider = "@google"++["gemini-2.5-flash-lite"]+model_id = "gemini-2.5-flash-lite"+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+costs = { input = 0.10, output = 0.40 }+thinking_mode = "manual"+x-portkey-provider = "@google"++["gemini-3.1-pro"]+model_id = "gemini-3.1-pro-preview"+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+max_prompt_images = 3000+costs = { input = 2, output = 12.0 }+thinking_mode = "adaptive"+x-portkey-provider = "@google"++["gemini-3.0-flash"]+model_id = "gemini-3-flash-preview"+inputs = ["text", "images", "pdf"]+outputs = ["text", "structured"]+max_prompt_images = 3000+costs = { input = 0.5, output = 3.0 }+thinking_mode = "adaptive"+x-portkey-provider = "@google"diff --git a/pipelex/migration/goldens/inference-backend/[email protected] b/pipelex/migration/goldens/inference-backend/[email protected]new file mode 100644index 000000000..525439d99--- /dev/null+++ b/pipelex/migration/goldens/inference-backend/[email protected]@@ -0,0 +1,155 @@+{+ "surface_id": "inference-backend",+ "schema_version": 3,+ "document_root_is_open": true,+ "paths": {+ "*": {+ "value_type": "table",+ "required": true,+ "open_node": false+ },+ "*.costs": {+ "value_type": "dict[enum, float]",+ "required": false,+ "open_node": true+ },+ "*.costs.*": {+ "value_type": "float",+ "required": true,+ "open_node": false+ },+ "*.enabled": {+ "value_type": "bool",+ "required": false,+ "open_node": false+ },+ "*.endpoint_path": {+ "value_type": "str",+ "required": false,+ "open_node": false+ },+ "*.inputs": {+ "value_type": "list[str]",+ "required": false,+ "open_node": false+ },+ "*.listed_constraints": {+ "value_type": "list[enum]",+ "required": false,+ "enum_members": [+ "max_tokens_must_be_high_enough",+ "temperature_must_be_multiplied_by_2",+ "temperature_unsupported"+ ],+ "open_node": false+ },+ "*.max_prompt_images": {+ "value_type": "int",+ "required": false,+ "open_node": false+ },+ "*.max_tokens": {+ "value_type": "int",+ "required": false,+ "open_node": false+ },+ "*.model_id": {+ "value_type": "str",+ "required": false,+ "open_node": false+ },+ "*.model_type": {+ "value_type": "enum",+ "required": false,+ "enum_members": [+ "img_gen",+ "llm",+ "search",+ "text_extractor"+ ],+ "open_node": false+ },+ "*.outputs": {+ "value_type": "list[str]",+ "required": false,+ "open_node": false+ },+ "*.rules": {+ "value_type": "dict[enum, str]",+ "required": false,+ "open_node": true+ },+ "*.rules.*": {+ "value_type": "str",+ "required": true,+ "open_node": false+ },+ "*.sdk": {+ "value_type": "str",+ "required": false,+ "open_node": false+ },+ "*.structure_method": {+ "value_type": "enum",+ "required": false,+ "enum_members": [+ "instructor/anthropic_json",+ "instructor/anthropic_reasoning_tools",+ "instructor/anthropic_tools",+ "instructor/bedrock_json",+ "instructor/bedrock_tools",+ "instructor/cerebras_json",+ "instructor/cerebras_tools",+ "instructor/cohere_json_schema",+ "instructor/cohere_tools",+ "instructor/fireworks_json",+ "instructor/fireworks_tools",+ "instructor/genai_structured_outputs",+ "instructor/genai_tools",+ "instructor/json",+ "instructor/json_schema",+ "instructor/md_json",+ "instructor/mistral_structured_outputs",+ "instructor/mistral_tools",+ "instructor/openai_json_o1",+ "instructor/openai_parallel_tools",+ "instructor/openai_responses_tools",+ "instructor/openai_responses_tools_with_inbuilt_tools",+ "instructor/openai_structured_outputs",+ "instructor/openai_tools",+ "instructor/openrouter_structured_outputs",+ "instructor/perplexity_json",+ "instructor/vertexai_json",+ "instructor/vertexai_parallel_tools",+ "instructor/vertexai_tools",+ "instructor/writer_tools"+ ],+ "open_node": false+ },+ "*.thinking_mode": {+ "value_type": "enum",+ "required": false,+ "enum_members": [+ "adaptive",+ "manual",+ "none"+ ],+ "open_node": false+ },+ "*.valued_constraints": {+ "value_type": "dict[enum, any]",+ "required": false,+ "open_node": true+ },+ "*.valued_constraints.*": {+ "value_type": "any",+ "required": true,+ "open_node": false+ },+ "*.variant": {+ "value_type": "str",+ "required": false,+ "open_node": false+ }+ }+}diff --git a/pipelex/migration/ledgers/inference-backend.toml b/pipelex/migration/ledgers/inference-backend.tomlindex b735e18a0..3436812ff 100644--- a/pipelex/migration/ledgers/inference-backend.toml+++ b/pipelex/migration/ledgers/inference-backend.toml@@ -11,7 +11,7 @@ id = "inference-backend"title = "Inference backend model definitions"subdirectory = "inference/backends"tier_glob = "*.toml"-current_schema_version = 2+current_schema_version = 3min_supported_schema_version = 0[[migration]]@@ -53,3 +53,34 @@ declared_removed_paths = ["*.prompting_target"]kind = "delete_key"table_path = ["*"]key = "prompting_target"++# Unsafe because `sdk` is a free string, an open token each plugin registers, so the schema cannot prove+# a spelling stale and the remap legality rule forbids a `safe` entry. Being unsafe costs nothing at boot:+# the old handle still validates, so the boot never reaches the ledger. What the entry buys is that+# `pipelex migrate` names each file still carrying the old handle, where it would otherwise report nothing+# to do while every Bedrock call from that file fails on an unregistered SDK.+[[migration]]+id = "inference-backend@3"+to_schema_version = 3+introduced_in = "0.69.0"+breaking = true+safety = "unsafe"+title = "Rename the bedrock_aioboto3 SDK handle to bedrock_aioboto, by hand"+description = """+Bedrock's async client now runs on `aiobotocore` directly rather than through `aioboto3`, which pinned \+`boto3` to an old release, so the SDK handle that selects it is renamed from `bedrock_aioboto3` to \+`bedrock_aioboto`, a name for the async client that no longer names the library it is built on. A backend \+file that still names the old handle keeps loading, but every call to a model it defines fails, because no \+plugin registers that SDK any more.+"""+guidance = """+Replace `sdk = "bedrock_aioboto3"` with `sdk = "bedrock_aioboto"` wherever the file sets it: in \+`[defaults]`, which is where the Bedrock file we ship sets it, and in any model table that overrides it. \+Nothing else changes, and the synchronous `bedrock_boto3` handle keeps its name.+"""++[[migration.ops]] # `["*"]` is every root table of the file: `[defaults]` and each model alike+kind = "remap_value"+table_path = ["*"]+key = "sdk"+mapping = { bedrock_aioboto3 = "bedrock_aioboto" }diff --git a/pipelex/pipe_machinery/pipe_abstract.py b/pipelex/pipe_machinery/pipe_abstract.pyindex ae465d45c..e6ab10c3e 100644--- a/pipelex/pipe_machinery/pipe_abstract.py+++ b/pipelex/pipe_machinery/pipe_abstract.py@@ -1168,6 +1168,10 @@ class PipeAbstract(ABC, BaseModel):context=parent_ctx,attributes=span_attributes,)+ # A tracer that records nothing, the no-op tracer `OTEL_SDK_DISABLED` hands out for one, gives back the+ # parent it was handed rather than a span of its own; that is no span, exactly as with no tracer.+ if span.get_span_context() == parent_span_context:+ return None, False# Debug logging, under the span it announces, so the line's `pipelex.*` fields name that spanspan_ctx = span.get_span_context()diff --git a/pipelex/plugins/exceptions.py b/pipelex/plugins/exceptions.pyindex 511ce920c..b414ab972 100644--- a/pipelex/plugins/exceptions.py+++ b/pipelex/plugins/exceptions.py@@ -28,13 +28,18 @@ class InferenceBackendNotFoundError(PluginError):Raised by the family worker factories on a registry-lookup miss — typically amodel whose backend plugin is not installed or was disabled via- ``runtime.plugins.disabled``.+ ``runtime.plugins.disabled``, or a backend file still naming an sdk handle a+ release renamed, which the plugin that serves it no longer registers."""def __init__(self, *, family: str, sdk: str):self.family = familyself.sdk = sdk- message = f"No inference backend registered for sdk '{sdk}' in the {family} family. Is its plugin installed and enabled?"+ message = (+ f"No inference backend registered for sdk '{sdk}' in the {family} family. Is its plugin installed and enabled? "+ f"If it is, '{sdk}' may be a handle a release renamed: `pipelex migrate` reports each backend file "+ "that still sets a retired handle."+ )super().__init__(message)diff --git a/pipelex/plugins/inference_backend_registry.py b/pipelex/plugins/inference_backend_registry.pyindex d3829fb27..b900c1458 100644--- a/pipelex/plugins/inference_backend_registry.py+++ b/pipelex/plugins/inference_backend_registry.py@@ -34,7 +34,7 @@ def require_sdk(*, spec: str | Sequence[str], extra: str, msg: str, dependency_nmissing optional extra fails when the backend is actually used, not at boot.- ``spec``: the import name(s) to probe (e.g. ``"anthropic"`` or- ``["boto3", "aioboto3"]`` when several are required together).+ ``["boto3", "aiobotocore"]`` when several are required together).- ``dependency_name``: the human-facing package name shown in the error;defaults to the joined names of the *missing* specs only (override when theimport name differs from the distribution name, e.g. specdiff --git a/pipelex/providers/anthropic/anthropic_llm_worker.py b/pipelex/providers/anthropic/anthropic_llm_worker.pyindex 6e1e7f390..82de182b3 100644--- a/pipelex/providers/anthropic/anthropic_llm_worker.py+++ b/pipelex/providers/anthropic/anthropic_llm_worker.py@@ -30,6 +30,7 @@ from pipelex.cogt.llm.llm_utils import (dump_response_from_structured_gen,)from pipelex.cogt.llm.llm_worker_abstract import LLMWorkerAbstract+from pipelex.cogt.llm.structured_output import StructureMethodfrom pipelex.cogt.llm.thinking_mode import ThinkingModefrom pipelex.cogt.model_backends.constraints import ListedConstraintfrom pipelex.cogt.model_backends.model_spec import InferenceModelSpec@@ -304,6 +305,22 @@ class AnthropicLLMWorker(LLMWorkerAbstract):return full_reply_content+ def _structure_method_kwargs(self) -> dict[str, Any]:+ """What the structured call sends, beyond what instructor's mode sets, for the model's structure method.++ instructor resolves `anthropic_reasoning_tools` to its core tool mode, which forces `tool_choice` onto+ the response tool unless thinking is on, and thinking never is for a structured call. A model that+ refuses a forced tool choice, Fable 5.1 among them, names that method to get the request instructor used+ to make for it: `tool_choice` left on auto, with a system line steering the model to the tool call.+ instructor leaves a `tool_choice` it is given as it is, and sends a `system` it is given ahead of the prompt's.+ """+ if self.inference_model.structure_method != StructureMethod.INSTRUCTOR_ANTHROPIC_REASONING_TOOLS:+ return {}+ return {+ "tool_choice": {"type": "auto"},+ "system": [{"type": "text", "text": "Return only the tool call and no additional text."}],+ }+@overrideasync def _gen_object(self,@@ -335,13 +352,15 @@ class AnthropicLLMWorker(LLMWorkerAbstract):messages=messages,response_model=schema,# instructor's retry is confined to schema re-ask: this validation-only AsyncRetrying- # re-asks on a malformed/invalid output but lets a transport error propagate as the raw- # SDK exception — transport retry is the SDK client floor (Tier 1) alone.+ # re-asks on a malformed/invalid output but never retries a transport error, which ends the+ # loop and comes out wrapped, for the except clause below to unwrap — transport retry is the+ # SDK client floor (Tier 1) alone.max_retries=make_instructor_schema_retrying(max_attempts=llm_job.job_config.schema_reask_max_attempts),model=self.inference_model.model_id,temperature=omit if temperature_unsupported else job_params.temperature,max_tokens=effective_max_tokens,timeout=float(timeout_seconds), # Explicit timeout disables SDK's long-request protection+ **self._structure_method_kwargs(),)except InstructorRetryException as instructor_exc:# instructor wraps SDK exceptions during retries; recover the underlyingdiff --git a/pipelex/providers/bedrock/bedrock_client_aioboto3.py b/pipelex/providers/bedrock/bedrock_client_aiobotocore.pysimilarity index 79%rename from pipelex/providers/bedrock/bedrock_client_aioboto3.pyrename to pipelex/providers/bedrock/bedrock_client_aiobotocore.pyindex 09b3c8966..6aa15e3eb 100644--- a/pipelex/providers/bedrock/bedrock_client_aioboto3.py+++ b/pipelex/providers/bedrock/bedrock_client_aiobotocore.py@@ -1,6 +1,6 @@from typing import TYPE_CHECKING, Any, cast-import aioboto3+from aiobotocore.session import get_sessionfrom typing_extensions import overridefrom pipelex import log@@ -12,11 +12,11 @@ if TYPE_CHECKING:from types_aiobotocore_bedrock_runtime.type_defs import ConverseResponseTypeDef-class BedrockClientAioboto3(BedrockClientProtocol):+class BedrockClientAiobotocore(BedrockClientProtocol):def __init__(self, aws_region: str):- log.verbose(f"Init BedrockClientAioboto3 with region '{aws_region}'")+ log.verbose(f"Init BedrockClientAiobotocore with region '{aws_region}'")self.aws_region = aws_region- self.session = aioboto3.Session()+ self.session = get_session()@overrideasync def chat(@@ -39,8 +39,8 @@ class BedrockClientAioboto3(BedrockClientProtocol):if system_text:params["system"] = [{"text": system_text}]- async with self.session.client("bedrock-runtime", region_name=self.aws_region) as aioboto3_session: # pyright: ignore[reportUnknownMemberType]- conversation_response: ConverseResponseTypeDef = await aioboto3_session.converse(**params)+ async with self.session.create_client("bedrock-runtime", region_name=self.aws_region) as bedrock_runtime_client: # pyright: ignore[reportUnknownMemberType]+ conversation_response: ConverseResponseTypeDef = await bedrock_runtime_client.converse(**params)resp_dict: dict[str, Any] = cast("dict[str, Any]", conversation_response)usage_dict: dict[str, Any] = resp_dict["usage"]nb_tokens_by_category: NbTokensByCategoryDict = {diff --git a/pipelex/providers/bedrock/bedrock_factory.py b/pipelex/providers/bedrock/bedrock_factory.pyindex b8b88b218..45027c7ae 100644--- a/pipelex/providers/bedrock/bedrock_factory.py+++ b/pipelex/providers/bedrock/bedrock_factory.py@@ -12,7 +12,7 @@ from pipelex.providers.bedrock.bedrock_message import BedrockContentItem, Bedrocclass BedrockSdkVariant(StrEnum):BOTO3 = "bedrock_boto3"- AIBOTO3 = "bedrock_aioboto3"+ AIOBOTO = "bedrock_aioboto"class BedrockExtraField(StrEnum):@@ -40,10 +40,10 @@ class BedrockFactory:bedrock_async_client: BedrockClientProtocollog.verbose(f"Using '{sdk_variant}' for BedrockClient")match sdk_variant:- case BedrockSdkVariant.AIBOTO3:- from pipelex.providers.bedrock.bedrock_client_aioboto3 import BedrockClientAioboto3 # ruff: ignore[import-outside-top-level]+ case BedrockSdkVariant.AIOBOTO:+ from pipelex.providers.bedrock.bedrock_client_aiobotocore import BedrockClientAiobotocore # ruff: ignore[import-outside-top-level]- bedrock_async_client = BedrockClientAioboto3(+ bedrock_async_client = BedrockClientAiobotocore(aws_region=backend.extra_config[BedrockExtraField.AWS_REGION],)case BedrockSdkVariant.BOTO3:diff --git a/pipelex/providers/bedrock/bedrock_list.py b/pipelex/providers/bedrock/bedrock_list.pyindex 55b5c30e9..64018ee62 100644--- a/pipelex/providers/bedrock/bedrock_list.py+++ b/pipelex/providers/bedrock/bedrock_list.py@@ -24,10 +24,10 @@ def list_bedrock_models(any_listed: bool,) -> None:"""List Bedrock models."""- if importlib.util.find_spec("boto3") is None or importlib.util.find_spec("aioboto3") is None:- lib_name = "boto3,aioboto3"+ if importlib.util.find_spec("boto3") is None or importlib.util.find_spec("aiobotocore") is None:+ lib_name = "boto3,aiobotocore"lib_extra_name = "bedrock"- msg = "The boto3 and aioboto3 SDKs are required to use Bedrock models."+ msg = "The boto3 and aiobotocore SDKs are required to use Bedrock models."raise MissingDependencyError(lib_name,lib_extra_name,diff --git a/pipelex/providers/bedrock/bedrock_llms.py b/pipelex/providers/bedrock/bedrock_llms.pyindex e501053a8..ec3330ede 100644--- a/pipelex/providers/bedrock/bedrock_llms.py+++ b/pipelex/providers/bedrock/bedrock_llms.py@@ -35,9 +35,9 @@ def bedrock_list_available_models(try:import boto3 # ruff: ignore[import-outside-top-level]except ImportError as exc:- lib_name = "boto3,aioboto3"+ lib_name = "boto3,aiobotocore"lib_extra_name = "bedrock"- msg = "The boto3 and aioboto3 SDKs are required to use Bedrock models."+ msg = "The boto3 and aiobotocore SDKs are required to use Bedrock models."raise MissingDependencyError(lib_name,lib_extra_name,diff --git a/pipelex/providers/bedrock/bedrock_plugin.py b/pipelex/providers/bedrock/bedrock_plugin.pyindex fc70c6307..b49b26a44 100644--- a/pipelex/providers/bedrock/bedrock_plugin.py+++ b/pipelex/providers/bedrock/bedrock_plugin.py@@ -8,7 +8,7 @@ from pipelex.plugins.registrar import PluginRegistrarfrom pipelex.plugins.sdk_client_registry import SdkClientRegistryfrom pipelex.reporting.reporting_protocol import ReportingProtocol-_BEDROCK_MISSING_MSG = "The boto3 and aioboto3 SDKs are required to use Bedrock models."+_BEDROCK_MISSING_MSG = "The boto3 and aiobotocore SDKs are required to use Bedrock models."def _make_bedrock_worker(@@ -18,7 +18,7 @@ def _make_bedrock_worker(sdk_clients: SdkClientRegistry,reporting_delegate: ReportingProtocol | None,) -> InferenceWorkerAbstract:- require_sdk(spec=["boto3", "aioboto3"], extra="bedrock", msg=_BEDROCK_MISSING_MSG)+ require_sdk(spec=["boto3", "aiobotocore"], extra="bedrock", msg=_BEDROCK_MISSING_MSG)from pipelex.providers.bedrock.bedrock_factory import BedrockFactory # ruff: ignore[import-outside-top-level]from pipelex.providers.bedrock.bedrock_llm_worker import BedrockLLMWorker # ruff: ignore[import-outside-top-level]@@ -50,13 +50,13 @@ async def _list_bedrock_models( # ruff: ignore[unused-async]class BedrockPlugin:- """Built-in driver for Bedrock models via boto3/aioboto3."""+ """Built-in driver for Bedrock models via boto3/aiobotocore."""name = "bedrock"targets_api = PLUGIN_API_VERSIONdef register(self, registrar: PluginRegistrar) -> None:registrar.add_inference_backend(family=InferenceFamily.LLM, sdk="bedrock_boto3", make_worker=_make_bedrock_worker)- registrar.add_inference_backend(family=InferenceFamily.LLM, sdk="bedrock_aioboto3", make_worker=_make_bedrock_worker)+ registrar.add_inference_backend(family=InferenceFamily.LLM, sdk="bedrock_aioboto", make_worker=_make_bedrock_worker)registrar.add_model_lister(sdk="bedrock", lister=_list_bedrock_models)- registrar.add_model_lister(sdk="bedrock_aioboto3", lister=_list_bedrock_models)+ registrar.add_model_lister(sdk="bedrock_aioboto", lister=_list_bedrock_models)diff --git a/pipelex/providers/google/google_llm_worker.py b/pipelex/providers/google/google_llm_worker.pyindex add79c77e..c55be2a51 100644--- a/pipelex/providers/google/google_llm_worker.py+++ b/pipelex/providers/google/google_llm_worker.py@@ -239,6 +239,23 @@ class GoogleLLMWorker(LLMWorkerAbstract):return text_content+ def _validates_structured_output_strictly(self) -> bool:+ """Whether ``instructor`` validates a structured response in pydantic's strict mode.++ Under tool calling, Gemini's function-call arguments reach ``instructor`` as Python values, and strict+ mode refuses a string for an enum field when it validates Python input, so every schema with an enum+ would fail. Gemini's native JSON output is parsed from text, where strict mode accepts a string for an+ enum. So tool calling validates in lax mode, and JSON output stays strict.+ """+ from instructor import Mode as InstructorMode # ruff: ignore[import-outside-top-level]++ match self.instructor_for_objects.mode:+ case InstructorMode.TOOLS:+ return False+ case _:+ # `from_genai` supports only TOOLS and JSON; any other mode is parsed from text like JSON.+ return True+@overrideasync def _gen_object(self,@@ -251,14 +268,6 @@ class GoogleLLMWorker(LLMWorkerAbstract):self._validate_no_reasoning_for_structured_gen(job_params=job_params)contents = await GoogleFactory.prepare_user_contents(llm_job.llm_prompt)- # Build generation config- generation_config = genai_types.GenerateContentConfig(- system_instruction=llm_job.llm_prompt.system_text,- temperature=job_params.temperature,- max_output_tokens=job_params.max_tokens,- candidate_count=1,- )-# Deferred import: avoid pulling heavy SDK at module-load timefrom instructor.core import InstructorRetryException # ruff: ignore[import-outside-top-level]@@ -267,11 +276,19 @@ class GoogleLLMWorker(LLMWorkerAbstract):messages=[cast("ChatCompletionMessageParam", contents)],response_model=schema,# instructor's retry is confined to schema re-ask: this validation-only AsyncRetrying- # re-asks on a malformed/invalid output but lets a transport error propagate as the raw- # SDK exception — transport retry is the SDK client floor (Tier 1) alone.+ # re-asks on a malformed/invalid output but never retries a transport error, which ends the+ # loop and comes out wrapped, for the except clause below to unwrap — transport retry is the+ # SDK client floor (Tier 1) alone.max_retries=make_instructor_schema_retrying(max_attempts=llm_job.job_config.schema_reask_max_attempts),model=self.inference_model.model_id,- generation_config=generation_config,+ # instructor's genai handlers build the Google config themselves and read these as+ # top-level OpenAI-style kwargs: a `GenerateContentConfig` passed as `generation_config`+ # or `config` is dropped, and the system prompt is read only from `system`.+ system=llm_job.llm_prompt.system_text,+ temperature=job_params.temperature,+ max_tokens=job_params.max_tokens,+ n=1,+ strict=self._validates_structured_output_strictly(),)except InstructorRetryException as instructor_exc:# instructor wraps SDK exceptions during retries; recover the underlyingdiff --git a/pipelex/providers/mistral/mistral_config.py b/pipelex/providers/mistral/mistral_config.pyindex 791d91414..4fb9ccd8e 100644--- a/pipelex/providers/mistral/mistral_config.py+++ b/pipelex/providers/mistral/mistral_config.py@@ -9,7 +9,7 @@ from pipelex.cogt.llm.reasoning_config_base import EffortToLevelMap, get_reasonifrom pipelex.system.configuration.config_model import ConfigModelif TYPE_CHECKING:- from mistralai.models import MistralPromptMode+ from mistralai.client.models import MistralPromptModefrom pipelex.cogt.llm.llm_job_components import ReasoningEffortdiff --git a/pipelex/providers/mistral/mistral_extract_worker.py b/pipelex/providers/mistral/mistral_extract_worker.pyindex aa6f5cc24..de1bc622b 100644--- a/pipelex/providers/mistral/mistral_extract_worker.py+++ b/pipelex/providers/mistral/mistral_extract_worker.py@@ -1,7 +1,9 @@from typing import Anyimport httpx-from mistralai import Mistral, MistralError+from mistralai.client import Mistral+from mistralai.client.errors import MistralError+from mistralai.client.models import DocumentURLChunkTypedDict, ImageURLChunkTypedDictfrom typing_extensions import overridefrom pipelex.cogt.exceptions import ExtractCapabilityError, SdkTypeError@@ -44,9 +46,15 @@ class MistralExtractWorker(ExtractWorkerAbstract):extract_job: ExtractJob,) -> ExtractOutput:# TODO: report usage+ # Refused before either path starts, so a document is never uploaded for a request that cannot be served.+ if extract_job.job_params.should_caption_images:+ msg = "Captioning is not implemented for Mistral OCR."+ raise ExtractCapabilityError(msg)+if image_uri := extract_job.extract_input.image_uri:extract_output = await self._extract_page_from_image(image_uri=image_uri,+ extract_job_params=extract_job.job_params,)elif document_uri := extract_job.extract_input.document_uri:@@ -61,27 +69,12 @@ class MistralExtractWorker(ExtractWorkerAbstract):async def _extract_page_from_image(self,+ *,image_uri: str,+ extract_job_params: ExtractJobParams,) -> ExtractOutput:document = await MistralFactory.make_mistral_image_url_chunk_from_uri(uri=image_uri)- try:- extract_response = await self.mistral_client.ocr.process_async(- model=self.inference_model.model_id,- document=document,- )- except (MistralError, httpx.TransportError) as sdk_exc:- metadata = extract_mistral_metadata(sdk_exc)- classification = classify_inference_error(metadata)- raise render_inference_error(- metadata=metadata,- classification=classification,- family=InferenceErrorFamily.EXTRACT,- model_desc=self.inference_model.desc,- model_handle=self.inference_model.name,- ) from sdk_exc- return await MistralFactory.make_extract_output_from_mistral_response(- mistral_extract_response=extract_response,- )+ return await self._ocr(document=document, extract_job_params=extract_job_params)async def _extract_pages_from_document(self,@@ -89,15 +82,23 @@ class MistralExtractWorker(ExtractWorkerAbstract):*,extract_job_params: ExtractJobParams,) -> ExtractOutput:- if extract_job_params.should_caption_images:- msg = "Captioning is not implemented for Mistral OCR."- raise ExtractCapabilityError(msg)-document = await MistralFactory.make_mistral_document_url_chunk_from_uri(mistral_client=self.mistral_client,uri=document_uri,)+ return await self._ocr(document=document, extract_job_params=extract_job_params)++ async def _ocr(+ self,+ *,+ document: ImageURLChunkTypedDict | DocumentURLChunkTypedDict,+ extract_job_params: ExtractJobParams,+ ) -> ExtractOutput:+ """Run Mistral OCR on an image or a document, with the same image options for both.+ OCR finds figures inside an image as well as inside a document, and returns each without its+ pixels unless `include_image_base64` is set, so both requests ask for them.+ """# max_nb_images: None=unlimited, 0=no images, N=limit to N imagesimage_limit: int | None = extract_job_params.max_nb_imagesimage_min_size: int | None = extract_job_params.image_min_size if image_limit != 0 else Nonediff --git a/pipelex/providers/mistral/mistral_factory.py b/pipelex/providers/mistral/mistral_factory.pyindex 1acc08b48..28493184d 100644--- a/pipelex/providers/mistral/mistral_factory.py+++ b/pipelex/providers/mistral/mistral_factory.py@@ -4,21 +4,22 @@ from pathlib import Pathfrom typing import TYPE_CHECKINGimport aiofiles-import mistralai-from mistralai import Mistral-from mistralai.models import (+from mistralai.client import Mistral+from mistralai.client.models import (+ ChatCompletionRequestMessage,ContentChunk,DocumentURLChunk,DocumentURLChunkTypedDict,ImageURLChunk,ImageURLChunkTypedDict,- Messages,+ OCRImageObject,+ OCRResponse,SystemMessage,TextChunk,UsageInfo,UserMessage,)-from mistralai.utils import BackoffStrategy, RetryConfig+from mistralai.client.utils import BackoffStrategy, RetryConfigif TYPE_CHECKING:# Deferred import: avoid pulling heavy SDK at module-load time@@ -70,9 +71,9 @@ class MistralFactory:# Message#########################################################- async def make_simple_messages(self, llm_job: LLMJob) -> list[Messages]:+ async def make_simple_messages(self, llm_job: LLMJob) -> list[ChatCompletionRequestMessage]:"""Makes a list of messages with a system message (if provided) and followed by a user message."""- messages: list[Messages] = []+ messages: list[ChatCompletionRequestMessage] = []if system_text := llm_job.llm_prompt.system_text:messages.append(SystemMessage(content=system_text))@@ -196,7 +197,7 @@ class MistralFactory:@classmethodasync def make_extract_output_from_mistral_response(cls,- mistral_extract_response: mistralai.OCRResponse,+ mistral_extract_response: OCRResponse,) -> ExtractOutput:"""Convert Mistral OCR response to ExtractOutput.@@ -277,7 +278,7 @@ class MistralFactory:@classmethoddef make_extracted_image_from_page_from_mistral_ocr_image_obj(cls,- mistral_ocr_image_obj: mistralai.OCRImageObject,+ mistral_ocr_image_obj: OCRImageObject,) -> ExtractedImageFromPage:if not mistral_ocr_image_obj.image_base64:msg = "Mistral OCR image object does not have an image base64"diff --git a/pipelex/providers/mistral/mistral_llm_worker.py b/pipelex/providers/mistral/mistral_llm_worker.pyindex c637b38e7..869678fb7 100644--- a/pipelex/providers/mistral/mistral_llm_worker.py+++ b/pipelex/providers/mistral/mistral_llm_worker.py@@ -1,9 +1,10 @@from typing import TYPE_CHECKING, Anyimport httpx-from mistralai import Mistral, MistralError-from mistralai.models import MistralPromptMode, TextChunk, ThinkChunk-from mistralai.types import UNSET+from mistralai.client import Mistral+from mistralai.client.errors import MistralError+from mistralai.client.models import MistralPromptMode, TextChunk, ThinkChunk+from mistralai.client.types import UNSETfrom typing_extensions import overridefrom pipelex import log@@ -29,8 +30,8 @@ from pipelex.reporting.reporting_protocol import ReportingProtocolfrom pipelex.tools.typing.pydantic_utils import BaseModelTypeVarif TYPE_CHECKING:- from mistralai.models import ChatCompletionResponse- from mistralai.types import OptionalNullable+ from mistralai.client.models import ChatCompletionResponse+ from mistralai.client.types import OptionalNullableclass MistralLLMWorker(LLMWorkerAbstract):@@ -157,7 +158,19 @@ class MistralLLMWorker(LLMWorkerAbstract):detail="Mistral returned a response with no choices — the system will retry automatically",),)- mistral_response_content = response.choices[0].message.content+ message = response.choices[0].message+ if message is None:+ msg = "Mistral response.choices[0].message is None"+ raise LLMCompletionError(+ msg,+ error_category=InferenceErrorCategory.TRANSIENT,+ provider_metadata=None,+ user_action=UserAction(+ kind=UserActionKind.WAIT_AND_RETRY,+ detail="Mistral returned a choice with no message — the system will retry automatically",+ ),+ )+ mistral_response_content = message.contentresult_text: strif isinstance(mistral_response_content, str):result_text = mistral_response_content@@ -223,8 +236,9 @@ class MistralLLMWorker(LLMWorkerAbstract):temperature=job_params.temperature,max_tokens=job_params.max_tokens or self.default_max_tokens,# instructor's retry is confined to schema re-ask: this validation-only AsyncRetrying- # re-asks on a malformed/invalid output but lets a transport error propagate as the raw- # SDK exception — transport retry is the SDK client floor (Tier 1) alone. Without this+ # re-asks on a malformed/invalid output but never retries a transport error, which ends the+ # loop and comes out wrapped, for the except clause below to unwrap — transport retry is the+ # SDK client floor (Tier 1) alone. Without this# the Mistral worker passed no max_retries at all, so structured Mistral got no re-ask.max_retries=make_instructor_schema_retrying(max_attempts=llm_job.job_config.schema_reask_max_attempts),)diff --git a/pipelex/providers/mistral/mistral_llms.py b/pipelex/providers/mistral/mistral_llms.pyindex d0e582354..935cfcb6f 100644--- a/pipelex/providers/mistral/mistral_llms.py+++ b/pipelex/providers/mistral/mistral_llms.py@@ -1,19 +1,17 @@-from mistralai.models import Data+from mistralai.client.models import BaseModelCard, FTModelCardfrom pipelex.providers.mistral.mistral_exceptions import MistralModelListingErrorfrom pipelex.providers.mistral.mistral_factory import MistralFactoryfrom pipelex.runtime_hub import get_models_manager-def mistral_list_available_models() -> list[Data]:+def mistral_list_available_models() -> list[BaseModelCard | FTModelCard]:backend = get_models_manager().get_required_inference_backend("mistral")mistral_client = MistralFactory.make_mistral_client(backend=backend)models_list_response = mistral_client.models.list()- if not models_list_response:+ # The SDK keeps a card of a type it does not know as raw data, with no id or context length to list it by+ known_models = [model for model in models_list_response.data or [] if isinstance(model, (BaseModelCard, FTModelCard))]+ if not known_models:msg = "No models found"raise MistralModelListingError(msg)- models_list = models_list_response.data- if not models_list:- msg = "No models found"- raise MistralModelListingError(msg)- return sorted(models_list, key=lambda model: model.id)+ return sorted(known_models, key=lambda model: model.id)diff --git a/pipelex/providers/openai/openai_completions_llm_worker.py b/pipelex/providers/openai/openai_completions_llm_worker.pyindex 846c9688c..e4be1667f 100644--- a/pipelex/providers/openai/openai_completions_llm_worker.py+++ b/pipelex/providers/openai/openai_completions_llm_worker.py@@ -228,8 +228,9 @@ class OpenAICompletionsLLMWorker(LLMWorkerAbstract):messages=messages,response_model=schema,# instructor's retry is confined to schema re-ask: this validation-only AsyncRetrying- # re-asks on a malformed/invalid output but lets a transport error propagate as the raw- # SDK exception — transport retry is the SDK client floor (Tier 1) alone.+ # re-asks on a malformed/invalid output but never retries a transport error, which ends the+ # loop and comes out wrapped, for the except clause below to unwrap — transport retry is the+ # SDK client floor (Tier 1) alone.max_retries=make_instructor_schema_retrying(max_attempts=llm_job.job_config.schema_reask_max_attempts),extra_headers=extra_headers,extra_body=extra_body,diff --git a/pipelex/providers/openai/openai_func.py b/pipelex/providers/openai/openai_func.pydeleted file mode 100644index cb321dea4..000000000--- a/pipelex/providers/openai/openai_func.py+++ /dev/null@@ -1,72 +0,0 @@-import inspect-from collections.abc import Callable-from typing import TYPE_CHECKING, Any--from openai.types.chat import ChatCompletionMessage-from pydantic import BaseModel, create_model--if TYPE_CHECKING:- from instructor import OpenAISchema---def create_pydantic_model_from_function(func: Callable[..., Any]) -> type[BaseModel]:- """Create a Pydantic BaseModel from a function's signature.-- Args:- func: The function to inspect. Its parameters become model fields.-- Returns:- type[BaseModel]: A dynamically created Pydantic model class.-- Raises:- ValueError: If the function has unsupported parameter kinds.-- """- sig = inspect.signature(func)- fields: dict[str, tuple[type[Any], Any]] = {- name: (param.annotation, param.default if param.default is not inspect.Parameter.empty else ...) for name, param in sig.parameters.items()- }- model_name = func.__name__- return create_model(__model_name=model_name, **fields) # type: ignore[name-defined,call-overload,no-any-return] # pyright: ignore[reportCallIssue, reportUnknownVariableType]---def create_openai_schema_from_function(func: Callable[..., Any]) -> dict[str, Any]:- """Creates an OpenAI schema from a function.-- Parameters- ----------- func : Callable[..., Any]- The Python function to introspect and convert into an OpenAI tool schema.-- Returns:- -------- dict[str, Any]- The OpenAI-compatible schema describing the function's name, description,- and parameters.-- """- model: type[BaseModel] = create_pydantic_model_from_function(func)- from instructor import openai_schema # ruff: ignore[import-outside-top-level]-- the_openai_schema: OpenAISchema = openai_schema(model)- as_openai_schema: dict[str, Any] = the_openai_schema.openai_schema-- # replace description using first non-empty line of func.__doc__ description- if func.__doc__:- description = func.__doc__.strip().split("\n")[0]- else:- description = func.__name__- as_openai_schema["description"] = description- return as_openai_schema---def list_openai_tools(openai_message: ChatCompletionMessage) -> list[str]:- if not openai_message.tool_calls:- return []- tools: list[str] = []- for tool_call in openai_message.tool_calls:- if tool_call.type == "function":- tools.append(tool_call.function.name)- else:- tools.append(tool_call.type)- return toolsdiff --git a/pipelex/providers/openai/openai_responses_llm_worker.py b/pipelex/providers/openai/openai_responses_llm_worker.pyindex 5517e9459..b37a88f6c 100644--- a/pipelex/providers/openai/openai_responses_llm_worker.py+++ b/pipelex/providers/openai/openai_responses_llm_worker.py@@ -33,6 +33,7 @@ from pipelex.config import get_configfrom pipelex.system.telemetry.otel_constants import InferenceOutputTypeif TYPE_CHECKING:+ from instructor.core.client import AsyncResponsefrom openai.types.chat import ChatCompletionMessageParamfrom pipelex.cogt.llm.llm_job import LLMJob@@ -209,23 +210,26 @@ class OpenAIResponsesLLMWorker(LLMWorkerAbstract):inference_model=self.inference_model, inference_job=llm_job, output_desc=schema.__name__)input_items = await self.openai_responses_factory.make_input_items(llm_job=llm_job)+ # An async instructor sets `responses` to an AsyncResponse. Pyright reads that from AsyncInstructor,+ # but mypy takes the attribute's type from the sync base class, where it is the sync Response, whose+ # `max_retries` refuses the AsyncRetrying below; the cast is for mypy alone+ responses_helper = cast("AsyncResponse", self.instructor_for_objects.responses) # pyright: ignore[reportUnnecessaryCast]try:- result_object, completion = await self.instructor_for_objects.responses.create_with_completion( # pyright: ignore[reportUnknownMemberType]+ result_object, completion = await responses_helper.create_with_completion(input=cast("list[ChatCompletionMessageParam]", input_items),response_model=schema,# instructor's retry is confined to schema re-ask: this validation-only AsyncRetrying- # re-asks on a malformed/invalid output but lets a transport error propagate as the raw- # SDK exception — transport retry is the SDK client floor (Tier 1) alone.- # The arg-type ignore below is because instructor's `responses` path is stub-typed- # `int | Retrying`, but `initialize_retrying` accepts (and the async path needs) an `AsyncRetrying`.- max_retries=make_instructor_schema_retrying(max_attempts=llm_job.job_config.schema_reask_max_attempts), # type: ignore[arg-type]+ # re-asks on a malformed/invalid output but never retries a transport error, which ends the+ # loop and comes out wrapped, for the except clause below to unwrap — transport retry is the+ # SDK client floor (Tier 1) alone.+ max_retries=make_instructor_schema_retrying(max_attempts=llm_job.job_config.schema_reask_max_attempts),model=self.inference_model.model_id,instructions=llm_job.llm_prompt.system_text,temperature=job_params.temperature,max_output_tokens=job_params.max_tokens or NOT_GIVEN,extra_headers=extra_headers,extra_body=extra_body,- ) # type: ignore[arg-type,misc]+ )except InstructorRetryException as instructor_exc:# instructor wraps SDK exceptions during retries; recover the underlying# one so transient/capacity/auth/not-found errors aren't flattened to UNKNOWN.diff --git a/pipelex/system/telemetry/current_span.py b/pipelex/system/telemetry/current_span.pyindex 4b38a81fe..da17f4d13 100644--- a/pipelex/system/telemetry/current_span.py+++ b/pipelex/system/telemetry/current_span.py@@ -48,8 +48,9 @@ _ACTIVE_PIPELEX_SPAN: ContextVar[Span | None] = ContextVar("pipelex_active_span"def pipelex_span_active(*, span: Span | None) -> Generator[None]:"""Hold ``span`` as the Pipelex span active here while the block runs; no span, or one naming no trace, holds nothing.- ``None`` is what the runtime holds with no tracer or in a dry run. A span naming no trace is what a- no-op tracer starts, under ``OTEL_SDK_DISABLED`` for one, and holding it would hide the enclosing+ ``None`` is what the runtime holds with no tracer, in a dry run, or under a no-op tracer, the one+ ``OTEL_SDK_DISABLED`` hands out for one, which from ``opentelemetry-api`` 1.40 gives back the parent+ it was handed and before that an invalid span. A span naming no trace would hide the enclosingPipelex span from every line of the block. OpenTelemetry's own context is left as it is either way."""if span is None or not span.get_span_context().is_valid:diff --git a/pipelex/system/telemetry/otel_constants.py b/pipelex/system/telemetry/otel_constants.pyindex cfcfcf661..1402e3aa9 100644--- a/pipelex/system/telemetry/otel_constants.py+++ b/pipelex/system/telemetry/otel_constants.py@@ -1,15 +1,21 @@"""OpenTelemetry constants for GenAI-compliant tracing.This module defines attribute keys used for instrumenting LLM operations-with OpenTelemetry, following the GenAI semantic conventions.+with OpenTelemetry, following the GenAI semantic conventions. The keys and values are written out+rather than imported: `opentelemetry-semantic-conventions` deprecated its whole GenAI namespace when+those conventions moved to their own repository, which publishes no Python package."""+from collections.abc import Mapping, Sequencefrom enum import StrEnum--from opentelemetry.semconv._incubating.attributes import gen_ai_attributes as otel_gen_ai_attributes # ruff: ignore[import-private-name]+from typing import TypeAliasfrom pipelex.cogt.inference.inference_constants import InferenceOutputType+# OpenTelemetry's own `AttributeValue` is a chained assignment (`AnyValue = AttributeValue = ...`),+# which mypy refuses as a type; this alias spells out the same recursive union.+OTelAttributeValue: TypeAlias = str | bool | int | float | bytes | Sequence["OTelAttributeValue"] | Mapping[str, "OTelAttributeValue"] | None+class OTelConstants:"""OpenTelemetry constants."""@@ -37,18 +43,18 @@ class OTelConstants:class GenAISpanAttr(StrEnum):"""OpenTelemetry GenAI semantic convention attribute keys."""- OPERATION_NAME = otel_gen_ai_attributes.GEN_AI_OPERATION_NAME- PROVIDER_NAME = otel_gen_ai_attributes.GEN_AI_PROVIDER_NAME+ OPERATION_NAME = "gen_ai.operation.name"+ PROVIDER_NAME = "gen_ai.provider.name"- REQUEST_MODEL = otel_gen_ai_attributes.GEN_AI_REQUEST_MODEL- REQUEST_MAX_TOKENS = otel_gen_ai_attributes.GEN_AI_REQUEST_MAX_TOKENS- REQUEST_TEMPERATURE = otel_gen_ai_attributes.GEN_AI_REQUEST_TEMPERATURE- REQUEST_SEED = otel_gen_ai_attributes.GEN_AI_REQUEST_SEED+ REQUEST_MODEL = "gen_ai.request.model"+ REQUEST_MAX_TOKENS = "gen_ai.request.max_tokens"+ REQUEST_TEMPERATURE = "gen_ai.request.temperature"+ REQUEST_SEED = "gen_ai.request.seed"- RESPONSE_MODEL = otel_gen_ai_attributes.GEN_AI_RESPONSE_MODEL- OUTPUT_TYPE = otel_gen_ai_attributes.GEN_AI_OUTPUT_TYPE- USAGE_INPUT_TOKENS = otel_gen_ai_attributes.GEN_AI_USAGE_INPUT_TOKENS- USAGE_OUTPUT_TOKENS = otel_gen_ai_attributes.GEN_AI_USAGE_OUTPUT_TOKENS+ RESPONSE_MODEL = "gen_ai.response.model"+ OUTPUT_TYPE = "gen_ai.output.type"+ USAGE_INPUT_TOKENS = "gen_ai.usage.input_tokens"+ USAGE_OUTPUT_TOKENS = "gen_ai.usage.output_tokens"# Content attributes for PostHog compatibility (not in standard semconv)# PostHog UI expects these as span attributes, not events@@ -91,18 +97,26 @@ class PostHogEvent(StrEnum):GENERATION = "$ai_generation"-def make_otel_gen_ai_output_type(output_type: str) -> otel_gen_ai_attributes.GenAiOutputTypeValues:+class GenAIOutputType(StrEnum):+ """OpenTelemetry GenAI semantic convention values of `gen_ai.output.type`."""++ TEXT = "text"+ JSON = "json"+ IMAGE = "image"+++def make_otel_gen_ai_output_type(output_type: str) -> GenAIOutputType:try:llm_output_type = InferenceOutputType(output_type)match llm_output_type:case InferenceOutputType.TEXT:- return otel_gen_ai_attributes.GenAiOutputTypeValues.TEXT+ return GenAIOutputType.TEXTcase InferenceOutputType.OBJECT:- return otel_gen_ai_attributes.GenAiOutputTypeValues.JSON+ return GenAIOutputType.JSONcase InferenceOutputType.IMAGE:- return otel_gen_ai_attributes.GenAiOutputTypeValues.IMAGE+ return GenAIOutputType.IMAGEcase InferenceOutputType.PAGES:- return otel_gen_ai_attributes.GenAiOutputTypeValues.JSON+ return GenAIOutputType.JSONexcept ValueError as exc:msg = f"Invalid LLM output type: {output_type}, and we only support LLM output types for now in OpenTelemetry"raise ValueError(msg) from excdiff --git a/pipelex/system/telemetry/posthog_span_exporter.py b/pipelex/system/telemetry/posthog_span_exporter.pyindex d5d4527fd..36ed6aea4 100644--- a/pipelex/system/telemetry/posthog_span_exporter.py+++ b/pipelex/system/telemetry/posthog_span_exporter.py@@ -8,13 +8,13 @@ from typing import Any, Mapping, Sequence, castfrom opentelemetry.sdk.trace import ReadableSpanfrom opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult-from opentelemetry.util.types import AttributeValuefrom posthog import Posthogfrom typing_extensions import overridefrom pipelex import logfrom pipelex.system.telemetry.otel_constants import (GenAISpanAttr,+ OTelAttributeValue,OTelConstants,PipelexSpanAttr,PostHogAttr,@@ -61,7 +61,7 @@ class PostHogSpanExporter(SpanExporter):self.run_identity_policy = run_identity_policyself.redaction_config = redaction_config- def _resolve_identity(self, *, attributes: Mapping[str, AttributeValue]) -> TelemetryIdentity:+ def _resolve_identity(self, *, attributes: Mapping[str, OTelAttributeValue]) -> TelemetryIdentity:"""Resolve who this span belongs to on this stream."""return TelemetryIdentity.make_from_span_attributes(attributes=attributes,@@ -230,7 +230,7 @@ class PostHogSpanExporter(SpanExporter):return output_class_namereturn OTelConstants.PIPE_CODE_REDACTED if output_class_name else None- def _get_base_properties(self, span: ReadableSpan, *, attributes: Mapping[str, AttributeValue]) -> dict[str, Any]:+ def _get_base_properties(self, span: ReadableSpan, *, attributes: Mapping[str, OTelAttributeValue]) -> dict[str, Any]:"""Get common properties for all span types."""properties: dict[str, Any] = {}if span.end_time and span.start_time:@@ -254,7 +254,7 @@ class PostHogSpanExporter(SpanExporter):return properties- def _export_generation_span(self, span: ReadableSpan, *, attributes: Mapping[str, AttributeValue]) -> None:+ def _export_generation_span(self, span: ReadableSpan, *, attributes: Mapping[str, OTelAttributeValue]) -> None:"""Export a GenAI generation span."""properties = self._get_base_properties(span=span, attributes=attributes)provider_operation_combo = f"{attributes.get(GenAISpanAttr.PROVIDER_NAME)}:{attributes.get(GenAISpanAttr.OPERATION_NAME)}"@@ -324,7 +324,7 @@ class PostHogSpanExporter(SpanExporter):identity=self._resolve_identity(attributes=attributes),)- def _export_pipe_span(self, span: ReadableSpan, *, attributes: Mapping[str, AttributeValue]) -> None:+ def _export_pipe_span(self, span: ReadableSpan, *, attributes: Mapping[str, OTelAttributeValue]) -> None:"""Export a pipe execution span."""properties = self._get_base_properties(span=span, attributes=attributes)diff --git a/pipelex/tools/storage/s3_storage_provider.py b/pipelex/tools/storage/s3_storage_provider.pyindex 6e72202e4..e07c24b24 100644--- a/pipelex/tools/storage/s3_storage_provider.py+++ b/pipelex/tools/storage/s3_storage_provider.py@@ -1,5 +1,4 @@import importlib.util-import inspectfrom typing import Anyfrom urllib.parse import quote@@ -17,7 +16,7 @@ class S3StorageProvider(StorageProviderAbstract):"""Storage provider implementation for AWS S3 storage.Files are stored in an S3 bucket with keys being path strings.- Uses aioboto3 for async S3 operations.+ Uses aiobotocore for async S3 operations."""def __init__(@@ -39,15 +38,15 @@ class S3StorageProvider(StorageProviderAbstract):self._session: Any = Nonedef _check_dependency(self) -> None:- """Check if aioboto3 is installed.+ """Check if aiobotocore is installed.Raises:- MissingDependencyError: If aioboto3 is not installed.+ MissingDependencyError: If aiobotocore is not installed."""- if importlib.util.find_spec("aioboto3") is None:- lib_name = "aioboto3"+ if importlib.util.find_spec("aiobotocore") is None:+ lib_name = "aiobotocore"lib_extra_name = "s3"- msg = "aioboto3 is required for S3 storage."+ msg = "aiobotocore is required for S3 storage."raise MissingDependencyError(lib_name,lib_extra_name,@@ -55,17 +54,17 @@ class S3StorageProvider(StorageProviderAbstract):)def _get_session(self) -> Any:- """Get or create the aioboto3 session (lazy initialization).+ """Get or create the aiobotocore session (lazy initialization).Returns:- The aioboto3 Session.+ The aiobotocore AioSession."""self._check_dependency()if self._session is None:- import aioboto3 # ruff: ignore[import-outside-top-level] - optional dependency, lazy import+ from aiobotocore.session import get_session # ruff: ignore[import-outside-top-level] - optional dependency, lazy import- self._session = aioboto3.Session() # pyright: ignore[reportUnknownMemberType]+ self._session = get_session()return self._sessiondef _get_client_config(self) -> dict[str, Any]:@@ -74,14 +73,14 @@ class S3StorageProvider(StorageProviderAbstract):Returns:Dictionary of client configuration parameters."""- from botocore.config import Config # ruff: ignore[import-outside-top-level] - optional dependency, lazy import+ from aiobotocore.config import AioConfig # ruff: ignore[import-outside-top-level] - optional dependency, lazy importendpoint_url = f"https://s3.{self._region}.amazonaws.com"# botocore addresses path-style whenever an endpoint is given, which puts every link on the region's# shared host. A content security policy can allow a bucket only by its own host, so pin the virtual# style: `<bucket>.s3.<region>.amazonaws.com`. botocore still falls back to path-style for a bucket# name that cannot be a hostname, a dotted one included.- config = Config(signature_version="s3v4", s3={"addressing_style": "virtual"}) # pyright: ignore[reportUnknownArgumentType]+ config = AioConfig(signature_version="s3v4", s3={"addressing_style": "virtual"})return {"service_name": "s3",@@ -112,7 +111,7 @@ class S3StorageProvider(StorageProviderAbstract):session = self._get_session()client_config = self._get_client_config()- async with session.client(**client_config) as client: # pyright: ignore[reportUnknownMemberType]+ async with session.create_client(**client_config) as client:try:response = await client.get_object(Bucket=self._bucket_name, Key=key)async with response["Body"] as stream:@@ -157,7 +156,7 @@ class S3StorageProvider(StorageProviderAbstract):session = self._get_session()client_config = self._get_client_config()- async with session.client(**client_config) as client: # pyright: ignore[reportUnknownMemberType]+ async with session.create_client(**client_config) as client:try:put_params: dict[str, Any] = {"Bucket": self._bucket_name,@@ -224,15 +223,13 @@ class S3StorageProvider(StorageProviderAbstract):session = self._get_session()client_config = self._get_client_config()- async with session.client(**client_config) as client: # pyright: ignore[reportUnknownMemberType]+ async with session.create_client(**client_config) as client:try:- # generate_presigned_url may be sync or async depending on aioboto3 version- maybe_url = client.generate_presigned_url(+ presigned_url: str = await client.generate_presigned_url("get_object",Params={"Bucket": self._bucket_name, "Key": key},ExpiresIn=self._signed_urls_lifespan,)- presigned_url: str = await maybe_url if inspect.isawaitable(maybe_url) else maybe_urlreturn presigned_urlexcept (BotoCoreError, ClientError):# ClientError (signing rejected) and BotoCoreError (transport failure) bothdiff --git a/pyproject.toml b/pyproject.tomlindex dbb903641..3e8a4dfb9 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -26,7 +26,7 @@ dependencies = ["filetype>=1.2.0","httpx>=0.23.0,<1.0.0","idna>=3.15",- "instructor>=1.13", # 1.13+ exposes instructor.core; 1.11/1.12 had mypy typing errors+ "instructor>=1.17.0,<2.0.0", # 1.16+ supports mistralai 2.x; 2.0 is a planned major we have not assessed"jinja2>=3.1.4","json2html>=1.3.0","kajson==0.7.1",@@ -34,10 +34,10 @@ dependencies = ["mthds==0.17.0","networkx>=3.4.2","openai>=2.0.0",- "opentelemetry-api>=1.38.0",+ "opentelemetry-api>=1.39.0","opentelemetry-exporter-otlp-proto-http>=1.38.0","opentelemetry-semantic-conventions>=0.59b0",- "opentelemetry-sdk>=1.38.0", # 1.38+ takes the keyword-only emit() arguments the otlp sink passes+ "opentelemetry-sdk>=1.39.0", # 1.39+ exports InMemoryLogRecordExporter, which the otlp sink's tests use"pillow>=12.1.1","pipelex-tools-py>=0.1.3","polyfactory>=2.21.0",@@ -73,7 +73,7 @@ Changelog = "https://docs.pipelex.com/changelog/"[project.optional-dependencies]anthropic = ["anthropic>=0.78.0"]-bedrock = ["boto3>=1.34.131", "aioboto3>=13.4.0"]+bedrock = ["boto3>=1.42.42", "aiobotocore>=3.0.0"]# Rich renders the terminal: the `pipelex` and `pipelex-agent` CLIs, the console log sink and the# pretty-print mode "rich". Nothing the runtime does on the way to running a method needs it, so a# server selects the json sink and a Rich-free pretty-print mode and never reaches for it. Leaving this@@ -101,9 +101,9 @@ google-genai = []huggingface = ["huggingface_hub>=1.5.0,<2.0.0"]linkup = ["linkup-sdk>=0.12.0"]-mistralai = ["mistralai>=1.12.0"]+mistralai = ["mistralai>=2.10.0"]dynamodb = ["boto3>=1.34.131"]-s3 = ["boto3>=1.34.131", "aioboto3>=13.4.0"]+s3 = ["boto3>=1.42.42", "aiobotocore>=3.0.0"]docs = ["mike>=2.1.3","mkdocs>=1.6.1",@@ -135,7 +135,7 @@ dev = ["pytest-split>=0.10.0","pytest-xdist>= 3.6.1","ruff==0.16.4",- "types-aioboto3[bedrock,bedrock-runtime]>=13.4.0",+ "types-aiobotocore[bedrock,bedrock-runtime]>=3.0.0","types-aiofiles>=24.1.0.20240626","types-jsonschema>=4.20.0","types-markdown>=3.6.0.20240316",diff --git a/subject_grants.toml b/subject_grants.tomlindex e2b6c7bcf..315e5c9af 100644--- a/subject_grants.toml+++ b/subject_grants.toml@@ -5176,10 +5176,6 @@ rationale = "Factory from source: builds the result from the model_handle; singlparam = "effort"rationale = "Maps the reasoning effort to a provider reasoning level; single operand."-["pipelex/providers/mistral/mistral_extract_worker.py::MistralExtractWorker._extract_page_from_image"]-param = "image_uri"-rationale = "Extracts from the image_uri; single operand (qualifiers keyword-only)."-["pipelex/providers/mistral/mistral_extract_worker.py::MistralExtractWorker._extract_pages_from_document"]param = "document_uri"rationale = "Extracts from the document_uri; single operand (qualifiers keyword-only)."@@ -5268,18 +5264,6 @@ rationale = "Resolves the reasoning effort from the job params; single operand."param = "effort"rationale = "Maps the reasoning effort to a provider reasoning level; single operand."-["pipelex/providers/openai/openai_func.py::create_openai_schema_from_function"]-param = "func"-rationale = "Factory from source: builds the OpenAI tool schema from the function; single operand."--["pipelex/providers/openai/openai_func.py::create_pydantic_model_from_function"]-param = "func"-rationale = "Factory from source: builds the pydantic model from the function; single operand."--["pipelex/providers/openai/openai_func.py::list_openai_tools"]-param = "openai_message"-rationale = "Derives the tool-call list from the OpenAI message; single operand."-["pipelex/providers/openai/openai_img_gen_worker.py::OpenAIImgGenWorker._get_requested_size"]param = "args_dict"rationale = "Extracts the requested size from the args dict; single operand."diff --git a/tests/helpers/instructor_test_utils.py b/tests/helpers/instructor_test_utils.pyindex b3c9ec972..cb016fff0 100644--- a/tests/helpers/instructor_test_utils.py+++ b/tests/helpers/instructor_test_utils.py@@ -25,31 +25,36 @@ class DummySchema(BaseModel):text: str-def wrap_in_instructor_retry(sdk_exc: Exception, *, include_failed_attempts: bool = True) -> InstructorRetryException:- """Build an ``InstructorRetryException`` as instructor's retry loop would.+def wrap_in_instructor_retry(sdk_exc: Exception, *, earlier_parse_failures: list[Exception] | None = None) -> InstructorRetryException:+ """Build an ``InstructorRetryException`` the way instructor's retry loop raises one around an SDK exception.++ instructor raises it ``from`` the last exception its loop saw. pipelex's re-ask predicate never retries a+ transport failure, so that last exception is the raw SDK exception, and it sits on ``__cause__``.+ ``failed_attempts`` records only the attempts whose response failed to parse, so an SDK exception never+ appears there.Args:- sdk_exc: The underlying SDK exception that should appear as the last- failed attempt.- include_failed_attempts: When ``True`` (default), populate- ``failed_attempts`` with a single :class:`FailedAttempt` wrapping- ``sdk_exc``. When ``False``, leave ``failed_attempts`` as ``None``- so the caller can install a tenacity ``RetryError`` on- ``__cause__`` to exercise the fallback unwrap path.+ sdk_exc: The SDK exception the last attempt raised.+ earlier_parse_failures: The parse failures of the attempts before it, oldest first, which instructor+ re-asked before the SDK exception ended the loop.Returns:- An ``InstructorRetryException`` whose ``failed_attempts[-1].exception``- is ``sdk_exc`` (when ``include_failed_attempts`` is ``True``).+ An ``InstructorRetryException`` chained from ``sdk_exc``."""- failed_attempts: list[FailedAttempt] | None = [FailedAttempt(attempt_number=1, exception=sdk_exc)] if include_failed_attempts else None- return InstructorRetryException(+ failed_attempts = [+ FailedAttempt(attempt_number=attempt_index + 1, exception=parse_failure)+ for attempt_index, parse_failure in enumerate(earlier_parse_failures or [])+ ]+ wrapped = InstructorRetryException(str(sdk_exc),last_completion=None,- n_attempts=1,+ n_attempts=len(failed_attempts) + 1,total_usage=0,create_kwargs={},failed_attempts=failed_attempts,)+ wrapped.__cause__ = sdk_exc+ return wrappeddef make_llm_job(mocker: MockerFixture) -> Any:diff --git a/tests/helpers/test_instructor_test_utils.py b/tests/helpers/test_instructor_test_utils.pyindex 5131b022a..eebec8eb1 100644--- a/tests/helpers/test_instructor_test_utils.py+++ b/tests/helpers/test_instructor_test_utils.py@@ -15,20 +15,24 @@ from tests.helpers.instructor_test_utils import DummySchema, wrap_in_instructor_class TestInstructorTestUtils:"""Verify the shared helpers behave as documented."""- def test_wrap_with_failed_attempts_exposes_sdk_exception(self) -> None:+ def test_wrap_chains_from_the_sdk_exception(self) -> None:sdk_exc = RuntimeError("boom")wrapped = wrap_in_instructor_retry(sdk_exc)assert isinstance(wrapped, InstructorRetryException)- assert wrapped.failed_attempts is not None- assert wrapped.failed_attempts[-1].exception is sdk_exc+ assert wrapped.__cause__ is sdk_exc+ assert wrapped.failed_attempts == []+ assert wrapped.n_attempts == 1- def test_wrap_without_failed_attempts_leaves_attempts_empty(self) -> None:+ def test_wrap_records_earlier_parse_failures_only(self) -> None:sdk_exc = RuntimeError("boom")- wrapped = wrap_in_instructor_retry(sdk_exc, include_failed_attempts=False)+ parse_failure = ValueError("bad shape")+ wrapped = wrap_in_instructor_retry(sdk_exc, earlier_parse_failures=[parse_failure])- assert isinstance(wrapped, InstructorRetryException)- assert wrapped.failed_attempts is None or wrapped.failed_attempts == []+ assert wrapped.__cause__ is sdk_exc+ assert wrapped.failed_attempts is not None+ assert [failed_attempt.exception for failed_attempt in wrapped.failed_attempts] == [parse_failure]+ assert wrapped.n_attempts == 2def test_dummy_schema_has_single_text_field(self) -> None:assert issubclass(DummySchema, BaseModel)diff --git a/tests/integration/pipelex/tools/storage/conftest.py b/tests/integration/pipelex/tools/storage/conftest.pyindex 8e0c1a4fb..309ca49c4 100644--- a/tests/integration/pipelex/tools/storage/conftest.py+++ b/tests/integration/pipelex/tools/storage/conftest.py@@ -31,7 +31,7 @@ def storage_method(request: pytest.FixtureRequest) -> StorageMethodLiteral:@pytest.fixturedef s3_mock(mocker: MockerFixture) -> dict[str, Any]:- """Mock aioboto3 for S3 tests.+ """Mock aiobotocore for S3 tests.Creates a mock that simulates S3 behavior using an in-memory dict."""@@ -84,10 +84,10 @@ def s3_mock(mocker: MockerFixture) -> dict[str, Any]:# Create mock sessionmock_session = mocker.MagicMock()- mock_session.client = mocker.MagicMock(return_value=mock_client_context)+ mock_session.create_client = mocker.MagicMock(return_value=mock_client_context)- # Patch aioboto3.Session- mocker.patch("aioboto3.Session", return_value=mock_session)+ # Patch the session factory the provider imports lazily+ mocker.patch("aiobotocore.session.get_session", return_value=mock_session)return {"session": mock_session,@@ -155,7 +155,7 @@ def storage_provider(case "in_memory":return InMemoryStorageProvider()case "s3":- # Request the s3_mock fixture to set up aioboto3 mocks+ # Request the s3_mock fixture to set up aiobotocore mocksrequest.getfixturevalue("s3_mock")return S3StorageProvider(bucket_name=S3_TEST_BUCKET,diff --git a/tests/unit/pipelex/cogt/inference/test_error_classification_unwrap.py b/tests/unit/pipelex/cogt/inference/test_error_classification_unwrap.pyindex 91b793338..4e155a2f8 100644--- a/tests/unit/pipelex/cogt/inference/test_error_classification_unwrap.py+++ b/tests/unit/pipelex/cogt/inference/test_error_classification_unwrap.py@@ -1,14 +1,15 @@"""Tests for ``extract_underlying_sdk_exception``.-Verifies the helper recovers the SDK exception that ``InstructorRetryException``-wraps, falling back through ``__cause__.last_attempt._exception`` when-``failed_attempts`` is empty (the tenacity-only path).+instructor raises ``InstructorRetryException`` from the last exception its retry loop saw: the raw SDK+exception when a call failed in transport, or tenacity's ``RetryError`` when the re-ask budget ran out.+``failed_attempts`` holds only the attempts whose response failed to parse."""from __future__ import annotationsfrom typing import TYPE_CHECKING+from instructor.core import FailedAttempt, InstructorRetryExceptionfrom tenacity import RetryErrorfrom pipelex.cogt.inference.error_classification import extract_underlying_sdk_exception@@ -19,9 +20,9 @@ if TYPE_CHECKING:class TestExtractUnderlyingSdkException:- """``extract_underlying_sdk_exception`` recovers the wrapped SDK exception."""+ """``extract_underlying_sdk_exception`` recovers the exception that ended instructor's retry loop."""- def test_returns_sdk_exception_from_failed_attempts(self) -> None:+ def test_returns_the_sdk_exception_the_wrapper_is_chained_from(self) -> None:sdk_exc = RuntimeError("boom")wrapped = wrap_in_instructor_retry(sdk_exc)@@ -29,17 +30,34 @@ class TestExtractUnderlyingSdkException:assert recovered is sdk_exc- def test_falls_back_to_cause_last_attempt(self, mocker: MockerFixture) -> None:+ def test_prefers_the_sdk_exception_over_an_earlier_parse_failure(self) -> None:+ """A transport failure after a re-asked parse failure is what ended the loop, so it wins."""sdk_exc = RuntimeError("boom")- wrapped = wrap_in_instructor_retry(sdk_exc, include_failed_attempts=False)- wrapped.__cause__ = RetryError(last_attempt=mocker.MagicMock(_exception=sdk_exc))+ wrapped = wrap_in_instructor_retry(sdk_exc, earlier_parse_failures=[ValueError("bad shape")])recovered = extract_underlying_sdk_exception(instructor_exc=wrapped)assert recovered is sdk_exc+ def test_returns_the_last_attempt_of_a_spent_retry_budget(self, mocker: MockerFixture) -> None:+ last_parse_failure = ValueError("still the wrong shape")+ wrapped = self._make_wrapper(failed_attempts=[FailedAttempt(attempt_number=1, exception=ValueError("first"))])+ wrapped.__cause__ = RetryError(last_attempt=mocker.MagicMock(_exception=last_parse_failure))++ recovered = extract_underlying_sdk_exception(instructor_exc=wrapped)++ assert recovered is last_parse_failure++ def test_falls_back_to_the_last_failed_attempt_without_a_cause(self) -> None:+ parse_failure = ValueError("bad shape")+ wrapped = self._make_wrapper(failed_attempts=[FailedAttempt(attempt_number=1, exception=parse_failure)])++ recovered = extract_underlying_sdk_exception(instructor_exc=wrapped)++ assert recovered is parse_failure+def test_returns_none_when_both_paths_empty(self) -> None:- wrapped = wrap_in_instructor_retry(RuntimeError("boom"), include_failed_attempts=False)+ wrapped = self._make_wrapper(failed_attempts=None)recovered = extract_underlying_sdk_exception(instructor_exc=wrapped)@@ -53,3 +71,14 @@ class TestExtractUnderlyingSdkException:recovered = extract_underlying_sdk_exception(instructor_exc=_Garbage())assert recovered is None++ @classmethod+ def _make_wrapper(cls, *, failed_attempts: list[FailedAttempt] | None) -> InstructorRetryException:+ return InstructorRetryException(+ "wrapped",+ last_completion=None,+ n_attempts=1,+ total_usage=0,+ create_kwargs={},+ failed_attempts=failed_attempts,+ )diff --git a/tests/unit/pipelex/cogt/llm/test_instructor_retry.py b/tests/unit/pipelex/cogt/llm/test_instructor_retry.pyindex 5e9f9ad62..a9d9f4222 100644--- a/tests/unit/pipelex/cogt/llm/test_instructor_retry.py+++ b/tests/unit/pipelex/cogt/llm/test_instructor_retry.py@@ -2,7 +2,7 @@``make_instructor_schema_retrying`` must confine ``instructor``'s retry to genuine schema re-ask:a validation failure is retried up to the attempt budget, while a transport error is *not*-retried (so it propagates raw for the worker's ``except`` clause to classify, instead of being+retried (so it ends instructor's loop at once for the worker to classify, instead of beingre-run on top of the SDK client's own transport retry)."""@@ -13,8 +13,9 @@ from typing import TYPE_CHECKINGimport httpximport pytest+from instructor.core import ResponseParsingErrorfrom pydantic import BaseModel, ValidationError-from tenacity import RetryError+from tenacity import RetryError, retry_if_exception_typefrom pipelex.cogt.llm.instructor_retry import make_instructor_schema_retrying@@ -57,6 +58,28 @@ class TestInstructorSchemaRetrying:await retrying(send)assert send.call_count == 2+ async def test_unparseable_response_is_retried(self, mocker: MockerFixture) -> None:+ # instructor raises this when a response carries no tool call or no JSON at all, and re-asks it+ parsing_error = ResponseParsingError("No tool call found in the response", mode="TOOLS", raw_response=None)+ send = mocker.AsyncMock(side_effect=[parsing_error, "ok"])+ retrying = make_instructor_schema_retrying(max_attempts=3)++ result: object = await retrying(send)+ assert result == "ok"+ assert send.call_count == 2++ async def test_predicate_matches_what_instructor_itself_reasks(self) -> None:+ # instructor's default loop, the one a bare `max_retries` int builds, re-asks exactly this set.+ # It is private, and it is read here so that an instructor upgrade that changes it fails this test+ from instructor.v2.core.retry import _RETRYABLE_PARSE_ERRORS # pyright: ignore[reportPrivateUsage] # ruff: ignore[import-outside-top-level]++ retrying = make_instructor_schema_retrying(max_attempts=2)++ assert isinstance(retrying.retry, retry_if_exception_type)+ exception_types = retrying.retry.exception_types+ assert isinstance(exception_types, tuple)+ assert set(exception_types) == set(_RETRYABLE_PARSE_ERRORS)+@pytest.mark.parametrize("transport_exc",[diff --git a/tests/unit/pipelex/cogt/llm/test_llm_worker_current_span.py b/tests/unit/pipelex/cogt/llm/test_llm_worker_current_span.pyindex 714cbe0a3..3662543e8 100644--- a/tests/unit/pipelex/cogt/llm/test_llm_worker_current_span.py+++ b/tests/unit/pipelex/cogt/llm/test_llm_worker_current_span.py@@ -225,3 +225,12 @@ class TestLLMWorkerCurrentSpan:assert list(started.values()) == [llm_span_id](message,) = startedassert f"\n span_id={llm_span_id:016x}\n" in message++ async def test_a_no_op_tracer_holds_no_span_in_the_call(self, mocker: MockerFixture) -> None:+ """A no-op tracer, what the SDK hands out under ``OTEL_SDK_DISABLED``, gives back the parent it was handed, which is no span of the call's."""+ mocker.patch.object(TelemetryManagerAbstract, "get_instance_tracer", return_value=trace.NoOpTracer())+ worker = _make_worker()++ assert await worker.gen_text(llm_job=_make_llm_job()) == "answer"++ assert worker.seen_log_span_ids == [INVALID_SPAN_ID]diff --git a/tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py b/tests/unit/pipelex/cogt/llm/test_llm_worker_factory.pyindex e21dae6f1..f48f4ecf6 100644--- a/tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py+++ b/tests/unit/pipelex/cogt/llm/test_llm_worker_factory.py@@ -213,7 +213,7 @@ class TestLLMWorkerFactory:pytest.param("bedrock_anthropic", ANTHROPIC_CLIENT, ANTHROPIC_WORKER, None, None, None, True, True, id="bedrock_anthropic"),pytest.param("mistral", MISTRAL_CLIENT, MISTRAL_WORKER, "mistral_factory", MistralFactory, None, False, False, id="mistral"),pytest.param("bedrock_boto3", BEDROCK_CLIENT, BEDROCK_WORKER, None, None, None, True, False, id="bedrock_boto3"),- pytest.param("bedrock_aioboto3", BEDROCK_CLIENT, BEDROCK_WORKER, None, None, None, True, False, id="bedrock_aioboto3"),+ pytest.param("bedrock_aioboto", BEDROCK_CLIENT, BEDROCK_WORKER, None, None, None, True, False, id="bedrock_aioboto"),pytest.param("google", GOOGLE_CLIENT, GOOGLE_WORKER, None, None, None, False, False, id="google"),],)@@ -307,7 +307,7 @@ class TestLLMWorkerFactory:pytest.param("bedrock_anthropic", "anthropic", id="bedrock_anthropic"),pytest.param("mistral", "mistral", id="mistral"),pytest.param("bedrock_boto3", "bedrock", id="bedrock_boto3"),- pytest.param("bedrock_aioboto3", "bedrock", id="bedrock_aioboto3"),+ pytest.param("bedrock_aioboto", "bedrock", id="bedrock_aioboto"),pytest.param("google", "google", id="google"),],)@@ -336,3 +336,4 @@ class TestLLMWorkerFactory:assert exc_info.value.sdk == "definitely_not_an_sdk"assert "definitely_not_an_sdk" in str(exc_info.value)assert "Is its plugin installed and enabled?" in str(exc_info.value)+ assert "`pipelex migrate` reports each backend file that still sets a retired handle" in str(exc_info.value)diff --git a/tests/unit/pipelex/cogt/llm/test_structured_output.py b/tests/unit/pipelex/cogt/llm/test_structured_output.pyindex 368b01822..359ad71f3 100644--- a/tests/unit/pipelex/cogt/llm/test_structured_output.py+++ b/tests/unit/pipelex/cogt/llm/test_structured_output.py@@ -1,9 +1,16 @@+import warnings++import instructor+import openaiimport pytestfrom instructor import Mode as InstructorMode+from instructor.v2.core.mode import DEPRECATED_TO_COREfrom pipelex.cogt.llm.structured_output import StructureMethod-EXPECTED_INSTRUCTOR_MODES: dict[StructureMethod, InstructorMode] = {+# The provider-specific instructor mode each structure method is named after. instructor deprecates all but the+# core ones, because the provider now comes from the client, and resolves each to the core mode it stands for.+LEGACY_INSTRUCTOR_MODES: dict[StructureMethod, InstructorMode] = {# genericStructureMethod.INSTRUCTOR_JSON: InstructorMode.JSON,StructureMethod.INSTRUCTOR_MD_JSON: InstructorMode.MD_JSON,@@ -48,15 +55,25 @@ EXPECTED_INSTRUCTOR_MODES: dict[StructureMethod, InstructorMode] = {class TestStructureMethod:- def test_expected_modes_cover_every_member(self):- """Completeness guard: a new StructureMethod member must be added to the expected mapping."""- assert set(EXPECTED_INSTRUCTOR_MODES) == set(StructureMethod)+ def test_legacy_modes_cover_every_member(self):+ """Completeness guard: a new StructureMethod member must be added to the legacy mapping."""+ assert set(LEGACY_INSTRUCTOR_MODES) == set(StructureMethod)@pytest.mark.parametrize(- ("structure_method", "expected_mode"),- list(EXPECTED_INSTRUCTOR_MODES.items()),- ids=[str(member) for member in EXPECTED_INSTRUCTOR_MODES],+ ("structure_method", "legacy_mode"),+ list(LEGACY_INSTRUCTOR_MODES.items()),+ ids=[str(member) for member in LEGACY_INSTRUCTOR_MODES],)- def test_as_instructor_mode(self, structure_method: StructureMethod, expected_mode: InstructorMode):- """Each structure method maps to its exact instructor Mode."""- assert structure_method.as_instructor_mode() is expected_mode+ def test_as_instructor_mode_is_the_core_mode_instructor_resolves_it_to(self, structure_method: StructureMethod, legacy_mode: InstructorMode):+ """Each structure method maps to the core mode instructor itself resolves its provider-specific mode to."""+ assert structure_method.as_instructor_mode() is DEPRECATED_TO_CORE.get(legacy_mode, legacy_mode)++ @pytest.mark.parametrize("structure_method", list(StructureMethod), ids=[str(member) for member in StructureMethod])+ def test_every_structure_method_is_accepted_on_the_openai_sdk(self, structure_method: StructureMethod):+ """A gateway serves every model through an OpenAI client, whichever provider's method its spec names.++ instructor refuses another provider's mode on an OpenAI client, and warns on a deprecated one.+ """+ with warnings.catch_warnings():+ warnings.simplefilter("error", DeprecationWarning)+ instructor.from_openai(client=openai.AsyncOpenAI(api_key="unused"), mode=structure_method.as_instructor_mode())diff --git a/tests/unit/pipelex/migration/test_backend_by_hand_entry.py b/tests/unit/pipelex/migration/test_backend_by_hand_entry.pynew file mode 100644index 000000000..59527daa7--- /dev/null+++ b/tests/unit/pipelex/migration/test_backend_by_hand_entry.py@@ -0,0 +1,64 @@+"""The `inference-backend@3` entry, exercised on the file it is about.++The entry is `unsafe`: it rewrites nothing and only reports a backend file that still names the Bedrock+SDK handle `bedrock_aioboto3`. No reference document the ledger gates replay over carries that value, so+a typo in its mapping would pass every gate and the entry would go silent on the very files it exists+for. These tests hand it such a file.+"""++from pathlib import Path+from typing import Any++import pipelex+from pipelex.migration.engine import apply_ops_over_text, replay_ledger_over_text+from pipelex.migration.ledger import MigrationLedger, load_ledger, packaged_migration_dir+from pipelex.migration.plan import BlockedEntryReason+from pipelex.tools.misc.toml_utils import load_toml_from_content++SURFACE_ID = "inference-backend"+ENTRY_ID = "inference-backend@3"+KIT_BACKENDS_DIR = Path(pipelex.__file__).parent / "kit" / "configs" / "inference" / "backends"++STALE_BEDROCK_FILE = """\+[defaults]+model_type = "llm"+sdk = "bedrock_aioboto3"+structure_method = "instructor/openai_tools"++["claude-4.5-sonnet"]+model_id = "anthropic.claude-sonnet-4-5"+inputs = ["text", "images"]+outputs = ["text", "structured"]+costs = { input = 3.0, output = 15.0 }+"""+++def _ledger() -> MigrationLedger:+ return load_ledger(migration_dir=packaged_migration_dir(), surface_id=SURFACE_ID)+++class TestTheBackendByHandEntry:+ def test_a_stale_file_is_reported_and_left_untouched(self) -> None:+ replay = replay_ledger_over_text(ledger=_ledger(), text=STALE_BEDROCK_FILE)++ assert replay.steps == []+ assert [blocked.entry_id for blocked in replay.blocked] == [ENTRY_ID]+ assert replay.blocked[0].reason == BlockedEntryReason.UNSAFE+ assert replay.blocked[0].guidance is not None+ assert "bedrock_aioboto" in replay.blocked[0].guidance+ assert replay.text == STALE_BEDROCK_FILE++ def test_the_operations_rewrite_the_stale_handle_to_the_current_one(self) -> None:+ """What the guidance tells the user to write is what the operations would have written."""+ entry = next(entry for entry in _ledger().migration if entry.id == ENTRY_ID)++ migrated: dict[str, Any] = load_toml_from_content(apply_ops_over_text(text=STALE_BEDROCK_FILE, ops=entry.ops).text)++ assert migrated["defaults"]["sdk"] == "bedrock_aioboto"+ assert migrated["defaults"]["structure_method"] == "instructor/openai_tools"++ def test_the_file_we_ship_is_not_reported(self) -> None:+ replay = replay_ledger_over_text(ledger=_ledger(), text=(KIT_BACKENDS_DIR / "bedrock.toml").read_text(encoding="utf-8"))++ assert replay.blocked == []+ assert replay.steps == []diff --git a/tests/unit/pipelex/pipe_machinery/test_live_run_pipe_current_span.py b/tests/unit/pipelex/pipe_machinery/test_live_run_pipe_current_span.pyindex 6a0d0751a..6961337f4 100644--- a/tests/unit/pipelex/pipe_machinery/test_live_run_pipe_current_span.py+++ b/tests/unit/pipelex/pipe_machinery/test_live_run_pipe_current_span.py@@ -21,7 +21,7 @@ from typing import TYPE_CHECKING, Any, NamedTupleimport pytestfrom opentelemetry import trace-from opentelemetry.sdk._logs.export import InMemoryLogExporter, SimpleLogRecordProcessor+from opentelemetry.sdk._logs.export import InMemoryLogRecordExporter, SimpleLogRecordProcessorfrom opentelemetry.sdk.trace import TracerProviderfrom opentelemetry.sdk.trace.export import SimpleSpanProcessorfrom opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporter@@ -227,10 +227,10 @@ def _json_lines(buffer: io.StringIO, *, logger_name: str) -> dict[str, LineTrace}-def _otlp_lines(exporter: InMemoryLogExporter, *, logger_name: str) -> dict[str, LineTrace]:+def _otlp_lines(exporter: InMemoryLogRecordExporter, *, logger_name: str) -> dict[str, LineTrace]:lines: dict[str, LineTrace] = {}for log_data in exporter.get_finished_logs():- if log_data.instrumentation_scope.name != logger_name:+ if log_data.instrumentation_scope is None or log_data.instrumentation_scope.name != logger_name:continuerecord = log_data.log_recordtrace_id = f"{record.trace_id:032x}" if record.trace_id else None@@ -280,7 +280,7 @@ class TestLiveRunPipeCurrentSpan:read_lines_of = read_json_lineselse:- exporter = InMemoryLogExporter()+ exporter = InMemoryLogRecordExporter()fresh.install_sink(OtlpLogSink(processor=SimpleLogRecordProcessor(exporter)))def read_otlp_lines(logger_name: str) -> dict[str, LineTrace]:@@ -416,7 +416,7 @@ class TestLiveRunPipeCurrentSpan:assert sunk.read_lines()["inside cancelled"].pipelex_span_id == _hex_span_id(pipe_span)async def test_a_no_op_tracer_leaves_the_callers_span_to_the_line(self, sunk: Sunk, mocker: MockerFixture) -> None:- """A no-op tracer, what the SDK hands out under ``OTEL_SDK_DISABLED``, starts spans naming no trace, which must not hide the caller's."""+ """A no-op tracer, the one ``OTEL_SDK_DISABLED`` hands out, starts no span; the parent it gives back must not name the line."""mocker.patch.object(TelemetryManagerAbstract, "get_instance_tracer", return_value=trace.NoOpTracer())caller_tracer = TracerProvider().get_tracer(__name__)pipe = _make_pipe(code="no_op")diff --git a/tests/unit/pipelex/plugins/test_import_light_boot.py b/tests/unit/pipelex/plugins/test_import_light_boot.pyindex f6c6846eb..03268bd49 100644--- a/tests/unit/pipelex/plugins/test_import_light_boot.py+++ b/tests/unit/pipelex/plugins/test_import_light_boot.py@@ -20,7 +20,7 @@ _GUARD_SCRIPT = textwrap.dedent("google.genai","google.cloud.storage","boto3",- "aioboto3",+ "aiobotocore","fal_client","huggingface_hub","docling",@@ -73,7 +73,7 @@ _GUARD_SCRIPT = textwrap.dedent(assert registrar.inference_backends, "expected the built-in LLM backends to be registered"assert registrar.model_listers, "expected the built-in model listers to be registered import-light"assert registrar.orchestrators, "expected the built-in orchestrators to be registered"- # The built-in StoragePlugin registers all four methods without importing aioboto3 /+ # The built-in StoragePlugin registers all four methods without importing aiobotocore /# google-cloud-storage: the s3/gcp SDK guards live inside the providers' I/O methods, so# registration stays import-light even though those SDKs are BLOCKED above.assert registrar.storage_providers, "expected the built-in storage providers to be registered import-light"diff --git a/tests/unit/pipelex/plugins/test_inference_backend_coverage.py b/tests/unit/pipelex/plugins/test_inference_backend_coverage.pyindex 70c45f853..e28a1d4af 100644--- a/tests/unit/pipelex/plugins/test_inference_backend_coverage.py+++ b/tests/unit/pipelex/plugins/test_inference_backend_coverage.py@@ -45,7 +45,7 @@ EXPECTED_BACKENDS: list[tuple[InferenceFamily, str]] = [(InferenceFamily.LLM, "bedrock_anthropic"),(InferenceFamily.LLM, "mistral"),(InferenceFamily.LLM, "bedrock_boto3"),- (InferenceFamily.LLM, "bedrock_aioboto3"),+ (InferenceFamily.LLM, "bedrock_aioboto"),(InferenceFamily.LLM, "google"),# IMG_GEN(InferenceFamily.IMG_GEN, "gateway_img_gen"),diff --git a/tests/unit/pipelex/plugins/test_model_lister_coverage.py b/tests/unit/pipelex/plugins/test_model_lister_coverage.pyindex a1ca22e98..43b2c91e1 100644--- a/tests/unit/pipelex/plugins/test_model_lister_coverage.py+++ b/tests/unit/pipelex/plugins/test_model_lister_coverage.py@@ -40,7 +40,7 @@ EXPECTED_LISTER_SDKS: list[str] = ["mistral","google","bedrock",- "bedrock_aioboto3",+ "bedrock_aioboto",]diff --git a/tests/unit/pipelex/plugins/test_require_sdk.py b/tests/unit/pipelex/plugins/test_require_sdk.pyindex 914af0064..39465ff5b 100644--- a/tests/unit/pipelex/plugins/test_require_sdk.py+++ b/tests/unit/pipelex/plugins/test_require_sdk.py@@ -48,12 +48,11 @@ class TestRequireSdk:"""def fake_find_spec(name: str) -> object | None:- return None if name == "aioboto3" else object()+ return None if name == "aiobotocore" else object()mocker.patch(f"{REGISTRY_MODULE}.importlib.util.find_spec", side_effect=fake_find_spec)with pytest.raises(MissingDependencyError) as exc_info:- require_sdk(spec=["boto3", "aioboto3"], extra="bedrock", msg="install it")- # boto3 is present, so only aioboto3 should be named (the trailing comma proves the old- # joined "boto3,aioboto3" form is gone — "boto3" alone is a substring of "aioboto3").- assert exc_info.value.dependency_name == "aioboto3"+ require_sdk(spec=["boto3", "aiobotocore"], extra="bedrock", msg="install it")+ # boto3 is present, so only aiobotocore should be named (no joined "boto3,aiobotocore" form).+ assert exc_info.value.dependency_name == "aiobotocore"assert "boto3," not in str(exc_info.value)diff --git a/tests/unit/pipelex/providers/anthropic/test_anthropic_structure_method.py b/tests/unit/pipelex/providers/anthropic/test_anthropic_structure_method.pynew file mode 100644index 000000000..3fa40b535--- /dev/null+++ b/tests/unit/pipelex/providers/anthropic/test_anthropic_structure_method.py@@ -0,0 +1,101 @@+"""The request the Anthropic worker's structured call sends, for each tool structure method.++Driven through a real instructor client over an Anthropic SDK client whose ``messages.create`` records the+request and answers with a tool call, so what is asserted is what instructor actually sends, not the arguments+the worker hands it. ``anthropic_reasoning_tools`` is the method a model that refuses a forced tool choice+names, Fable 5.1 among them, and instructor resolves it to its core tool mode, which forces one.+"""++from __future__ import annotations++from typing import TYPE_CHECKING, Any++import pytest+from anthropic import AsyncAnthropic+from anthropic.types import Message, ToolUseBlock, Usage++from pipelex.cogt.llm.structured_output import StructureMethod+from pipelex.providers.anthropic.anthropic_llm_worker import AnthropicLLMWorker+from tests.helpers.instructor_test_utils import DummySchema, make_llm_job++if TYPE_CHECKING:+ from unittest.mock import AsyncMock++ from pytest_mock import MockerFixture+++def _tool_call_message() -> Message:+ return Message(+ id="msg_test",+ type="message",+ role="assistant",+ model="claude-test",+ content=[ToolUseBlock(type="tool_use", id="toolu_test", name="DummySchema", input={"text": "answer"})],+ stop_reason="tool_use",+ stop_sequence=None,+ usage=Usage(input_tokens=1, output_tokens=1),+ )+++def _make_worker(mocker: MockerFixture, *, structure_method: StructureMethod) -> tuple[AnthropicLLMWorker, AsyncMock]:+ """A worker whose instructor client is built as the worker builds it, over an SDK call that records the request."""+ from instructor import from_anthropic # ruff: ignore[import-outside-top-level]++ sdk_client = AsyncAnthropic(api_key="test-key")+ create = mocker.AsyncMock(return_value=_tool_call_message())+ mocker.patch.object(sdk_client.messages, "create", new=create)++ worker = object.__new__(AnthropicLLMWorker)+ model = mocker.MagicMock()+ model.desc = "test-model-desc"+ model.model_id = "claude-test"+ model.name = "claude-test"+ model.listed_constraints = []+ model.structure_method = structure_method+ worker.inference_model = model+ worker.default_max_tokens = 4096+ worker.instructor_for_objects = from_anthropic(client=sdk_client, mode=structure_method.as_instructor_mode())++ config = mocker.MagicMock()+ config.inference.llm.anthropic.structured_output_timeout_seconds = 1200+ mocker.patch("pipelex.providers.anthropic.anthropic_llm_worker.get_config", return_value=config)+ return worker, create+++def _sent_request(create: AsyncMock) -> dict[str, Any]:+ create.assert_awaited_once()+ await_args = create.await_args+ assert await_args is not None+ return dict(await_args.kwargs)+++def _system_texts(request: dict[str, Any]) -> list[str]:+ system = request["system"]+ if isinstance(system, str):+ return [system]+ return [block["text"] for block in system]++[email protected](loop_scope="class")+class TestAnthropicStructureMethod:+ async def test_reasoning_tools_leaves_the_tool_choice_on_auto(self, mocker: MockerFixture) -> None:+ worker, create = _make_worker(mocker, structure_method=StructureMethod.INSTRUCTOR_ANTHROPIC_REASONING_TOOLS)++ result = await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]++ assert result.text == "answer"+ request = _sent_request(create)+ assert request["tool_choice"] == {"type": "auto"}+ assert [tool["name"] for tool in request["tools"]] == ["DummySchema"]+ # The steering line goes out beside the prompt's own system text, which it does not replace.+ assert _system_texts(request) == ["Return only the tool call and no additional text.", "You are a helpful test assistant."]++ async def test_tools_forces_the_response_tool(self, mocker: MockerFixture) -> None:+ worker, create = _make_worker(mocker, structure_method=StructureMethod.INSTRUCTOR_ANTHROPIC_TOOLS)++ await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]++ request = _sent_request(create)+ assert request["tool_choice"]["type"] == "tool"+ assert request["tool_choice"]["name"] == "DummySchema"+ assert _system_texts(request) == ["You are a helpful test assistant."]diff --git a/tests/unit/pipelex/providers/anthropic/test_anthropic_worker_object_error_handling.py b/tests/unit/pipelex/providers/anthropic/test_anthropic_worker_object_error_handling.pyindex 192827830..6e7d5d039 100644--- a/tests/unit/pipelex/providers/anthropic/test_anthropic_worker_object_error_handling.py+++ b/tests/unit/pipelex/providers/anthropic/test_anthropic_worker_object_error_handling.py@@ -306,11 +306,10 @@ class TestAnthropicWorkerObjectErrorHandling:assert user_action_dict["kind"] == UserActionKind.CHECK_BILLINGassert isinstance(user_action_dict["detail"], str)- async def test_real_instructor_propagates_transport_error_raw(self, mocker: MockerFixture) -> None:- """End-to-end: drive the real instructor library with an SDK transport exception and- verify the W2.3 behavior — instructor, confined to schema re-ask, does NOT retry the- transport error and does NOT wrap it in ``InstructorRetryException``. It propagates as- the raw SDK exception, which the worker's ``except`` clause classifies as TRANSIENT.+ async def test_real_instructor_transport_error_is_unwrapped(self, mocker: MockerFixture) -> None:+ """End-to-end: drive the real instructor library with an SDK transport exception and verify+ that instructor, confined to schema re-ask, does not retry it: it raises an ``InstructorRetryException``+ from it after the one attempt, which the worker unwraps to classify the SDK exception as TRANSIENT."""import instructor # ruff: ignore[import-outside-top-level] # imported here to mirror runtime usage@@ -326,8 +325,10 @@ class TestAnthropicWorkerObjectErrorHandling:await worker._gen_object(llm_job=make_llm_job(mocker), schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT- # The raw SDK exception propagates and chains directly — instructor no longer wraps it.- assert exc_info.value.__cause__ is sdk_exc+ # instructor raises its InstructorRetryException from the SDK exception, which it did not retry+ wrapper_exc = exc_info.value.__cause__+ assert wrapper_exc is not None+ assert wrapper_exc.__cause__ is sdk_exc@pytest.mark.parametrize(("sdk_exc", "expected_category"),@@ -344,9 +345,9 @@ class TestAnthropicWorkerObjectErrorHandling:sdk_exc: Exception,expected_category: InferenceErrorCategory,) -> None:- """W2.3 regression: now that ``instructor`` no longer retries transport errors, a raw SDK- transport exception is the primary path out of ``create_with_completion`` — it must be- classified into the right category, never flattened to ``UNKNOWN``, never escape unhandled.+ """W2.3 regression: a raw SDK transport exception reaching the worker unwrapped, as it would if+ ``instructor`` stopped wrapping the exception that ends its loop, must be classified into the+ right category, never flattened to ``UNKNOWN``, never escape unhandled."""_patch_gen_object_dependencies(mocker)worker = _make_worker(mocker)diff --git a/tests/unit/pipelex/providers/google/test_google_llm_worker_object_error_handling.py b/tests/unit/pipelex/providers/google/test_google_llm_worker_object_error_handling.pyindex 6c4485101..06f2e68c3 100644--- a/tests/unit/pipelex/providers/google/test_google_llm_worker_object_error_handling.py+++ b/tests/unit/pipelex/providers/google/test_google_llm_worker_object_error_handling.py@@ -240,11 +240,10 @@ class TestGoogleLLMWorkerObjectErrorHandling:assert exc_info.value.user_action is not Noneassert exc_info.value.user_action.kind is UserActionKind.CONTACT_SUPPORT- async def test_real_instructor_propagates_client_error_raw(self, mocker: MockerFixture) -> None:- """End-to-end: drive the real instructor library with a ``ClientError`` and verify the- W2.3 behavior — instructor, confined to schema re-ask, does NOT retry the transport error- and does NOT wrap it in ``InstructorRetryException``. It propagates as the raw- ``ClientError``, which the worker classifies as TRANSIENT with provider metadata.+ async def test_real_instructor_client_error_is_unwrapped(self, mocker: MockerFixture) -> None:+ """End-to-end: drive the real instructor library with a ``ClientError`` and verify+ that instructor, confined to schema re-ask, does not retry it: it raises an ``InstructorRetryException``+ from it after the one attempt, which the worker unwraps to classify the SDK exception as TRANSIENT."""import instructor # ruff: ignore[import-outside-top-level]from google.genai import Client as GoogleGenAiClient # ruff: ignore[import-outside-top-level]@@ -278,8 +277,10 @@ class TestGoogleLLMWorkerObjectErrorHandling:assert metadata is not Noneassert metadata.provider == "google"assert metadata.status_code == 429- # The raw SDK exception propagates and chains directly — instructor no longer wraps it.- assert exc_info.value.__cause__ is sdk_exc+ # instructor raises its InstructorRetryException from the SDK exception, which it did not retry+ wrapper_exc = exc_info.value.__cause__+ assert wrapper_exc is not None+ assert wrapper_exc.__cause__ is sdk_exc@pytest.mark.parametrize(("sdk_exc", "expected_category"),diff --git a/tests/unit/pipelex/providers/google/test_google_llm_worker_structured_request.py b/tests/unit/pipelex/providers/google/test_google_llm_worker_structured_request.pynew file mode 100644index 000000000..33b67393a--- /dev/null+++ b/tests/unit/pipelex/providers/google/test_google_llm_worker_structured_request.py@@ -0,0 +1,138 @@+"""Tests for the request the Google LLM worker's structured generation actually sends.++``_gen_object`` goes through ``instructor``'s genai handlers, which build the Google ``GenerateContentConfig``+themselves from the kwargs they recognise and silently drop the rest. These tests drive the real+``from_genai`` client and capture what reaches ``generate_content``, so a system prompt, temperature or token+limit lost on the way fails here rather than in production.+"""++from __future__ import annotations++import json+from enum import StrEnum+from typing import TYPE_CHECKING, Any++import pytest+from google import genai+from google.genai import types as genai_types+from instructor import from_genai+from pydantic import BaseModel++if TYPE_CHECKING:+ from pytest_mock import MockerFixture++from pipelex.cogt.llm.structured_output import StructureMethod+from pipelex.providers.google.google_llm_worker import GoogleLLMWorker+from tests.helpers.instructor_test_utils import DummySchema, make_llm_job+++class _Color(StrEnum):+ RED = "red"+ BLUE = "blue"+++class _ColoredSchema(BaseModel):+ color: _Color+++def _make_response(*, structure_method: StructureMethod, schema_name: str, payload: dict[str, Any]) -> genai_types.GenerateContentResponse:+ match structure_method:+ case StructureMethod.INSTRUCTOR_GENAI_TOOLS:+ part = genai_types.Part(function_call=genai_types.FunctionCall(name=schema_name, args=payload))+ case StructureMethod.INSTRUCTOR_GENAI_STRUCTURED_OUTPUTS:+ part = genai_types.Part(text=json.dumps(payload))+ case _:+ msg = f"No Gemini response shape for {structure_method}"+ raise ValueError(msg)+ return genai_types.GenerateContentResponse(candidates=[genai_types.Candidate(content=genai_types.Content(role="model", parts=[part]))])+++def _make_worker(+ mocker: MockerFixture,+ *,+ structure_method: StructureMethod,+ captured: dict[str, Any],+ schema_name: str = DummySchema.__name__,+ payload: dict[str, Any] | None = None,+) -> GoogleLLMWorker:+ client = genai.Client(api_key="test-key")+ response_payload = payload or {"text": "ok"}++ def fake_generate_content(**kwargs: Any) -> genai_types.GenerateContentResponse:+ captured.update(kwargs)+ return _make_response(structure_method=structure_method, schema_name=schema_name, payload=response_payload)++ mocker.patch.object(client.aio.models, "generate_content", new_callable=mocker.AsyncMock, side_effect=fake_generate_content)++ worker = object.__new__(GoogleLLMWorker)+ mock_model = mocker.MagicMock()+ mock_model.desc = "test-model-desc"+ mock_model.model_id = "gemini-pro"+ mock_model.name = "gemini-pro"+ mock_model.thinking_mode = None+ worker.inference_model = mock_model+ worker.instructor_for_objects = from_genai(client=client, mode=structure_method.as_instructor_mode(), use_async=True)+ return worker++[email protected](loop_scope="class")+class TestGoogleLLMWorkerStructuredRequest:+ """``_gen_object`` must hand the prompt's system text and the job's generation controls to Google."""++ @pytest.mark.parametrize(+ "structure_method",+ [StructureMethod.INSTRUCTOR_GENAI_STRUCTURED_OUTPUTS, StructureMethod.INSTRUCTOR_GENAI_TOOLS],+ )+ async def test_request_config_carries_system_prompt_and_generation_controls(+ self,+ mocker: MockerFixture,+ structure_method: StructureMethod,+ ) -> None:+ captured: dict[str, Any] = {}+ worker = _make_worker(mocker, structure_method=structure_method, captured=captured)+ llm_job = make_llm_job(mocker)+ llm_job.job_params.temperature = 0.3+ llm_job.job_params.max_tokens = 123++ result = await worker._gen_object(llm_job=llm_job, schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]++ assert result.text == "ok"+ config = captured["config"]+ assert isinstance(config, genai_types.GenerateContentConfig)+ assert config.system_instruction == llm_job.llm_prompt.system_text+ assert config.temperature == 0.3+ assert config.max_output_tokens == 123+ assert config.candidate_count == 1++ async def test_request_without_system_text_or_token_limit_sends_none(self, mocker: MockerFixture) -> None:+ captured: dict[str, Any] = {}+ worker = _make_worker(mocker, structure_method=StructureMethod.INSTRUCTOR_GENAI_STRUCTURED_OUTPUTS, captured=captured)+ llm_job = make_llm_job(mocker)+ llm_job.llm_prompt.system_text = None++ await worker._gen_object(llm_job=llm_job, schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]++ config = captured["config"]+ assert not config.system_instruction+ assert config.temperature == 0.5+ assert config.max_output_tokens is None++ @pytest.mark.parametrize(+ "structure_method",+ [StructureMethod.INSTRUCTOR_GENAI_STRUCTURED_OUTPUTS, StructureMethod.INSTRUCTOR_GENAI_TOOLS],+ )+ async def test_an_enum_field_is_parsed_from_its_string_value(self, mocker: MockerFixture, structure_method: StructureMethod) -> None:+ """Gemini hands an enum back as its string value, under tool calling and JSON output alike."""+ worker = _make_worker(+ mocker,+ structure_method=structure_method,+ captured={},+ schema_name=_ColoredSchema.__name__,+ payload={"color": "red"},+ )+ llm_job = make_llm_job(mocker)+ llm_job.job_config.schema_reask_max_attempts = 1++ result = await worker._gen_object(llm_job=llm_job, schema=_ColoredSchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]++ assert result.color is _Color.REDdiff --git a/tests/unit/pipelex/providers/mistral/test_extract_mistral_metadata.py b/tests/unit/pipelex/providers/mistral/test_extract_mistral_metadata.pyindex b6c8544ef..15f143077 100644--- a/tests/unit/pipelex/providers/mistral/test_extract_mistral_metadata.py+++ b/tests/unit/pipelex/providers/mistral/test_extract_mistral_metadata.py@@ -14,8 +14,7 @@ payload. Mistral's exception hierarchy differs from OpenAI/Anthropic:from __future__ import annotationsimport httpx-from mistralai import MistralError-from mistralai.models import NoResponseError+from mistralai.client.errors import MistralError, NoResponseErrorfrom pipelex.cogt.inference.error_classification import extract_mistral_metadatadiff --git a/tests/unit/pipelex/providers/mistral/test_mistral_extract_worker_semantic.py b/tests/unit/pipelex/providers/mistral/test_mistral_extract_worker_semantic.pyindex 304656d00..03228f4ca 100644--- a/tests/unit/pipelex/providers/mistral/test_mistral_extract_worker_semantic.py+++ b/tests/unit/pipelex/providers/mistral/test_mistral_extract_worker_semantic.py@@ -6,12 +6,12 @@ from typing import TYPE_CHECKING, Anyimport httpximport pytest-from mistralai import MistralError+from mistralai.client.errors import MistralErrorif TYPE_CHECKING:from pytest_mock import MockerFixture-from pipelex.cogt.exceptions import ExtractJobFailureError, ExtractModelNotFoundError, InferenceErrorCategory+from pipelex.cogt.exceptions import ExtractCapabilityError, ExtractJobFailureError, ExtractModelNotFoundError, InferenceErrorCategoryfrom pipelex.cogt.inference.error_classification import UserActionKindfrom pipelex.providers.mistral.mistral_extract_worker import MistralExtractWorker@@ -36,6 +36,14 @@ def _make_worker(mocker: MockerFixture) -> MistralExtractWorker:return worker+def _make_job_params(mocker: MockerFixture, *, max_nb_images: int | None = None, image_min_size: int | None = None) -> Any:+ extract_job_params = mocker.MagicMock()+ extract_job_params.should_caption_images = False+ extract_job_params.max_nb_images = max_nb_images+ extract_job_params.image_min_size = image_min_size+ return extract_job_params++@pytest.mark.asyncio(loop_scope="class")class TestMistralExtractWorkerSemantic:"""Each MistralError branch carries semantic UserActionKind + provider_metadata."""@@ -76,7 +84,7 @@ class TestMistralExtractWorkerSemantic:)with pytest.raises(ExtractJobFailureError) as exc_info:- await worker._extract_page_from_image(image_uri="https://example.com/test.png") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]+ await worker._extract_page_from_image(image_uri="https://example.com/test.png", extract_job_params=_make_job_params(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]assert exc_info.value.error_category is expected_categoryassert exc_info.value.user_action is not None@@ -117,7 +125,7 @@ class TestMistralExtractWorkerSemantic:)with pytest.raises(ExtractJobFailureError) as exc_info:- await worker._extract_page_from_image(image_uri="https://example.com/test.png") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]+ await worker._extract_page_from_image(image_uri="https://example.com/test.png", extract_job_params=_make_job_params(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENTassert exc_info.value.user_action is not None@@ -180,7 +188,7 @@ class TestMistralExtractWorkerSemantic:)with pytest.raises(ExtractModelNotFoundError) as exc_info:- await worker._extract_page_from_image(image_uri="https://example.com/test.png") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]+ await worker._extract_page_from_image(image_uri="https://example.com/test.png", extract_job_params=_make_job_params(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATIONassert exc_info.value.user_action is not None@@ -189,3 +197,51 @@ class TestMistralExtractWorkerSemantic:assert exc_info.value.provider_metadata.provider == "mistral"assert exc_info.value.provider_metadata.status_code == 404assert exc_info.value.__cause__ is sdk_exc++ async def test_image_path_asks_for_the_figures_it_finds(self, mocker: MockerFixture) -> None:+ """OCR finds figures inside an image too, and returns them without pixels unless asked, which the response conversion refuses."""+ worker = _make_worker(mocker)+ cast_client: Any = worker.mistral_client+ mocker.patch(+ "pipelex.providers.mistral.mistral_extract_worker.MistralFactory.make_extract_output_from_mistral_response",+ return_value=mocker.sentinel.extract_output,+ )++ extract_output = await worker._extract_page_from_image( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]+ image_uri="https://example.com/test.png",+ extract_job_params=_make_job_params(mocker, max_nb_images=3, image_min_size=64),+ )++ assert extract_output is mocker.sentinel.extract_output+ request_kwargs = cast_client.ocr.process_async.call_args.kwargs+ assert request_kwargs["include_image_base64"] is True+ assert request_kwargs["image_limit"] == 3+ assert request_kwargs["image_min_size"] == 64++ @pytest.mark.parametrize(+ ("image_uri", "document_uri"),+ [+ ("https://example.com/test.png", None),+ (None, "https://example.com/doc.pdf"),+ ],+ )+ async def test_a_caption_request_is_refused_before_either_path_starts(+ self, mocker: MockerFixture, image_uri: str | None, document_uri: str | None+ ) -> None:+ """Mistral OCR writes no captions, so asking for them fails on an image as on a document, before anything is uploaded."""+ worker = _make_worker(mocker)+ make_image_chunk = mocker.patch("pipelex.providers.mistral.mistral_extract_worker.MistralFactory.make_mistral_image_url_chunk_from_uri")+ make_document_chunk = mocker.patch("pipelex.providers.mistral.mistral_extract_worker.MistralFactory.make_mistral_document_url_chunk_from_uri")+ extract_job = mocker.MagicMock()+ extract_job.extract_input.image_uri = image_uri+ extract_job.extract_input.document_uri = document_uri+ extract_job.job_params = _make_job_params(mocker)+ extract_job.job_params.should_caption_images = True++ with pytest.raises(ExtractCapabilityError, match="Captioning is not implemented for Mistral OCR"):+ await worker._extract_pages(extract_job=extract_job) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]++ make_image_chunk.assert_not_called()+ make_document_chunk.assert_not_called()+ cast_client: Any = worker.mistral_client+ cast_client.ocr.process_async.assert_not_called()diff --git a/tests/unit/pipelex/providers/mistral/test_mistral_factory_document_prep.py b/tests/unit/pipelex/providers/mistral/test_mistral_factory_document_prep.pyindex 78c0dc332..6447cdc08 100644--- a/tests/unit/pipelex/providers/mistral/test_mistral_factory_document_prep.py+++ b/tests/unit/pipelex/providers/mistral/test_mistral_factory_document_prep.py@@ -13,7 +13,7 @@ from pipelex.tools.uri.prepared_file import PreparedFileBase64, PreparedFileHttpif TYPE_CHECKING:from pathlib import Path- from mistralai import Mistral+ from mistralai.client import Mistralfrom pytest_mock import MockerFixturePNG_FILE_TYPE = FileType(extension="png", mime="image/png")diff --git a/tests/unit/pipelex/providers/mistral/test_mistral_factory_extract_output.py b/tests/unit/pipelex/providers/mistral/test_mistral_factory_extract_output.pyindex 657a56b9a..f97fa6287 100644--- a/tests/unit/pipelex/providers/mistral/test_mistral_factory_extract_output.py+++ b/tests/unit/pipelex/providers/mistral/test_mistral_factory_extract_output.py@@ -5,7 +5,7 @@ from __future__ import annotationsimport base64import pytest-from mistralai.models import OCRImageObject, OCRPageObject, OCRResponse, OCRUsageInfo+from mistralai.client.models import OCRImageObject, OCRPageObject, OCRResponse, OCRUsageInfofrom pipelex.providers.mistral.mistral_exceptions import MistralExtractResponseErrorfrom pipelex.providers.mistral.mistral_factory import MistralFactorydiff --git a/tests/unit/pipelex/providers/mistral/test_mistral_factory_messages.py b/tests/unit/pipelex/providers/mistral/test_mistral_factory_messages.pyindex 4421b82dc..0e7d209d7 100644--- a/tests/unit/pipelex/providers/mistral/test_mistral_factory_messages.py+++ b/tests/unit/pipelex/providers/mistral/test_mistral_factory_messages.py@@ -5,7 +5,7 @@ from __future__ import annotationsfrom typing import TYPE_CHECKING, Any, castimport pytest-from mistralai.models import DocumentURLChunk, ImageURLChunk, SystemMessage, TextChunk, UsageInfo, UserMessage+from mistralai.client.models import DocumentURLChunk, ImageURLChunk, SystemMessage, TextChunk, UsageInfo, UserMessagefrom pipelex.cogt.image.prompt_image import PromptImageDetailfrom pipelex.cogt.usage.token_category import TokenCategorydiff --git a/tests/unit/pipelex/providers/mistral/test_mistral_llm_worker_object_error_handling.py b/tests/unit/pipelex/providers/mistral/test_mistral_llm_worker_object_error_handling.pyindex 561698354..17b38f95c 100644--- a/tests/unit/pipelex/providers/mistral/test_mistral_llm_worker_object_error_handling.py+++ b/tests/unit/pipelex/providers/mistral/test_mistral_llm_worker_object_error_handling.py@@ -12,7 +12,8 @@ from typing import TYPE_CHECKINGimport httpximport pytest-from mistralai import Mistral, MistralError+from mistralai.client import Mistral+from mistralai.client.errors import MistralErrorif TYPE_CHECKING:from pytest_mock import MockerFixture@@ -225,11 +226,10 @@ class TestMistralLLMWorkerObjectErrorHandling:assert exc_info.value.user_action is not Noneassert exc_info.value.user_action.kind is UserActionKind.CONTACT_SUPPORT- async def test_real_instructor_propagates_transport_error_raw(self, mocker: MockerFixture) -> None:- """End-to-end: drive the real instructor library with a ``MistralError`` and verify the- W2.3 behavior — instructor, confined to schema re-ask, does NOT retry the transport error- and does NOT wrap it in ``InstructorRetryException``. It propagates as the raw- ``MistralError``, which the worker classifies as TRANSIENT with provider metadata.+ async def test_real_instructor_transport_error_is_unwrapped(self, mocker: MockerFixture) -> None:+ """End-to-end: drive the real instructor library with a ``MistralError`` and verify+ that instructor, confined to schema re-ask, does not retry it: it raises an ``InstructorRetryException``+ from it after the one attempt, which the worker unwraps to classify the SDK exception as TRANSIENT."""import instructor # ruff: ignore[import-outside-top-level]@@ -250,8 +250,10 @@ class TestMistralLLMWorkerObjectErrorHandling:assert metadata is not Noneassert metadata.provider == "mistral"assert metadata.status_code == 429- # The raw SDK exception propagates and chains directly — instructor no longer wraps it.- assert exc_info.value.__cause__ is sdk_exc+ # instructor raises its InstructorRetryException from the SDK exception, which it did not retry+ wrapper_exc = exc_info.value.__cause__+ assert wrapper_exc is not None+ assert wrapper_exc.__cause__ is sdk_exc@pytest.mark.parametrize(("sdk_exc", "expected_category"),diff --git a/tests/unit/pipelex/providers/mistral/test_mistral_reasoning.py b/tests/unit/pipelex/providers/mistral/test_mistral_reasoning.pyindex ecdaeeab1..972f7fae1 100644--- a/tests/unit/pipelex/providers/mistral/test_mistral_reasoning.py+++ b/tests/unit/pipelex/providers/mistral/test_mistral_reasoning.py@@ -101,7 +101,7 @@ class TestMistralReasoning:def test_no_reasoning_params_returns_unset(self, mocker: MockerFixture):"""When neither reasoning_effort nor reasoning_budget is set, returns UNSET."""- from mistralai.types import UNSET # ruff: ignore[import-outside-top-level]+ from mistralai.client.types import UNSET # ruff: ignore[import-outside-top-level]worker = _make_worker(mocker, thinking_mode=ThinkingMode.MANUAL)job_params = LLMJobParams(temperature=0.5)diff --git a/tests/unit/pipelex/providers/mistral/test_mistral_worker_error_handling.py b/tests/unit/pipelex/providers/mistral/test_mistral_worker_error_handling.pyindex c0f5726f8..c178d9878 100644--- a/tests/unit/pipelex/providers/mistral/test_mistral_worker_error_handling.py+++ b/tests/unit/pipelex/providers/mistral/test_mistral_worker_error_handling.py@@ -6,7 +6,7 @@ from typing import TYPE_CHECKING, Anyimport httpximport pytest-from mistralai import MistralError+from mistralai.client.errors import MistralErrorif TYPE_CHECKING:from pytest_mock import MockerFixture@@ -138,6 +138,20 @@ class TestMistralWorkerErrorHandling:assert exc_info.value.user_action.kind is UserActionKind.CHANGE_INPUTassert exc_info.value.__cause__ is sdk_exc+ async def test_llm_worker_choice_without_message_is_transient(self, mocker: MockerFixture) -> None:+ """A choice whose message is missing is retried as a transient failure, not read as empty text."""+ worker = _make_mistral_llm_worker(mocker)+ response = mocker.MagicMock()+ response.choices = [mocker.MagicMock(message=None)]+ worker.mistral_client_for_text.chat.complete_async.return_value = response # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]++ with pytest.raises(LLMCompletionError) as exc_info:+ await worker._gen_text(llm_job=_make_llm_job(mocker)) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]++ assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT+ assert exc_info.value.user_action is not None+ assert exc_info.value.user_action.kind is UserActionKind.WAIT_AND_RETRY+async def test_llm_worker_not_found_raises_llm_model_not_found_error(self, mocker: MockerFixture) -> None:"""A 404 MistralError specializes to LLMModelNotFoundError (CONFIGURATION) on the LLM path."""worker = _make_mistral_llm_worker(mocker)@@ -179,7 +193,10 @@ class TestMistralWorkerErrorHandling:)with pytest.raises(ExtractJobFailureError) as exc_info:- await worker._extract_page_from_image(image_uri="https://example.com/test.png") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]+ await worker._extract_page_from_image( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]+ image_uri="https://example.com/test.png",+ extract_job_params=mocker.MagicMock(max_nb_images=None, image_min_size=None),+ )assert exc_info.value.error_category is expected_categoryassert exc_info.value.__cause__ is sdk_exc@@ -199,7 +216,10 @@ class TestMistralWorkerErrorHandling:)with pytest.raises(ExtractModelNotFoundError) as exc_info:- await worker._extract_page_from_image(image_uri="https://example.com/test.png") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]+ await worker._extract_page_from_image( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]+ image_uri="https://example.com/test.png",+ extract_job_params=mocker.MagicMock(max_nb_images=None, image_min_size=None),+ )assert exc_info.value.error_category is InferenceErrorCategory.CONFIGURATIONassert exc_info.value.user_action is not None@@ -247,7 +267,10 @@ class TestMistralWorkerErrorHandling:)with pytest.raises(ExtractJobFailureError) as exc_info:- await worker._extract_page_from_image(image_uri="https://example.com/test.png") # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]+ await worker._extract_page_from_image( # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]+ image_uri="https://example.com/test.png",+ extract_job_params=mocker.MagicMock(max_nb_images=None, image_min_size=None),+ )report = exc_info.value.to_error_report()assert report.error_category == "configuration"diff --git a/tests/unit/pipelex/providers/openai/test_openai_completions_worker_object_error_handling.py b/tests/unit/pipelex/providers/openai/test_openai_completions_worker_object_error_handling.pyindex f776e781c..e707f7634 100644--- a/tests/unit/pipelex/providers/openai/test_openai_completions_worker_object_error_handling.py+++ b/tests/unit/pipelex/providers/openai/test_openai_completions_worker_object_error_handling.py@@ -248,11 +248,10 @@ class TestOpenAICompletionsWorkerObjectErrorHandling:assert exc_info.value.provider_metadata is not Noneassert exc_info.value.provider_metadata.sdk_exception_type == "ValueError"- async def test_real_instructor_propagates_transport_error_raw(self, mocker: MockerFixture) -> None:- """End-to-end: drive the real instructor library with an SDK transport exception and- verify the W2.3 behavior — instructor, confined to schema re-ask, does NOT retry the- transport error and does NOT wrap it in ``InstructorRetryException``. It propagates as- the raw SDK exception, which the worker classifies as TRANSIENT with provider metadata.+ async def test_real_instructor_transport_error_is_unwrapped(self, mocker: MockerFixture) -> None:+ """End-to-end: drive the real instructor library with an SDK transport exception and verify+ that instructor, confined to schema re-ask, does not retry it: it raises an ``InstructorRetryException``+ from it after the one attempt, which the worker unwraps to classify the SDK exception as TRANSIENT."""import instructor # ruff: ignore[import-outside-top-level] # imported here to mirror runtime usage@@ -273,8 +272,58 @@ class TestOpenAICompletionsWorkerObjectErrorHandling:assert metadata is not Noneassert metadata.provider == "openai"assert metadata.status_code == 429- # The raw SDK exception propagates and chains directly — instructor no longer wraps it.- assert exc_info.value.__cause__ is sdk_exc+ # instructor raises its InstructorRetryException from the SDK exception, which it did not retry+ wrapper_exc = exc_info.value.__cause__+ assert wrapper_exc is not None+ assert wrapper_exc.__cause__ is sdk_exc++ async def test_real_instructor_transport_error_after_a_reask_is_unwrapped(self, mocker: MockerFixture) -> None:+ """The first response fails the schema and is re-asked, then the re-ask fails in transport. The+ transport error ended the loop, so it is what the worker classifies, not the earlier parse failure+ that instructor keeps in ``failed_attempts``.+ """+ import instructor # ruff: ignore[import-outside-top-level] # imported here to mirror runtime usage+ from openai.types.chat import ChatCompletion # ruff: ignore[import-outside-top-level]++ worker = _make_worker(mocker)+ off_schema_completion = ChatCompletion.model_validate(+ {+ "id": "chatcmpl-off-schema",+ "object": "chat.completion",+ "created": 0,+ "model": "gpt-4o",+ "choices": [+ {+ "index": 0,+ "finish_reason": "tool_calls",+ "message": {+ "role": "assistant",+ "content": None,+ "tool_calls": [+ {"id": "call_1", "type": "function", "function": {"name": "DummySchema", "arguments": '{"wrong": 1}'}},+ ],+ },+ }+ ],+ }+ )+ sdk_exc = _make_openai_rate_limit_error("Rate limit exceeded — please retry")+ openai_client = openai.AsyncOpenAI(api_key="fake")+ create = mocker.AsyncMock(side_effect=[off_schema_completion, sdk_exc])+ openai_client.chat.completions.create = create # type: ignore[method-assign]+ worker.instructor_for_objects = instructor.from_openai(openai_client)+ llm_job = make_llm_job(mocker)+ llm_job.job_config.schema_reask_max_attempts = 3++ with pytest.raises(LLMCompletionError) as exc_info:+ await worker._gen_object(llm_job=llm_job, schema=DummySchema) # ruff: ignore[private-member-access] # pyright: ignore[reportPrivateUsage]++ assert create.call_count == 2+ assert exc_info.value.error_category is InferenceErrorCategory.TRANSIENT+ metadata = exc_info.value.provider_metadata+ assert metadata is not None+ assert metadata.status_code == 429+ assert metadata.sdk_exception_type == "RateLimitError"@pytest.mark.parametrize(("sdk_exc", "expected_category"),@@ -290,9 +339,9 @@ class TestOpenAICompletionsWorkerObjectErrorHandling:sdk_exc: Exception,expected_category: InferenceErrorCategory,) -> None:- """W2.3 regression: now that ``instructor`` no longer retries transport errors, a raw SDK- transport exception is the primary path out of ``create_with_completion`` — it must be- classified into the right category, never flattened to ``UNKNOWN``, never escape unhandled.+ """W2.3 regression: a raw SDK transport exception reaching the worker unwrapped, as it would if+ ``instructor`` stopped wrapping the exception that ends its loop, must be classified into the+ right category, never flattened to ``UNKNOWN``, never escape unhandled."""worker = _make_worker(mocker)worker.instructor_for_objects.chat.completions.create_with_completion.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]diff --git a/tests/unit/pipelex/providers/openai/test_openai_responses_worker_object_error_handling.py b/tests/unit/pipelex/providers/openai/test_openai_responses_worker_object_error_handling.pyindex 74c16fc45..37a539a48 100644--- a/tests/unit/pipelex/providers/openai/test_openai_responses_worker_object_error_handling.py+++ b/tests/unit/pipelex/providers/openai/test_openai_responses_worker_object_error_handling.py@@ -255,11 +255,10 @@ class TestOpenAIResponsesWorkerObjectErrorHandling:assert exc_info.value.provider_metadata is not Noneassert exc_info.value.provider_metadata.sdk_exception_type == "ValueError"- async def test_real_instructor_propagates_transport_error_raw(self, mocker: MockerFixture) -> None:- """End-to-end: drive the real instructor library (Responses adapter) with an SDK transport- exception and verify the W2.3 behavior — instructor, confined to schema re-ask, does NOT- retry the transport error and does NOT wrap it in ``InstructorRetryException``. It- propagates raw, and the worker classifies it as TRANSIENT with provider metadata.+ async def test_real_instructor_transport_error_is_unwrapped(self, mocker: MockerFixture) -> None:+ """End-to-end: drive the real instructor library with an SDK transport exception, through the Responses adapter, and verify+ that instructor, confined to schema re-ask, does not retry it: it raises an ``InstructorRetryException``+ from it after the one attempt, which the worker unwraps to classify the SDK exception as TRANSIENT."""import instructor # ruff: ignore[import-outside-top-level] # imported here to mirror runtime usage@@ -280,8 +279,10 @@ class TestOpenAIResponsesWorkerObjectErrorHandling:assert metadata is not Noneassert metadata.provider == "openai"assert metadata.status_code == 429- # The raw SDK exception propagates and chains directly — instructor no longer wraps it.- assert exc_info.value.__cause__ is sdk_exc+ # instructor raises its InstructorRetryException from the SDK exception, which it did not retry+ wrapper_exc = exc_info.value.__cause__+ assert wrapper_exc is not None+ assert wrapper_exc.__cause__ is sdk_exc@pytest.mark.parametrize(("sdk_exc", "expected_category"),@@ -297,9 +298,9 @@ class TestOpenAIResponsesWorkerObjectErrorHandling:sdk_exc: Exception,expected_category: InferenceErrorCategory,) -> None:- """W2.3 regression: now that ``instructor`` no longer retries transport errors, a raw SDK- transport exception is the primary path out of ``create_with_completion`` — it must be- classified into the right category, never flattened to ``UNKNOWN``, never escape unhandled.+ """W2.3 regression: a raw SDK transport exception reaching the worker unwrapped, as it would if+ ``instructor`` stopped wrapping the exception that ends its loop, must be classified into the+ right category, never flattened to ``UNKNOWN``, never escape unhandled."""worker = _make_worker(mocker)worker.instructor_for_objects.responses.create_with_completion.side_effect = sdk_exc # type: ignore[attr-defined] # pyright: ignore[reportAttributeAccessIssue]diff --git a/tests/unit/pipelex/providers/storage/test_storage_plugin.py b/tests/unit/pipelex/providers/storage/test_storage_plugin.pyindex 5b161d93c..0215661f5 100644--- a/tests/unit/pipelex/providers/storage/test_storage_plugin.py+++ b/tests/unit/pipelex/providers/storage/test_storage_plugin.py@@ -87,7 +87,7 @@ class TestStoragePlugin:sub_config_factory: Callable[[], Any],expected_type: type[StorageProviderAbstract],) -> None:- """Selecting a method through the registry constructs its provider (s3 needs no aioboto3 to build)."""+ """Selecting a method through the registry constructs its provider (s3 needs no aiobotocore to build)."""registry = _build_storage_registry()kwargs: dict[str, Any] = {"method": method, field_name: sub_config_factory()}provider = registry.get_required(method=method)(StorageProviderConfig(**kwargs))diff --git a/tests/unit/pipelex/providers/test_plugin_pipelex_storage_images.py b/tests/unit/pipelex/providers/test_plugin_pipelex_storage_images.pyindex 2fea03593..c0039d336 100644--- a/tests/unit/pipelex/providers/test_plugin_pipelex_storage_images.py+++ b/tests/unit/pipelex/providers/test_plugin_pipelex_storage_images.py@@ -6,7 +6,7 @@ These tests verify that all plugins can handle images stored via pipelex-storageimport pytestimport pytest_asynciofrom google.genai import types as genai_types-from mistralai.models import ImageURLChunk+from mistralai.client.models import ImageURLChunkfrom pytest_mock import MockerFixturefrom pipelex.cogt.image.prompt_image import PromptImageUridiff --git a/tests/unit/pipelex/providers/test_transport_retry_wiring.py b/tests/unit/pipelex/providers/test_transport_retry_wiring.pyindex 1b8f3bafc..6f4906071 100644--- a/tests/unit/pipelex/providers/test_transport_retry_wiring.py+++ b/tests/unit/pipelex/providers/test_transport_retry_wiring.py@@ -10,7 +10,7 @@ from __future__ import annotationsfrom typing import TYPE_CHECKING-from mistralai.utils import RetryConfig+from mistralai.client.utils import RetryConfigfrom pipelex.providers.anthropic.anthropic_factory import AnthropicFactoryfrom pipelex.providers.gateway.gateway_completions_factory import GatewayCompletionsFactorydiff --git a/tests/unit/pipelex/tools/storage/test_s3_storage_provider.py b/tests/unit/pipelex/tools/storage/test_s3_storage_provider.pyindex 229b63c22..37b982fcd 100644--- a/tests/unit/pipelex/tools/storage/test_s3_storage_provider.py+++ b/tests/unit/pipelex/tools/storage/test_s3_storage_provider.py@@ -15,11 +15,11 @@ S3_TEST_REGION = "us-east-1"@pytest.mark.asyncio(loop_scope="class")class TestS3StorageProvider:- """Unit tests for S3StorageProvider using mocks for aioboto3."""+ """Unit tests for S3StorageProvider using mocks for aiobotocore."""@pytest.fixture- def mock_aioboto3(self, mocker: MockerFixture) -> dict[str, Any]:- """Mock aioboto3 session and client.+ def mock_aiobotocore(self, mocker: MockerFixture) -> dict[str, Any]:+ """Mock the aiobotocore session and client.Returns a dict containing the mocked session, client, and response objectsfor test assertions.@@ -51,12 +51,13 @@ class TestS3StorageProvider:# Create mock sessionmock_session = mocker.MagicMock()- mock_session.client = mocker.MagicMock(return_value=mock_client_context)+ mock_session.create_client = mocker.MagicMock(return_value=mock_client_context)- # Patch aioboto3.Session- mocker.patch("aioboto3.Session", return_value=mock_session)+ # Patch the session factory the provider imports lazily+ mock_get_session = mocker.patch("aiobotocore.session.get_session", return_value=mock_session)return {+ "get_session": mock_get_session,"session": mock_session,"client": mock_client,"client_context": mock_client_context,@@ -85,7 +86,7 @@ class TestS3StorageProvider:async def test_store_returns_uri_with_scheme(self,s3_provider_no_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any], # ruff: ignore[unused-method-argument]+ mock_aiobotocore: dict[str, Any], # ruff: ignore[unused-method-argument]) -> None:"""Test that store() returns a URI with the pipelex-storage:// scheme prefix."""test_data = b"Hello, World!"@@ -99,7 +100,7 @@ class TestS3StorageProvider:async def test_store_calls_put_object(self,s3_provider_no_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any],+ mock_aiobotocore: dict[str, Any],) -> None:"""Test that store() correctly calls the S3 put_object method."""test_data = b"Test data"@@ -108,7 +109,7 @@ class TestS3StorageProvider:await s3_provider_no_signed_urls.store(data=test_data, key=key, content_type=content_type)- mock_aioboto3["client"].put_object.assert_called_once_with(+ mock_aiobotocore["client"].put_object.assert_called_once_with(Bucket=S3_TEST_BUCKET,Key=key,Body=test_data,@@ -119,11 +120,11 @@ class TestS3StorageProvider:self,mocker: MockerFixture,s3_provider_no_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any],+ mock_aiobotocore: dict[str, Any],) -> None:"""Test that load() returns the data from S3."""expected_data = b"Test data \x00\x01\x02\xff"- mock_aioboto3["stream"].read = mocker.AsyncMock(return_value=expected_data)+ mock_aiobotocore["stream"].read = mocker.AsyncMock(return_value=expected_data)uri = f"{PIPELEX_STORAGE_SCHEME}test/file.bin"loaded_data = await s3_provider_no_signed_urls.load(uri=uri)@@ -134,10 +135,10 @@ class TestS3StorageProvider:self,mocker: MockerFixture,s3_provider_no_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any],+ mock_aiobotocore: dict[str, Any],) -> None:"""Test that loading a non-existent object raises StorageFileNotFoundError."""- mock_aioboto3["client"].get_object = mocker.AsyncMock(side_effect=mock_aioboto3["exceptions"].NoSuchKey("Key not found"))+ mock_aiobotocore["client"].get_object = mocker.AsyncMock(side_effect=mock_aiobotocore["exceptions"].NoSuchKey("Key not found"))nonexistent_uri = f"{PIPELEX_STORAGE_SCHEME}nonexistent/file.bin"with pytest.raises(StorageFileNotFoundError) as exc_info:@@ -148,7 +149,7 @@ class TestS3StorageProvider:async def test_store_raises_if_key_has_scheme_prefix(self,s3_provider_no_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any], # ruff: ignore[unused-method-argument]+ mock_aiobotocore: dict[str, Any], # ruff: ignore[unused-method-argument]) -> None:"""Test that passing a key with pipelex-storage:// prefix raises an error."""invalid_key = f"{PIPELEX_STORAGE_SCHEME}already/prefixed.bin"@@ -161,7 +162,7 @@ class TestS3StorageProvider:async def test_public_url_returns_public_url_when_signed_urls_disabled(self,s3_provider_no_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any], # ruff: ignore[unused-method-argument]+ mock_aiobotocore: dict[str, Any], # ruff: ignore[unused-method-argument]) -> None:"""Test that public_url() returns a public URL when signed URLs are disabled."""key = "display/test.bin"@@ -176,44 +177,27 @@ class TestS3StorageProvider:self,mocker: MockerFixture,s3_provider_with_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any],+ mock_aiobotocore: dict[str, Any],) -> None:"""Test that public_url() returns a presigned URL when signed URLs are enabled."""key = "presigned/test.bin"uri = f"{PIPELEX_STORAGE_SCHEME}{key}"expected_presigned = "https://test-bucket.s3.amazonaws.com/presigned/test.bin?X-Amz-Signature=xyz"- mock_aioboto3["client"].generate_presigned_url = mocker.AsyncMock(return_value=expected_presigned)+ mock_aiobotocore["client"].generate_presigned_url = mocker.AsyncMock(return_value=expected_presigned)display = await s3_provider_with_signed_urls.public_url(uri=uri)assert display == expected_presigned- mock_aioboto3["client"].generate_presigned_url.assert_called_once_with(+ mock_aiobotocore["client"].generate_presigned_url.assert_called_once_with("get_object",Params={"Bucket": S3_TEST_BUCKET, "Key": key},ExpiresIn=3600,)- async def test_public_url_handles_sync_presigned_url(- self,- mocker: MockerFixture,- s3_provider_with_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any],- ) -> None:- """Test that public_url() handles sync presigned URL generation (non-awaitable)."""- key = "sync-presign/test.bin"- uri = f"{PIPELEX_STORAGE_SCHEME}{key}"- expected_presigned = "https://test-bucket.s3.amazonaws.com/sync-presign/test.bin?X-Amz-Signature=sync"- # Return a plain string (non-awaitable) to simulate sync behavior in some aioboto3 versions- mock_aioboto3["client"].generate_presigned_url = mocker.MagicMock(return_value=expected_presigned)-- display = await s3_provider_with_signed_urls.public_url(uri=uri)-- assert display == expected_presigned-async def test_store_with_nested_path(self,s3_provider_no_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any],+ mock_aiobotocore: dict[str, Any],) -> None:"""Test storing data in a deeply nested path structure."""test_data = b"nested content"@@ -222,12 +206,12 @@ class TestS3StorageProvider:returned_uri = await s3_provider_no_signed_urls.store(data=test_data, key=key)assert returned_uri == f"{PIPELEX_STORAGE_SCHEME}{key}"- mock_aioboto3["client"].put_object.assert_called_once()+ mock_aiobotocore["client"].put_object.assert_called_once()async def test_store_empty_bytes(self,s3_provider_no_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any],+ mock_aiobotocore: dict[str, Any],) -> None:"""Test storing empty bytes."""key = "empty.bin"@@ -235,7 +219,7 @@ class TestS3StorageProvider:returned_uri = await s3_provider_no_signed_urls.store(data=b"", key=key)assert returned_uri == f"{PIPELEX_STORAGE_SCHEME}{key}"- mock_aioboto3["client"].put_object.assert_called_once_with(+ mock_aiobotocore["client"].put_object.assert_called_once_with(Bucket=S3_TEST_BUCKET,Key=key,Body=b"",@@ -244,7 +228,7 @@ class TestS3StorageProvider:async def test_store_large_binary_data(self,s3_provider_no_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any],+ mock_aiobotocore: dict[str, Any],) -> None:"""Test storing larger binary data."""test_data = bytes(range(256)) * 1000 # ~256KB of data@@ -253,16 +237,16 @@ class TestS3StorageProvider:returned_uri = await s3_provider_no_signed_urls.store(data=test_data, key=key)assert returned_uri == f"{PIPELEX_STORAGE_SCHEME}{key}"- mock_aioboto3["client"].put_object.assert_called_once()+ mock_aiobotocore["client"].put_object.assert_called_once()async def test_store_bucket_not_found_raises_error(self,mocker: MockerFixture,s3_provider_no_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any],+ mock_aiobotocore: dict[str, Any],) -> None:"""Test that storing to a non-existent bucket raises StorageS3Error."""- mock_aioboto3["client"].put_object = mocker.AsyncMock(side_effect=mock_aioboto3["exceptions"].NoSuchBucket("Bucket not found"))+ mock_aiobotocore["client"].put_object = mocker.AsyncMock(side_effect=mock_aiobotocore["exceptions"].NoSuchBucket("Bucket not found"))with pytest.raises(StorageS3Error) as exc_info:await s3_provider_no_signed_urls.store(data=b"test", key="test.bin")@@ -273,10 +257,10 @@ class TestS3StorageProvider:self,mocker: MockerFixture,s3_provider_no_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any],+ mock_aiobotocore: dict[str, Any],) -> None:"""Test that loading from a non-existent bucket raises StorageS3Error."""- mock_aioboto3["client"].get_object = mocker.AsyncMock(side_effect=mock_aioboto3["exceptions"].NoSuchBucket("Bucket not found"))+ mock_aiobotocore["client"].get_object = mocker.AsyncMock(side_effect=mock_aiobotocore["exceptions"].NoSuchBucket("Bucket not found"))uri = f"{PIPELEX_STORAGE_SCHEME}test.bin"with pytest.raises(StorageS3Error) as exc_info:@@ -288,11 +272,11 @@ class TestS3StorageProvider:self,mocker: MockerFixture,s3_provider_no_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any],+ mock_aiobotocore: dict[str, Any],) -> None:"""Test that ClientError with NoSuchKey code raises StorageFileNotFoundError."""error_response: Any = {"Error": {"Code": "NoSuchKey", "Message": "The specified key does not exist."}}- mock_aioboto3["client"].get_object = mocker.AsyncMock(side_effect=ClientError(error_response, "GetObject"))+ mock_aiobotocore["client"].get_object = mocker.AsyncMock(side_effect=ClientError(error_response, "GetObject"))uri = f"{PIPELEX_STORAGE_SCHEME}missing/file.bin"with pytest.raises(StorageFileNotFoundError) as exc_info:@@ -304,11 +288,11 @@ class TestS3StorageProvider:self,mocker: MockerFixture,s3_provider_no_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any],+ mock_aiobotocore: dict[str, Any],) -> None:"""Test that ClientError with AccessDenied code raises StorageS3Error."""error_response: Any = {"Error": {"Code": "AccessDenied", "Message": "Access Denied"}}- mock_aioboto3["client"].get_object = mocker.AsyncMock(side_effect=ClientError(error_response, "GetObject"))+ mock_aiobotocore["client"].get_object = mocker.AsyncMock(side_effect=ClientError(error_response, "GetObject"))uri = f"{PIPELEX_STORAGE_SCHEME}forbidden/file.bin"with pytest.raises(StorageS3Error) as exc_info:@@ -320,11 +304,11 @@ class TestS3StorageProvider:self,mocker: MockerFixture,s3_provider_no_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any],+ mock_aiobotocore: dict[str, Any],) -> None:"""Test that ClientError during store raises StorageS3Error."""error_response: Any = {"Error": {"Code": "InvalidAccessKeyId", "Message": "Invalid access key"}}- mock_aioboto3["client"].put_object = mocker.AsyncMock(side_effect=ClientError(error_response, "PutObject"))+ mock_aiobotocore["client"].put_object = mocker.AsyncMock(side_effect=ClientError(error_response, "PutObject"))with pytest.raises(StorageS3Error) as exc_info:await s3_provider_no_signed_urls.store(data=b"test", key="test.bin")@@ -335,10 +319,10 @@ class TestS3StorageProvider:self,mocker: MockerFixture,s3_provider_no_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any],+ mock_aiobotocore: dict[str, Any],) -> None:"""Test that NoCredentialsError (a BotoCoreError subclass) raises StorageS3Error."""- mock_aioboto3["client"].get_object = mocker.AsyncMock(side_effect=NoCredentialsError())+ mock_aiobotocore["client"].get_object = mocker.AsyncMock(side_effect=NoCredentialsError())uri = f"{PIPELEX_STORAGE_SCHEME}test.bin"with pytest.raises(StorageS3Error) as exc_info:@@ -351,10 +335,10 @@ class TestS3StorageProvider:self,mocker: MockerFixture,s3_provider_no_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any],+ mock_aiobotocore: dict[str, Any],) -> None:"""Test that NoCredentialsError (a BotoCoreError subclass) during store raises StorageS3Error."""- mock_aioboto3["client"].put_object = mocker.AsyncMock(side_effect=NoCredentialsError())+ mock_aiobotocore["client"].put_object = mocker.AsyncMock(side_effect=NoCredentialsError())with pytest.raises(StorageS3Error) as exc_info:await s3_provider_no_signed_urls.store(data=b"test", key="test.bin")@@ -366,10 +350,10 @@ class TestS3StorageProvider:self,mocker: MockerFixture,s3_provider_no_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any],+ mock_aiobotocore: dict[str, Any],) -> None:"""Test that EndpointConnectionError (a BotoCoreError subclass) raises StorageS3Error."""- mock_aioboto3["client"].get_object = mocker.AsyncMock(side_effect=EndpointConnectionError(endpoint_url="https://s3.amazonaws.com"))+ mock_aiobotocore["client"].get_object = mocker.AsyncMock(side_effect=EndpointConnectionError(endpoint_url="https://s3.amazonaws.com"))uri = f"{PIPELEX_STORAGE_SCHEME}test.bin"with pytest.raises(StorageS3Error) as exc_info:@@ -382,10 +366,10 @@ class TestS3StorageProvider:self,mocker: MockerFixture,s3_provider_no_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any],+ mock_aiobotocore: dict[str, Any],) -> None:"""Test that ReadTimeoutError — the canonical transient-network BotoCoreError that used to escape — raises StorageS3Error."""- mock_aioboto3["client"].get_object = mocker.AsyncMock(side_effect=ReadTimeoutError(endpoint_url="https://s3.amazonaws.com"))+ mock_aiobotocore["client"].get_object = mocker.AsyncMock(side_effect=ReadTimeoutError(endpoint_url="https://s3.amazonaws.com"))uri = f"{PIPELEX_STORAGE_SCHEME}slow/file.bin"with pytest.raises(StorageS3Error) as exc_info:@@ -399,10 +383,10 @@ class TestS3StorageProvider:self,mocker: MockerFixture,s3_provider_no_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any],+ mock_aiobotocore: dict[str, Any],) -> None:"""Test that ReadTimeoutError during store (slow upload, transient blip) raises StorageS3Error."""- mock_aioboto3["client"].put_object = mocker.AsyncMock(side_effect=ReadTimeoutError(endpoint_url="https://s3.amazonaws.com"))+ mock_aiobotocore["client"].put_object = mocker.AsyncMock(side_effect=ReadTimeoutError(endpoint_url="https://s3.amazonaws.com"))with pytest.raises(StorageS3Error) as exc_info:await s3_provider_no_signed_urls.store(data=b"test", key="slow/upload.bin")@@ -415,12 +399,12 @@ class TestS3StorageProvider:self,mocker: MockerFixture,s3_provider_with_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any],+ mock_aiobotocore: dict[str, Any],) -> None:"""Test that public_url() falls back to public URL on a transport BotoCoreError, not just ClientError."""key = "fallback/timeout.bin"uri = f"{PIPELEX_STORAGE_SCHEME}{key}"- mock_aioboto3["client"].generate_presigned_url = mocker.MagicMock(side_effect=ReadTimeoutError(endpoint_url="https://s3.amazonaws.com"))+ mock_aiobotocore["client"].generate_presigned_url = mocker.AsyncMock(side_effect=ReadTimeoutError(endpoint_url="https://s3.amazonaws.com"))display = await s3_provider_with_signed_urls.public_url(uri=uri)@@ -431,24 +415,21 @@ class TestS3StorageProvider:self,mocker: MockerFixture,s3_provider_with_signed_urls: S3StorageProvider,- mock_aioboto3: dict[str, Any],+ mock_aiobotocore: dict[str, Any],) -> None:"""Test that public_url() falls back to public URL on botocore ClientError."""key = "fallback/test.bin"uri = f"{PIPELEX_STORAGE_SCHEME}{key}"error_response: Any = {"Error": {"Code": "SignatureDoesNotMatch", "Message": "Signature error"}}- mock_aioboto3["client"].generate_presigned_url = mocker.MagicMock(side_effect=ClientError(error_response, "GeneratePresignedUrl"))+ mock_aiobotocore["client"].generate_presigned_url = mocker.AsyncMock(side_effect=ClientError(error_response, "GeneratePresignedUrl"))display = await s3_provider_with_signed_urls.public_url(uri=uri)expected_public_url = f"https://{S3_TEST_BUCKET}.s3.{S3_TEST_REGION}.amazonaws.com/{key}"assert display == expected_public_url- @pytest.mark.usefixtures("mock_aioboto3")- async def test_session_is_reused(self) -> None:+ async def test_session_is_reused(self, mock_aiobotocore: dict[str, Any]) -> None:"""Test that the session is lazily initialized and reused."""- import aioboto3 # ruff: ignore[import-outside-top-level]-provider = S3StorageProvider(bucket_name=S3_TEST_BUCKET,region=S3_TEST_REGION,@@ -457,11 +438,11 @@ class TestS3StorageProvider:# First call initializes the sessionawait provider.store(data=b"data1", key="file1.bin")- first_call_count: int = aioboto3.Session.call_count # type: ignore[attr-defined] # pyright: ignore[reportUnknownMemberType,reportAttributeAccessIssue,reportUnknownVariableType]+ first_call_count: int = mock_aiobotocore["get_session"].call_count# Second call reuses the sessionawait provider.store(data=b"data2", key="file2.bin")- second_call_count: int = aioboto3.Session.call_count # type: ignore[attr-defined] # pyright: ignore[reportUnknownMemberType,reportAttributeAccessIssue,reportUnknownVariableType]+ second_call_count: int = mock_aiobotocore["get_session"].call_countassert first_call_count == 1assert second_call_count == 1 # Session should only be created oncediff --git a/tests/unit/pipelex/tools/test_log_json_trace_context.py b/tests/unit/pipelex/tools/test_log_json_trace_context.pyindex b07e80fac..7aa505e70 100644--- a/tests/unit/pipelex/tools/test_log_json_trace_context.py+++ b/tests/unit/pipelex/tools/test_log_json_trace_context.py@@ -89,7 +89,9 @@ class TestJsonSinkTraceContext:(line,) = _own_lines(buffer)assert line[TRACE_ID_KEY] == f"{span_context.trace_id:032x}"assert line[SPAN_ID_KEY] == f"{span_context.span_id:016x}"- assert line[TRACE_FLAGS_KEY] == "01"+ # The whole flags byte: the SDK sets W3C Trace Context Level 2's random bit beside the sampled one+ assert line[TRACE_FLAGS_KEY] == f"{span_context.trace_flags:02x}"+ assert int(line[TRACE_FLAGS_KEY], 16) & TraceFlags.SAMPLEDassert re.fullmatch(r"[0-9a-f]{32}", line[TRACE_ID_KEY])assert re.fullmatch(r"[0-9a-f]{16}", line[SPAN_ID_KEY])@@ -105,7 +107,7 @@ class TestJsonSinkTraceContext:(line,) = _own_lines(buffer)assert line[TRACE_ID_KEY] == f"{host_context.trace_id:032x}"assert line[SPAN_ID_KEY] == f"{host_context.span_id:016x}"- assert line[TRACE_FLAGS_KEY] == "01"+ assert line[TRACE_FLAGS_KEY] == f"{host_context.trace_flags:02x}"assert line[PIPELEX_TRACE_ID_KEY] == f"{pipelex_context.trace_id:032x}"assert line[PIPELEX_SPAN_ID_KEY] == f"{pipelex_context.span_id:016x}"assert line[PIPELEX_TRACE_ID_KEY] != line[TRACE_ID_KEY]diff --git a/tests/unit/pipelex/tools/test_log_otlp_sink.py b/tests/unit/pipelex/tools/test_log_otlp_sink.pyindex 1375928ef..4fde2d3db 100644--- a/tests/unit/pipelex/tools/test_log_otlp_sink.py+++ b/tests/unit/pipelex/tools/test_log_otlp_sink.py@@ -13,7 +13,7 @@ from typing import TYPE_CHECKING, Anyimport pytestfrom opentelemetry._logs import SeverityNumberfrom opentelemetry.context import _SUPPRESS_INSTRUMENTATION_KEY, attach, detach, set_value # pyright: ignore[reportPrivateUsage]-from opentelemetry.sdk._logs.export import InMemoryLogExporter, SimpleLogRecordProcessor+from opentelemetry.sdk._logs.export import InMemoryLogRecordExporter, SimpleLogRecordProcessorfrom opentelemetry.semconv._incubating.attributes import code_attributesfrom opentelemetry.semconv.attributes import exception_attributes@@ -28,7 +28,7 @@ from pipelex.tools.misc.toml_utils import load_toml_from_pathif TYPE_CHECKING:from collections.abc import Iterator- from opentelemetry.sdk._logs import LogData+ from opentelemetry.sdk._logs import ReadableLogRecordfrom pytest_mock import MockerFixture@@ -38,12 +38,18 @@ def _package_log_config(*, is_redaction_enabled: bool = True) -> LogConfig:return LogConfig.model_validate({**config_dict["runtime"]["log"], "redaction": redaction})-def _own_logs(exporter: InMemoryLogExporter) -> list[LogData]:+def _scope_name(log_data: ReadableLogRecord) -> str:+ scope = log_data.instrumentation_scope+ assert scope is not None+ return scope.name+++def _own_logs(exporter: InMemoryLogRecordExporter) -> list[ReadableLogRecord]:"""The records this module emitted, whatever else the process logged meanwhile."""- return [log_data for log_data in exporter.get_finished_logs() if log_data.instrumentation_scope.name == __name__]+ return [log_data for log_data in exporter.get_finished_logs() if _scope_name(log_data) == __name__]-def _attributes(log_data: LogData) -> dict[str, Any]:+def _attributes(log_data: ReadableLogRecord) -> dict[str, Any]:attributes = log_data.log_record.attributesassert attributes is not Nonereturn dict(attributes)@@ -51,12 +57,12 @@ def _attributes(log_data: LogData) -> dict[str, Any]:class TestOtlpLogSink:@pytest.fixture- def otlp_log(self, caplog: pytest.LogCaptureFixture) -> Iterator[tuple[Log, InMemoryLogExporter]]:+ def otlp_log(self, caplog: pytest.LogCaptureFixture) -> Iterator[tuple[Log, InMemoryLogRecordExporter]]:# pytest's ``log_level`` option restores the root logger's level at every phase boundary, undoing the# level ``configure`` sets from inside a fixture; the module's own logger is enabled explicitly and# ``caplog`` restores it at teardown.caplog.set_level(logging.INFO, logger=__name__)- exporter = InMemoryLogExporter()+ exporter = InMemoryLogRecordExporter()fresh = Log()fresh.configure(log_config=_package_log_config())fresh.install_sink(OtlpLogSink(processor=SimpleLogRecordProcessor(exporter)))@@ -65,7 +71,9 @@ class TestOtlpLogSink:finally:fresh.reset()- def test_a_record_reaches_the_exporter_with_the_fields_and_the_context_as_attributes(self, otlp_log: tuple[Log, InMemoryLogExporter]) -> None:+ def test_a_record_reaches_the_exporter_with_the_fields_and_the_context_as_attributes(+ self, otlp_log: tuple[Log, InMemoryLogRecordExporter]+ ) -> None:fresh, exporter = otlp_logwith fresh.context(request_id="r1", pipe_run_id="pr1"):fresh.info("scanned", fields={"files": 7, "ratio": 0.5, "tags": ["a", "b"], "meta": {"k": "v"}})@@ -87,14 +95,14 @@ class TestOtlpLogSink:assert attributes[code_attributes.CODE_FUNCTION_NAME] == "test_a_record_reaches_the_exporter_with_the_fields_and_the_context_as_attributes"assert attributes[code_attributes.CODE_LINE_NUMBER] > 0- def test_structured_content_rides_as_json_text_in_the_data_attribute(self, otlp_log: tuple[Log, InMemoryLogExporter]) -> None:+ def test_structured_content_rides_as_json_text_in_the_data_attribute(self, otlp_log: tuple[Log, InMemoryLogRecordExporter]) -> None:fresh, exporter = otlp_logfresh.info({"key": "value", "nested": {"flag": True}}, title="Config")(log_data,) = _own_logs(exporter)assert _attributes(log_data)["data"] == '{"key": "value", "nested": {"flag": true}}'- def test_the_exception_lands_under_the_semantic_convention_keys(self, otlp_log: tuple[Log, InMemoryLogExporter]) -> None:+ def test_the_exception_lands_under_the_semantic_convention_keys(self, otlp_log: tuple[Log, InMemoryLogRecordExporter]) -> None:fresh, exporter = otlp_logtry:msg = "boom"@@ -111,7 +119,9 @@ class TestOtlpLogSink:assert "Traceback (most recent call last)" in attributes[exception_attributes.EXCEPTION_STACKTRACE]assert attributes[exception_attributes.EXCEPTION_STACKTRACE].rstrip().endswith("ValueError: boom")- def test_the_stacktrace_is_the_scrubbed_text_and_no_message_attribute_carries_the_secret(self, otlp_log: tuple[Log, InMemoryLogExporter]) -> None:+ def test_the_stacktrace_is_the_scrubbed_text_and_no_message_attribute_carries_the_secret(+ self, otlp_log: tuple[Log, InMemoryLogRecordExporter]+ ) -> None:"""The message attribute would be ``str(exc_value)``, which no sink can scrub; the type and the stacktrace's last line carry what it said."""fresh, exporter = otlp_logtry:@@ -129,7 +139,7 @@ class TestOtlpLogSink:def test_an_exception_that_carries_no_traceback_still_exports_its_own_text(self, caplog: pytest.LogCaptureFixture) -> None:"""``exc_text`` is the processor's rendering; with redaction off there is none and the stacktrace is the only place the text goes."""caplog.set_level(logging.INFO, logger=__name__)- exporter = InMemoryLogExporter()+ exporter = InMemoryLogRecordExporter()fresh = Log()fresh.configure(log_config=_package_log_config(is_redaction_enabled=False))fresh.install_sink(OtlpLogSink(processor=SimpleLogRecordProcessor(exporter)))@@ -144,7 +154,7 @@ class TestOtlpLogSink:finally:fresh.reset()- def test_the_semantic_convention_keys_are_reserved_with_or_without_an_exception(self, otlp_log: tuple[Log, InMemoryLogExporter]) -> None:+ def test_the_semantic_convention_keys_are_reserved_with_or_without_an_exception(self, otlp_log: tuple[Log, InMemoryLogRecordExporter]) -> None:"""The sink writes these keys itself, so a field named like one is prefixed rather than overwritten.Reserved whether or not the record carries an exception, exactly as the json sink reserves its own@@ -196,7 +206,7 @@ class TestOtlpLogSink:)def test_every_level_maps_onto_the_otel_severity_scale(self,- otlp_log: tuple[Log, InMemoryLogExporter],+ otlp_log: tuple[Log, InMemoryLogRecordExporter],caplog: pytest.LogCaptureFixture,method_name: str,severity_text: str,@@ -210,16 +220,16 @@ class TestOtlpLogSink:assert log_data.log_record.severity_text == severity_textassert log_data.log_record.severity_number is severity_number- def test_a_record_from_the_opentelemetry_sdk_itself_is_not_exported(self, otlp_log: tuple[Log, InMemoryLogExporter]) -> None:+ def test_a_record_from_the_opentelemetry_sdk_itself_is_not_exported(self, otlp_log: tuple[Log, InMemoryLogRecordExporter]) -> None:"""An exporter's own failure line must not re-enter the pipeline that failed."""_, exporter = otlp_loglogging.getLogger("opentelemetry.exporter.otlp").error("Failed to export logs batch")logging.getLogger("opentelemetry").warning("dropped")- scopes = {log_data.instrumentation_scope.name for log_data in exporter.get_finished_logs()}+ scopes = {_scope_name(log_data) for log_data in exporter.get_finished_logs()}assert not any(scope == "opentelemetry" or scope.startswith("opentelemetry.") for scope in scopes)- def test_the_sdks_own_record_is_rejected_before_the_handler_lock_is_taken(self, otlp_log: tuple[Log, InMemoryLogExporter]) -> None:+ def test_the_sdks_own_record_is_rejected_before_the_handler_lock_is_taken(self, otlp_log: tuple[Log, InMemoryLogRecordExporter]) -> None:"""At exit the stdlib's shutdown holds this lock while it flushes, and an exporting thread reporting its failure must not wait on it."""fresh, _ = otlp_logassert fresh.sink is not None@@ -253,7 +263,9 @@ class TestOtlpLogSink:let_go.set()holder.join()- def test_a_record_emitted_during_an_export_is_rejected_whatever_its_logger_is_called(self, otlp_log: tuple[Log, InMemoryLogExporter]) -> None:+ def test_a_record_emitted_during_an_export_is_rejected_whatever_its_logger_is_called(+ self, otlp_log: tuple[Log, InMemoryLogRecordExporter]+ ) -> None:"""The SDK sets a context value around ``exporter.export``; the transport logs under it, and the sink reads it. A private key, pinned here."""fresh, exporter = otlp_logtoken = attach(set_value(_SUPPRESS_INSTRUMENTATION_KEY, True))@@ -264,12 +276,10 @@ class TestOtlpLogSink:detach(token)fresh.info("mine, after the export")- assert [- log_data.log_record.body for log_data in exporter.get_finished_logs() if log_data.instrumentation_scope.name.startswith("urllib3")- ] == []+ assert [log_data.log_record.body for log_data in exporter.get_finished_logs() if _scope_name(log_data).startswith("urllib3")] == []assert [log_data.log_record.body for log_data in _own_logs(exporter)] == ["mine, after the export"]- def test_a_mixed_type_sequence_rides_as_json_text_rather_than_being_dropped(self, otlp_log: tuple[Log, InMemoryLogExporter]) -> None:+ def test_a_mixed_type_sequence_rides_as_json_text_rather_than_being_dropped(self, otlp_log: tuple[Log, InMemoryLogRecordExporter]) -> None:"""The SDK keeps a sequence of one scalar type, compared by type equality, and drops the rest to ``None``."""fresh, exporter = otlp_logfresh.info("sequences", fields={"mixed": [1, "foo"], "int_bool": [1, True], "homogeneous": ["a", "b"], "empty": []})@@ -281,7 +291,7 @@ class TestOtlpLogSink:assert list(attributes["homogeneous"]) == ["a", "b"]assert list(attributes["empty"]) == []- def test_flush_hands_the_provider_a_deadline(self, otlp_log: tuple[Log, InMemoryLogExporter], mocker: MockerFixture) -> None:+ def test_flush_hands_the_provider_a_deadline(self, otlp_log: tuple[Log, InMemoryLogRecordExporter], mocker: MockerFixture) -> None:fresh, _ = otlp_logsink = fresh.sinkassert isinstance(sink, OtlpLogSink)@@ -293,7 +303,7 @@ class TestOtlpLogSink:def test_the_same_sink_installed_again_after_a_reset_is_refused_rather_than_exporting_nothing(self) -> None:"""The teardown shuts the provider and the processor down, which nothing starts again, so a second install must say so."""- exporter = InMemoryLogExporter()+ exporter = InMemoryLogRecordExporter()sink = OtlpLogSink(processor=SimpleLogRecordProcessor(exporter))fresh = Log()fresh.configure(log_config=_package_log_config())diff --git a/tests/unit/pipelex/tools/test_log_otlp_trace_context.py b/tests/unit/pipelex/tools/test_log_otlp_trace_context.pyindex 990afcd8d..cdff137d9 100644--- a/tests/unit/pipelex/tools/test_log_otlp_trace_context.py+++ b/tests/unit/pipelex/tools/test_log_otlp_trace_context.py@@ -14,7 +14,7 @@ import loggingfrom typing import TYPE_CHECKINGimport pytest-from opentelemetry.sdk._logs.export import InMemoryLogExporter, SimpleLogRecordProcessor+from opentelemetry.sdk._logs.export import InMemoryLogRecordExporter, SimpleLogRecordProcessorfrom opentelemetry.sdk.trace import TracerProviderfrom opentelemetry.trace import INVALID_SPAN_ID, INVALID_TRACE_ID@@ -29,7 +29,7 @@ from pipelex.tools.misc.toml_utils import load_toml_from_pathif TYPE_CHECKING:from collections.abc import Iterator- from opentelemetry.sdk._logs import LogRecord+ from opentelemetry._logs import LogRecordPIPELEX_TRACE_KEYS: tuple[str, ...] = (PIPELEX_TRACE_ID_KEY, PIPELEX_SPAN_ID_KEY)@@ -39,9 +39,13 @@ def _package_log_config() -> LogConfig:return LogConfig.model_validate(config_dict["runtime"]["log"])-def _own_records(exporter: InMemoryLogExporter) -> list[LogRecord]:+def _own_records(exporter: InMemoryLogRecordExporter) -> list[LogRecord]:"""The records this module emitted, whatever else the process logged meanwhile."""- return [log_data.log_record for log_data in exporter.get_finished_logs() if log_data.instrumentation_scope.name == __name__]+ return [+ log_data.log_record+ for log_data in exporter.get_finished_logs()+ if log_data.instrumentation_scope is not None and log_data.instrumentation_scope.name == __name__+ ]def _attributes(record: LogRecord) -> dict[str, object]:@@ -50,10 +54,10 @@ def _attributes(record: LogRecord) -> dict[str, object]:class TestOtlpSinkTraceContext:@pytest.fixture- def otlp_log(self, caplog: pytest.LogCaptureFixture) -> Iterator[tuple[Log, InMemoryLogExporter]]:+ def otlp_log(self, caplog: pytest.LogCaptureFixture) -> Iterator[tuple[Log, InMemoryLogRecordExporter]]:"""A fresh ``Log`` with the otlp sink installed on an in-memory exporter, torn down so the root logger is left as found."""caplog.set_level(logging.INFO, logger=__name__)- exporter = InMemoryLogExporter()+ exporter = InMemoryLogRecordExporter()fresh = Log()fresh.configure(log_config=_package_log_config())fresh.install_sink(OtlpLogSink(processor=SimpleLogRecordProcessor(exporter)))@@ -63,7 +67,7 @@ class TestOtlpSinkTraceContext:fresh.reset()def test_a_record_outside_a_run_under_a_host_span_is_filed_under_it_with_no_pipelex_attributes(- self, otlp_log: tuple[Log, InMemoryLogExporter]+ self, otlp_log: tuple[Log, InMemoryLogRecordExporter]) -> None:fresh, exporter = otlp_logtracer = TracerProvider().get_tracer(__name__)@@ -78,7 +82,7 @@ class TestOtlpSinkTraceContext:assert not set(PIPELEX_TRACE_KEYS) & set(_attributes(inside))def test_a_record_in_a_run_under_a_host_span_is_filed_under_the_host_span_and_names_the_pipelex_one(- self, otlp_log: tuple[Log, InMemoryLogExporter]+ self, otlp_log: tuple[Log, InMemoryLogRecordExporter]) -> None:fresh, exporter = otlp_logtracer = TracerProvider().get_tracer(__name__)@@ -97,7 +101,7 @@ class TestOtlpSinkTraceContext:assert attributes[PIPELEX_SPAN_ID_KEY] == f"{pipelex_context.span_id:016x}"def test_a_record_in_a_run_with_no_host_span_is_filed_under_none_and_names_the_pipelex_span(- self, otlp_log: tuple[Log, InMemoryLogExporter]+ self, otlp_log: tuple[Log, InMemoryLogRecordExporter]) -> None:fresh, exporter = otlp_logpipelex_span = TracerProvider().get_tracer(__name__).start_span("pipe")@@ -112,7 +116,7 @@ class TestOtlpSinkTraceContext:assert attributes[PIPELEX_TRACE_ID_KEY] == f"{pipelex_context.trace_id:032x}"assert attributes[PIPELEX_SPAN_ID_KEY] == f"{pipelex_context.span_id:016x}"- def test_a_record_outside_any_span_carries_neither(self, otlp_log: tuple[Log, InMemoryLogExporter]) -> None:+ def test_a_record_outside_any_span_carries_neither(self, otlp_log: tuple[Log, InMemoryLogRecordExporter]) -> None:fresh, exporter = otlp_logfresh.info("outside")@@ -121,7 +125,7 @@ class TestOtlpSinkTraceContext:assert outside.span_id == INVALID_SPAN_IDassert not set(PIPELEX_TRACE_KEYS) & set(_attributes(outside))- def test_the_pipelex_keys_are_reserved_with_or_without_a_pipelex_span(self, otlp_log: tuple[Log, InMemoryLogExporter]) -> None:+ def test_the_pipelex_keys_are_reserved_with_or_without_a_pipelex_span(self, otlp_log: tuple[Log, InMemoryLogRecordExporter]) -> None:"""A field named like a ``pipelex.*`` key is prefixed on every record, so its wire name never depends on a span being held."""fresh, exporter = otlp_logsupplied = dict.fromkeys(PIPELEX_TRACE_KEYS, "supplied")@@ -139,7 +143,7 @@ class TestOtlpSinkTraceContext:def test_a_boot_line_held_until_the_sink_arrives_keeps_the_spans_it_was_logged_in(self, caplog: pytest.LogCaptureFixture) -> None:"""The holding handler replays each record in the context it was emitted in, not in the one the install runs under."""caplog.set_level(logging.INFO, logger=__name__)- exporter = InMemoryLogExporter()+ exporter = InMemoryLogRecordExporter()fresh = Log()fresh.configure(log_config=_package_log_config())tracer = TracerProvider().get_tracer(__name__)diff --git a/uv.lock b/uv.lockindex 6d9470e34..73e3de31f 100644--- a/uv.lock+++ b/uv.lock@@ -38,22 +38,9 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/7e/46/02ac5e262d4af18054b3e922b2baedbb2a03289ee792162de60a865defc5/accelerate-1.13.0-py3-none-any.whl", hash = "sha256:cf1a3efb96c18f7b152eb0fa7490f3710b19c3f395699358f08decca2b8b62e0", size = 383744, upload-time = "2026-03-04T19:34:10.313Z" },]-[[package]]-name = "aioboto3"-version = "15.5.0"-source = { registry = "https://pypi.org/simple" }-dependencies = [- { name = "aiobotocore", extra = ["boto3"] },- { name = "aiofiles" },-]-sdist = { url = "https://files.pythonhosted.org/packages/a2/01/92e9ab00f36e2899315f49eefcd5b4685fbb19016c7f19a9edf06da80bb0/aioboto3-15.5.0.tar.gz", hash = "sha256:ea8d8787d315594842fbfcf2c4dce3bac2ad61be275bc8584b2ce9a3402a6979", size = 255069, upload-time = "2025-10-30T13:37:16.122Z" }-wheels = [- { url = "https://files.pythonhosted.org/packages/e5/3e/e8f5b665bca646d43b916763c901e00a07e40f7746c9128bdc912a089424/aioboto3-15.5.0-py3-none-any.whl", hash = "sha256:cc880c4d6a8481dd7e05da89f41c384dbd841454fc1998ae25ca9c39201437a6", size = 35913, upload-time = "2025-10-30T13:37:14.549Z" },-]-[[package]]name = "aiobotocore"-version = "2.25.1"+version = "3.9.1"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "aiohttp" },@@ -64,14 +51,9 @@ dependencies = [{ name = "python-dateutil" },{ name = "wrapt" },]-sdist = { url = "https://files.pythonhosted.org/packages/62/94/2e4ec48cf1abb89971cb2612d86f979a6240520f0a659b53a43116d344dc/aiobotocore-2.25.1.tar.gz", hash = "sha256:ea9be739bfd7ece8864f072ec99bb9ed5c7e78ebb2b0b15f29781fbe02daedbc", size = 120560, upload-time = "2025-10-28T22:33:21.787Z" }+sdist = { url = "https://files.pythonhosted.org/packages/a4/0d/98230a1320e78f2c35277ca194c494690dce3161ad05200556417ab9e816/aiobotocore-3.9.1.tar.gz", hash = "sha256:617d4a78da5adb6ae7d532835727ad388f73555f2ef129b9de1b1add73a43ee6", size = 516440, upload-time = "2026-09-07T17:14:07.099Z" }wheels = [- { url = "https://files.pythonhosted.org/packages/95/2a/d275ec4ce5cd0096665043995a7d76f5d0524853c76a3d04656de49f8808/aiobotocore-2.25.1-py3-none-any.whl", hash = "sha256:eb6daebe3cbef5b39a0bb2a97cffbe9c7cb46b2fcc399ad141f369f3c2134b1f", size = 86039, upload-time = "2025-10-28T22:33:19.949Z" },-]--[package.optional-dependencies]-boto3 = [- { name = "boto3" },+ { url = "https://files.pythonhosted.org/packages/13/f5/20b5c946fdcfafa8e0538d4d278abf10dda4b4012f29aa98a32fe09a46c5/aiobotocore-3.9.1-py3-none-any.whl", hash = "sha256:23aa448b4daff3fdce0714c962a2050b63c0222b5f2b5c17d0c874eb76a50ac0", size = 102044, upload-time = "2026-09-07T17:14:05.224Z" },][[package]]@@ -407,16 +389,16 @@ wheels = [[[package]]name = "boto3"-version = "1.40.61"+version = "1.43.75"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "botocore" },{ name = "jmespath" },{ name = "s3transfer" },]-sdist = { url = "https://files.pythonhosted.org/packages/ed/f9/6ef8feb52c3cce5ec3967a535a6114b57ac7949fd166b0f3090c2b06e4e5/boto3-1.40.61.tar.gz", hash = "sha256:d6c56277251adf6c2bdd25249feae625abe4966831676689ff23b4694dea5b12", size = 111535, upload-time = "2025-10-28T19:26:57.247Z" }+sdist = { url = "https://files.pythonhosted.org/packages/b1/dd/b93be617dd5d1c6a3a248066030a450e62d211c0af0f49ed3a0d761383c9/boto3-1.43.75.tar.gz", hash = "sha256:86da93d3d5b46a58b03fa51b598ffa4aeaff485a3000affacf78491c105e44f0", size = 112673, upload-time = "2026-08-19T19:54:17.236Z" }wheels = [- { url = "https://files.pythonhosted.org/packages/61/24/3bf865b07d15fea85b63504856e137029b6acbc73762496064219cdb265d/boto3-1.40.61-py3-none-any.whl", hash = "sha256:6b9c57b2a922b5d8c17766e29ed792586a818098efe84def27c8f582b33f898c", size = 139321, upload-time = "2025-10-28T19:26:55.007Z" },+ { url = "https://files.pythonhosted.org/packages/52/89/d0baf1269e57ac548387c11e5d9ba78d1e118ceb43f1e5e5114bdd2e8391/boto3-1.43.75-py3-none-any.whl", hash = "sha256:08a79edb68e6a0d65d305eb90188639313650e155aed015e86eef59d8475dde0", size = 140026, upload-time = "2026-08-19T19:54:15.509Z" },][[package]]@@ -435,16 +417,16 @@ wheels = [[[package]]name = "botocore"-version = "1.40.61"+version = "1.43.75"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "jmespath" },{ name = "python-dateutil" },{ name = "urllib3" },]-sdist = { url = "https://files.pythonhosted.org/packages/28/a3/81d3a47c2dbfd76f185d3b894f2ad01a75096c006a2dd91f237dca182188/botocore-1.40.61.tar.gz", hash = "sha256:a2487ad69b090f9cccd64cf07c7021cd80ee9c0655ad974f87045b02f3ef52cd", size = 14393956, upload-time = "2025-10-28T19:26:46.108Z" }+sdist = { url = "https://files.pythonhosted.org/packages/a3/80/5e39eda5dfb66df691d71212799a9f9d35aa9e447511604030447a00e9d6/botocore-1.43.75.tar.gz", hash = "sha256:e8ed6b0f3cd398dfb9e08d7ca3a0b964152166a317a04e89c45ec91003327ffe", size = 15973868, upload-time = "2026-08-19T19:54:12.318Z" }wheels = [- { url = "https://files.pythonhosted.org/packages/38/c5/f6ce561004db45f0b847c2cd9b19c67c6bf348a82018a48cb718be6b58b0/botocore-1.40.61-py3-none-any.whl", hash = "sha256:17ebae412692fd4824f99cde0f08d50126dc97954008e5ba2b522eb049238aa7", size = 14055973, upload-time = "2025-10-28T19:26:42.15Z" },+ { url = "https://files.pythonhosted.org/packages/94/46/19d3178e70f37fda251f3d9560f29654f09c6eedbe1c8b790adeee84da49/botocore-1.43.75-py3-none-any.whl", hash = "sha256:121abc8b0b529bc4e29a28d1e8b096b20f26708cabe3d5ae4b3446747712aece", size = 15667237, upload-time = "2026-08-19T19:54:08.802Z" },][[package]]@@ -1814,18 +1796,6 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/1e/5e/d4e9f1a599fb8e573b7b87160658329fbf28d19eac2718f51fc3def3aa5a/idna-3.18-py3-none-any.whl", hash = "sha256:7f952cbe720b688055e3f87de14f5c3e5fdaa8bc3928985c4077ca689de849a2", size = 65455, upload-time = "2026-06-02T14:34:06.319Z" },]-[[package]]-name = "importlib-metadata"-version = "8.7.1"-source = { registry = "https://pypi.org/simple" }-dependencies = [- { name = "zipp" },-]-sdist = { url = "https://files.pythonhosted.org/packages/f3/49/3b30cad09e7771a4982d9975a8cbf64f00d4a1ececb53297f1d9a7be1b10/importlib_metadata-8.7.1.tar.gz", hash = "sha256:49fef1ae6440c182052f407c8d34a68f72efc36db9ca90dc0113398f2fdde8bb", size = 57107, upload-time = "2025-12-21T10:00:19.278Z" }-wheels = [- { url = "https://files.pythonhosted.org/packages/fa/5e/f8e9a1d23b9c20a551a8a02ea3637b4642e22c2626e3a13a9a29cdea99eb/importlib_metadata-8.7.1-py3-none-any.whl", hash = "sha256:5a1f80bf1daa489495071efbb095d75a634cf28a8bc299581244063b53176151", size = 27865, upload-time = "2025-12-21T10:00:18.329Z" },-]-[[package]]name = "inflect"version = "7.5.0"@@ -1850,24 +1820,28 @@ wheels = [[[package]]name = "instructor"-version = "1.15.1"+version = "1.17.0"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "aiohttp" },+ { name = "click" },{ name = "docstring-parser" },+ { name = "idna" },{ name = "jinja2" },{ name = "jiter" },{ name = "openai" },{ name = "pydantic" },{ name = "pydantic-core" },+ { name = "regex" },{ name = "requests" },{ name = "rich" },{ name = "tenacity" },{ name = "typer" },+ { name = "urllib3" },]-sdist = { url = "https://files.pythonhosted.org/packages/dc/a4/832cfb15420360e26d2d85bd9d5fe1e4b839d52587574d389bc31284bf6f/instructor-1.15.1.tar.gz", hash = "sha256:c72406469d9025b742e83cf0c13e914b317db2089d08d889944e74fcd659ef94", size = 69948370, upload-time = "2026-04-03T01:51:30.107Z" }+sdist = { url = "https://files.pythonhosted.org/packages/80/cc/d9b8e4e0684033388c9a88df56c47f639758e4ac946e9eb3789d1b4d13d4/instructor-1.17.0.tar.gz", hash = "sha256:aeab1e7f21f5214deedf60e8e264951408057ce21d9589743f533580dc0d6bfb", size = 70240472, upload-time = "2026-09-09T02:26:00.614Z" }wheels = [- { url = "https://files.pythonhosted.org/packages/d8/c8/36c5d9b80aaf40ba9a7084a8fc18c967db6bf248a4cc8d0f0816b14284be/instructor-1.15.1-py3-none-any.whl", hash = "sha256:be81d17ba2b154a04ab4720808f24f9d6b598f80992f82eaf9cc79006099cf6c", size = 178156, upload-time = "2026-04-03T01:51:23.098Z" },+ { url = "https://files.pythonhosted.org/packages/42/22/429e950b50569cb56eb324cc62992c0a458121e5d5a43acec295a127ade7/instructor-1.17.0-py3-none-any.whl", hash = "sha256:f6b1832d178e899ee0a6a3f247e221f19580fa525c815211c02447691d761217", size = 269394, upload-time = "2026-09-09T02:25:54.888Z" },][package.optional-dependencies]@@ -1876,15 +1850,6 @@ google-genai = [{ name = "jsonref" },]-[[package]]-name = "invoke"-version = "2.2.1"-source = { registry = "https://pypi.org/simple" }-sdist = { url = "https://files.pythonhosted.org/packages/de/bd/b461d3424a24c80490313fd77feeb666ca4f6a28c7e72713e3d9095719b4/invoke-2.2.1.tar.gz", hash = "sha256:515bf49b4a48932b79b024590348da22f39c4942dff991ad1fb8b8baea1be707", size = 304762, upload-time = "2025-10-11T00:36:35.172Z" }-wheels = [- { url = "https://files.pythonhosted.org/packages/32/4b/b99e37f88336009971405cbb7630610322ed6fbfa31e1d7ab3fbf3049a2d/invoke-2.2.1-py3-none-any.whl", hash = "sha256:2413bc441b376e5cd3f55bb5d364f973ad8bdd7bf87e53c79de3c11bf3feecc8", size = 160287, upload-time = "2025-10-11T00:36:33.703Z" },-]-[[package]]name = "isort"version = "7.0.0"@@ -2018,6 +1983,15 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/f8/62/d9ba6323b9202dd2fe166beab8a86d29465c41a0288cbe229fac60c1ab8d/jsonlines-4.0.0-py3-none-any.whl", hash = "sha256:185b334ff2ca5a91362993f42e83588a360cf95ce4b71a73548502bda52a7c55", size = 8701, upload-time = "2023-09-01T12:34:42.563Z" },]+[[package]]+name = "jsonpath-python"+version = "1.1.6"+source = { registry = "https://pypi.org/simple" }+sdist = { url = "https://files.pythonhosted.org/packages/98/18/4ca8742534a5993ff383f7602e325ce2d5d7cc93d72ac5e1cdedbea8a458/jsonpath_python-1.1.6.tar.gz", hash = "sha256:dded9932b4ec41fb8726e09c83afa4e6be618f938c2db287cc2a81723c639671", size = 88178, upload-time = "2026-05-07T01:26:34.482Z" }+wheels = [+ { url = "https://files.pythonhosted.org/packages/55/8a/1270a6803bd821cbfcdda387eaa13cb41a7b1f7b9bd145979b3bfb9d6cb7/jsonpath_python-1.1.6-py3-none-any.whl", hash = "sha256:a1c50afd8d3fbbaf47a4873bc890dcb3c15da96f5c020327977d844d8731a2d4", size = 14453, upload-time = "2026-05-07T01:26:33.306Z" },+]+[[package]]name = "jsonref"version = "1.1.0"@@ -2423,24 +2397,21 @@ wheels = [[[package]]name = "mistralai"-version = "1.12.0"+version = "2.10.1"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "eval-type-backport" },{ name = "httpx" },- { name = "invoke" },+ { name = "jsonpath-python" },{ name = "opentelemetry-api" },- { name = "opentelemetry-exporter-otlp-proto-http" },- { name = "opentelemetry-sdk" },{ name = "opentelemetry-semantic-conventions" },{ name = "pydantic" },{ name = "python-dateutil" },- { name = "pyyaml" },{ name = "typing-inspection" },]-sdist = { url = "https://files.pythonhosted.org/packages/35/7c/4c2404f49a9b0a3dcf7ce9e05b4749cf3d53f203e5724b430fa07bfebb48/mistralai-1.12.0.tar.gz", hash = "sha256:38149a598eab7ed4b876c92e6e1c89d31fe01935bbf19314549fd32b21a1135f", size = 242013, upload-time = "2026-02-04T14:50:04.166Z" }+sdist = { url = "https://files.pythonhosted.org/packages/ca/db/a80c4ab96b1fec9529115dafaa3f14b28d0407fe1cb9b051ec2df9336fb7/mistralai-2.10.1.tar.gz", hash = "sha256:43b61643ba4f120463e5faf7305a6f40eb29f8e3a21321893969e56c20ed3fbc", size = 590127, upload-time = "2026-09-15T08:12:30.79Z" }wheels = [- { url = "https://files.pythonhosted.org/packages/1a/c5/f188efddb2b6debf73f2b2fea70eb119d1935ee33a92947d0756e22476ba/mistralai-1.12.0-py3-none-any.whl", hash = "sha256:a5873d456b7920782f716d60593d4db32c9510b13fc98908081b9f36427e0e5a", size = 500154, upload-time = "2026-02-04T14:50:05.628Z" },+ { url = "https://files.pythonhosted.org/packages/ec/98/f64b54166a607ece4e5c8494c843ac1f9c7c0af6f1014272cc420fe1d519/mistralai-2.10.1-py3-none-any.whl", hash = "sha256:443b306392ae1e86edaec39dbafcf79deb735799a00abef4611531004e22b1b2", size = 1392946, upload-time = "2026-09-15T08:12:28.704Z" },][[package]]@@ -3210,84 +3181,113 @@ wheels = [[[package]]name = "opentelemetry-api"-version = "1.38.0"+version = "1.45.0"source = { registry = "https://pypi.org/simple" }dependencies = [- { name = "importlib-metadata" },{ name = "typing-extensions" },]-sdist = { url = "https://files.pythonhosted.org/packages/08/d8/0f354c375628e048bd0570645b310797299754730079853095bf000fba69/opentelemetry_api-1.38.0.tar.gz", hash = "sha256:f4c193b5e8acb0912b06ac5b16321908dd0843d75049c091487322284a3eea12", size = 65242, upload-time = "2025-10-16T08:35:50.25Z" }+sdist = { url = "https://files.pythonhosted.org/packages/1f/dc/e12c1fe1ed8a7b7149777127b1a0e12ce5bd5a81d97408bedc2128c260f5/opentelemetry_api-1.45.0.tar.gz", hash = "sha256:711ede81773c8025c2c03dac0450bc89f3d30aea6eabcc815c570d4e35a963f7", size = 72115, upload-time = "2026-09-25T12:32:28.399Z" }wheels = [- { url = "https://files.pythonhosted.org/packages/ae/a2/d86e01c28300bd41bab8f18afd613676e2bd63515417b77636fc1add426f/opentelemetry_api-1.38.0-py3-none-any.whl", hash = "sha256:2891b0197f47124454ab9f0cf58f3be33faca394457ac3e09daba13ff50aa582", size = 65947, upload-time = "2025-10-16T08:35:30.23Z" },+ { url = "https://files.pythonhosted.org/packages/44/b9/040d1a1c7836922828e6480cd2366bb8fe0ebf75b413d2bb51a9b0e7f78f/opentelemetry_api-1.45.0-py3-none-any.whl", hash = "sha256:80e068aba7cd56c8b58512d6a36f8d25cb1dfaa0c0a4cc1c938ccf9f362d9cb3", size = 60020, upload-time = "2026-09-25T12:32:03.192Z" },+]++[[package]]+name = "opentelemetry-exporter-http-transport"+version = "0.66b0"+source = { registry = "https://pypi.org/simple" }+dependencies = [+ { name = "opentelemetry-api" },+]+sdist = { url = "https://files.pythonhosted.org/packages/5e/31/cbedb10e08c3c932b80f58edf055a16bb48a500c23c617b758fb3ec18f08/opentelemetry_exporter_http_transport-0.66b0.tar.gz", hash = "sha256:2c229b6593eaa22c86d9b8a15843dc23b406dbda00fb138339189aab07923b4e", size = 11694, upload-time = "2026-09-25T12:32:29.689Z" }+wheels = [+ { url = "https://files.pythonhosted.org/packages/b1/65/34d7106eb45acda40f016c5b31b313ffbbf4744acd5f099f29eaf2958b4d/opentelemetry_exporter_http_transport-0.66b0-py3-none-any.whl", hash = "sha256:c82689928a11505a2a0a26a04afe0ce06d270d3db984bc16c1a80ffa902db00e", size = 12156, upload-time = "2026-09-25T12:32:05.621Z" },+]++[package.optional-dependencies]+urllib3 = [+ { name = "urllib3" },+]++[[package]]+name = "opentelemetry-exporter-otlp-common"+version = "0.66b0"+source = { registry = "https://pypi.org/simple" }+dependencies = [+ { name = "opentelemetry-sdk" },+]+sdist = { url = "https://files.pythonhosted.org/packages/68/09/01239cdfe8a414d46ed625b68b6da92666ffd16d93cc6dadf89404b4bd85/opentelemetry_exporter_otlp_common-0.66b0.tar.gz", hash = "sha256:362268ec6aa705e183776ff938539df1e8ce45bc5509d242538b1d40c26fe6a6", size = 14323, upload-time = "2026-09-25T12:32:31.481Z" }+wheels = [+ { url = "https://files.pythonhosted.org/packages/c3/a9/b6a7a9d40ba99ed71b18e17310339024b086578f5f32162df1c1c0cf6270/opentelemetry_exporter_otlp_common-0.66b0-py3-none-any.whl", hash = "sha256:35d24c867310f4713a9738b0202b6bade77955418fccb9e2f7eea01b76263916", size = 12387, upload-time = "2026-09-25T12:32:08.438Z" },][[package]]name = "opentelemetry-exporter-otlp-proto-common"-version = "1.38.0"+version = "1.45.0"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "opentelemetry-proto" },]-sdist = { url = "https://files.pythonhosted.org/packages/19/83/dd4660f2956ff88ed071e9e0e36e830df14b8c5dc06722dbde1841accbe8/opentelemetry_exporter_otlp_proto_common-1.38.0.tar.gz", hash = "sha256:e333278afab4695aa8114eeb7bf4e44e65c6607d54968271a249c180b2cb605c", size = 20431, upload-time = "2025-10-16T08:35:53.285Z" }+sdist = { url = "https://files.pythonhosted.org/packages/e5/e0/ee3823dbdc10da15b5750becc37b61194dd7c55e3b56764ecbbe446f659a/opentelemetry_exporter_otlp_proto_common-1.45.0.tar.gz", hash = "sha256:36495115a0c6a7aa946cfda9d59b6ed4e917b6ab0f75cdaf66bc1b176ec1be1f", size = 18870, upload-time = "2026-09-25T12:32:34.141Z" }wheels = [- { url = "https://files.pythonhosted.org/packages/a7/9e/55a41c9601191e8cd8eb626b54ee6827b9c9d4a46d736f32abc80d8039fc/opentelemetry_exporter_otlp_proto_common-1.38.0-py3-none-any.whl", hash = "sha256:03cb76ab213300fe4f4c62b7d8f17d97fcfd21b89f0b5ce38ea156327ddda74a", size = 18359, upload-time = "2025-10-16T08:35:34.099Z" },+ { url = "https://files.pythonhosted.org/packages/f0/bf/3e21917368a81282ce9fc6d085a944dcaea6eed19de7d29cc979375db347/opentelemetry_exporter_otlp_proto_common-1.45.0-py3-none-any.whl", hash = "sha256:7e1410ae6d3ed301f7a74bec96467d519d3f37e52f9d95b309ae125e5a1af863", size = 15394, upload-time = "2026-09-25T12:32:12.663Z" },][[package]]name = "opentelemetry-exporter-otlp-proto-http"-version = "1.38.0"+version = "1.45.0"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "googleapis-common-protos" },{ name = "opentelemetry-api" },+ { name = "opentelemetry-exporter-http-transport", extra = ["urllib3"] },+ { name = "opentelemetry-exporter-otlp-common" },{ name = "opentelemetry-exporter-otlp-proto-common" },{ name = "opentelemetry-proto" },{ name = "opentelemetry-sdk" },- { name = "requests" },{ name = "typing-extensions" },]-sdist = { url = "https://files.pythonhosted.org/packages/81/0a/debcdfb029fbd1ccd1563f7c287b89a6f7bef3b2902ade56797bfd020854/opentelemetry_exporter_otlp_proto_http-1.38.0.tar.gz", hash = "sha256:f16bd44baf15cbe07633c5112ffc68229d0edbeac7b37610be0b2def4e21e90b", size = 17282, upload-time = "2025-10-16T08:35:54.422Z" }+sdist = { url = "https://files.pythonhosted.org/packages/94/78/a503801c1c8f80b1d8aad0e14106a7c57f39344001652a78a683f9a9089e/opentelemetry_exporter_otlp_proto_http-1.45.0.tar.gz", hash = "sha256:2f35496d96809f946f41b8805e6b93aec6c9b71b5fd759b75b6af4c084d992ae", size = 28818, upload-time = "2026-09-25T12:32:35.335Z" }wheels = [- { url = "https://files.pythonhosted.org/packages/e5/77/154004c99fb9f291f74aa0822a2f5bbf565a72d8126b3a1b63ed8e5f83c7/opentelemetry_exporter_otlp_proto_http-1.38.0-py3-none-any.whl", hash = "sha256:84b937305edfc563f08ec69b9cb2298be8188371217e867c1854d77198d0825b", size = 19579, upload-time = "2025-10-16T08:35:36.269Z" },+ { url = "https://files.pythonhosted.org/packages/e7/18/875e0ee47e035f324e42eda9aab47d58381a4412181dca251d3504e24680/opentelemetry_exporter_otlp_proto_http-1.45.0-py3-none-any.whl", hash = "sha256:74385f99266dafdefff41f3da4b76f6dba79d237a9d4487e6ff1ee653c74a0a3", size = 22260, upload-time = "2026-09-25T12:32:14.658Z" },][[package]]name = "opentelemetry-proto"-version = "1.38.0"+version = "1.45.0"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "protobuf" },]-sdist = { url = "https://files.pythonhosted.org/packages/51/14/f0c4f0f6371b9cb7f9fa9ee8918bfd59ac7040c7791f1e6da32a1839780d/opentelemetry_proto-1.38.0.tar.gz", hash = "sha256:88b161e89d9d372ce723da289b7da74c3a8354a8e5359992be813942969ed468", size = 46152, upload-time = "2025-10-16T08:36:01.612Z" }+sdist = { url = "https://files.pythonhosted.org/packages/72/28/67c38cfb7e2bdfdd0cde7dcdd0424aed0291fbd64aa4ea3e7e913734711a/opentelemetry_proto-1.45.0.tar.gz", hash = "sha256:96ee414f24bc3f61ea8e17dc56b4348d4049d73db3eb17c6b3edf75b5b403300", size = 46489, upload-time = "2026-09-25T12:32:41.409Z" }wheels = [- { url = "https://files.pythonhosted.org/packages/b6/6a/82b68b14efca5150b2632f3692d627afa76b77378c4999f2648979409528/opentelemetry_proto-1.38.0-py3-none-any.whl", hash = "sha256:b6ebe54d3217c42e45462e2a1ae28c3e2bf2ec5a5645236a490f55f45f1a0a18", size = 72535, upload-time = "2025-10-16T08:35:45.749Z" },+ { url = "https://files.pythonhosted.org/packages/6b/45/814d55714507c7ce9c9cd86a4f83ceb5a74ab0bffcc63ff493943f138de2/opentelemetry_proto-1.45.0-py3-none-any.whl", hash = "sha256:9731566359d7b8e1ee1e149d8e4ad6865bab965e657ad3387ec2784d16927666", size = 72486, upload-time = "2026-09-25T12:32:23.36Z" },][[package]]name = "opentelemetry-sdk"-version = "1.38.0"+version = "1.45.0"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "opentelemetry-api" },{ name = "opentelemetry-semantic-conventions" },{ name = "typing-extensions" },]-sdist = { url = "https://files.pythonhosted.org/packages/85/cb/f0eee1445161faf4c9af3ba7b848cc22a50a3d3e2515051ad8628c35ff80/opentelemetry_sdk-1.38.0.tar.gz", hash = "sha256:93df5d4d871ed09cb4272305be4d996236eedb232253e3ab864c8620f051cebe", size = 171942, upload-time = "2025-10-16T08:36:02.257Z" }+sdist = { url = "https://files.pythonhosted.org/packages/ac/ed/ad32d76cc86ebce601105d01d13f8a08d6abc1852eaf69d79cf199bc1ee7/opentelemetry_sdk-1.45.0.tar.gz", hash = "sha256:20caa5130505e386c67c3da1c76e446c842698ced54c76c6148679539aa97972", size = 218337, upload-time = "2026-09-25T12:32:43.591Z" }wheels = [- { url = "https://files.pythonhosted.org/packages/2f/2e/e93777a95d7d9c40d270a371392b6d6f1ff170c2a3cb32d6176741b5b723/opentelemetry_sdk-1.38.0-py3-none-any.whl", hash = "sha256:1c66af6564ecc1553d72d811a01df063ff097cdc82ce188da9951f93b8d10f6b", size = 132349, upload-time = "2025-10-16T08:35:46.995Z" },+ { url = "https://files.pythonhosted.org/packages/8a/ae/46963201ce58d6b86f9e54087a39720a35ac9f57c3a9e440d275995c2b02/opentelemetry_sdk-1.45.0-py3-none-any.whl", hash = "sha256:5dc634c946546f61b757c5b1781f9fd1a10e96ffaf7357c797e508fe9c57e75e", size = 140132, upload-time = "2026-09-25T12:32:25.399Z" },][[package]]name = "opentelemetry-semantic-conventions"-version = "0.59b0"+version = "0.66b0"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "opentelemetry-api" },{ name = "typing-extensions" },]-sdist = { url = "https://files.pythonhosted.org/packages/40/bc/8b9ad3802cd8ac6583a4eb7de7e5d7db004e89cb7efe7008f9c8a537ee75/opentelemetry_semantic_conventions-0.59b0.tar.gz", hash = "sha256:7a6db3f30d70202d5bf9fa4b69bc866ca6a30437287de6c510fb594878aed6b0", size = 129861, upload-time = "2025-10-16T08:36:03.346Z" }+sdist = { url = "https://files.pythonhosted.org/packages/2e/21/910f085c0b83b80e45c341c7859baef37c877046b2c44c88d5ff2d5db948/opentelemetry_semantic_conventions-0.66b0.tar.gz", hash = "sha256:97a77dce484c54861e7eeff7651fd8a806dd3c30e501dc316730215ec36890e6", size = 150247, upload-time = "2026-09-25T12:32:44.827Z" }wheels = [- { url = "https://files.pythonhosted.org/packages/24/7d/c88d7b15ba8fe5c6b8f93be50fc11795e9fc05386c44afaf6b76fe191f9b/opentelemetry_semantic_conventions-0.59b0-py3-none-any.whl", hash = "sha256:35d3b8833ef97d614136e253c1da9342b4c3c083bbaf29ce31d572a1c3825eed", size = 207954, upload-time = "2025-10-16T08:35:48.054Z" },+ { url = "https://files.pythonhosted.org/packages/f4/93/2ad416d69c4ca8fd21ebc6894f23f4eda744dc6f43a14d7a9ffd7ed3abbd/opentelemetry_semantic_conventions-0.66b0-py3-none-any.whl", hash = "sha256:175b19dd98c4473f4f43a2b1df59186fd7b4a48cd3f77cbe03438b6d6fda230a", size = 206277, upload-time = "2026-09-25T12:32:26.484Z" },][[package]]@@ -3490,7 +3490,7 @@ anthropic = [{ name = "anthropic" },]bedrock = [- { name = "aioboto3" },+ { name = "aiobotocore" },{ name = "boto3" },]cli = [@@ -3515,7 +3515,7 @@ dev = [{ name = "pytest-timeout" },{ name = "pytest-xdist" },{ name = "ruff" },- { name = "types-aioboto3", extra = ["bedrock", "bedrock-runtime"] },+ { name = "types-aiobotocore", extra = ["bedrock", "bedrock-runtime"] },{ name = "types-aiofiles" },{ name = "types-jsonschema" },{ name = "types-markdown" },@@ -3569,20 +3569,20 @@ mistralai = [{ name = "mistralai" },]s3 = [- { name = "aioboto3" },+ { name = "aiobotocore" },{ name = "boto3" },][package.metadata]requires-dist = [- { name = "aioboto3", marker = "extra == 'bedrock'", specifier = ">=13.4.0" },- { name = "aioboto3", marker = "extra == 's3'", specifier = ">=13.4.0" },+ { name = "aiobotocore", marker = "extra == 'bedrock'", specifier = ">=3.0.0" },+ { name = "aiobotocore", marker = "extra == 's3'", specifier = ">=3.0.0" },{ name = "aiofiles", specifier = ">=23.2.1" },{ name = "annotated-types", specifier = ">=0.7.0" },{ name = "anthropic", marker = "extra == 'anthropic'", specifier = ">=0.78.0" },- { name = "boto3", marker = "extra == 'bedrock'", specifier = ">=1.34.131" },+ { name = "boto3", marker = "extra == 'bedrock'", specifier = ">=1.42.42" },{ name = "boto3", marker = "extra == 'dynamodb'", specifier = ">=1.34.131" },- { name = "boto3", marker = "extra == 's3'", specifier = ">=1.34.131" },+ { name = "boto3", marker = "extra == 's3'", specifier = ">=1.42.42" },{ name = "boto3-stubs", marker = "extra == 'dev'", specifier = ">=1.35.24" },{ name = "cryptography", marker = "extra == 'dev'", specifier = ">=46.0.7" },{ name = "cryptography", marker = "extra == 'gcp-storage'", specifier = ">=46.0.7" },@@ -3600,7 +3600,7 @@ requires-dist = [{ name = "huggingface-hub", marker = "extra == 'huggingface'", specifier = ">=1.5.0,<2.0.0" },{ name = "hypothesis", marker = "extra == 'dev'", specifier = ">=6.140.3" },{ name = "idna", specifier = ">=3.15" },- { name = "instructor", specifier = ">=1.13" },+ { name = "instructor", specifier = ">=1.17.0,<2.0.0" },{ name = "instructor", extras = ["google-genai"], marker = "extra == 'google-genai'" },{ name = "jinja2", specifier = ">=3.1.4" },{ name = "json2html", specifier = ">=1.3.0" },@@ -3610,7 +3610,7 @@ requires-dist = [{ name = "lxml", marker = "extra == 'docling'", specifier = ">=6.1.0" },{ name = "markdown", specifier = ">=3.6" },{ name = "mike", marker = "extra == 'docs'", specifier = ">=2.1.3" },- { name = "mistralai", marker = "extra == 'mistralai'", specifier = ">=1.12.0" },+ { name = "mistralai", marker = "extra == 'mistralai'", specifier = ">=2.10.0" },{ name = "mkdocs", marker = "extra == 'docs'", specifier = ">=1.6.1" },{ name = "mkdocs-glightbox", marker = "extra == 'docs'", specifier = ">=0.4.0" },{ name = "mkdocs-llmstxt-md", marker = "extra == 'docs'", specifier = ">=0.2.0" },@@ -3622,9 +3622,9 @@ requires-dist = [{ name = "mypy", marker = "extra == 'dev'", specifier = "==1.19.1" },{ name = "networkx", specifier = ">=3.4.2" },{ name = "openai", specifier = ">=2.0.0" },- { name = "opentelemetry-api", specifier = ">=1.38.0" },+ { name = "opentelemetry-api", specifier = ">=1.39.0" },{ name = "opentelemetry-exporter-otlp-proto-http", specifier = ">=1.38.0" },- { name = "opentelemetry-sdk", specifier = ">=1.38.0" },+ { name = "opentelemetry-sdk", specifier = ">=1.39.0" },{ name = "opentelemetry-semantic-conventions", specifier = ">=0.59b0" },{ name = "pillow", specifier = ">=12.1.1" },{ name = "pipelex-tools", marker = "extra == 'dev'", specifier = ">=0.7.2" },@@ -3658,7 +3658,7 @@ requires-dist = [{ name = "tomli", specifier = ">=2.3.0" },{ name = "tomlkit", specifier = ">=0.13.2" },{ name = "typer", specifier = ">=0.16.0,<0.27" },- { name = "types-aioboto3", extras = ["bedrock", "bedrock-runtime"], marker = "extra == 'dev'", specifier = ">=13.4.0" },+ { name = "types-aiobotocore", extras = ["bedrock", "bedrock-runtime"], marker = "extra == 'dev'", specifier = ">=3.0.0" },{ name = "types-aiofiles", marker = "extra == 'dev'", specifier = ">=24.1.0.20240626" },{ name = "types-jsonschema", marker = "extra == 'dev'", specifier = ">=4.20.0" },{ name = "types-markdown", marker = "extra == 'dev'", specifier = ">=3.6.0.20240316" },@@ -4847,14 +4847,14 @@ wheels = [[[package]]name = "s3transfer"-version = "0.14.0"+version = "0.19.2"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "botocore" },]-sdist = { url = "https://files.pythonhosted.org/packages/62/74/8d69dcb7a9efe8baa2046891735e5dfe433ad558ae23d9e3c14c633d1d58/s3transfer-0.14.0.tar.gz", hash = "sha256:eff12264e7c8b4985074ccce27a3b38a485bb7f7422cc8046fee9be4983e4125", size = 151547, upload-time = "2025-09-09T19:23:31.089Z" }+sdist = { url = "https://files.pythonhosted.org/packages/76/43/35e4d8aa320bffe8287fe8f65f578fa2d2db0a64212f0e710dce58267854/s3transfer-0.19.2.tar.gz", hash = "sha256:ba0309fd86be3c27dbf78cdd813c13c5e1df16e5874b99d2535ebbdfb9892993", size = 165592, upload-time = "2026-07-22T19:30:44.432Z" }wheels = [- { url = "https://files.pythonhosted.org/packages/48/f0/ae7ca09223a81a1d890b2557186ea015f6e0502e9b8cb8e1813f1d8cfa4e/s3transfer-0.14.0-py3-none-any.whl", hash = "sha256:ea3b790c7077558ed1f02a3072fb3cb992bbbd253392f4b6e9e8976941c7d456", size = 85712, upload-time = "2025-09-09T19:23:30.041Z" },+ { url = "https://files.pythonhosted.org/packages/bc/e7/5c595c75e9f41a44f30e526eda465ea0b4eec93470e074e4a111b253f13a/s3transfer-0.19.2-py3-none-any.whl", hash = "sha256:d8168eccca828cbb2cd573675333f3bddd254313a9c42494b84c76b539e8ba25", size = 90216, upload-time = "2026-07-22T19:30:43.251Z" },][[package]]@@ -5583,18 +5583,16 @@ wheels = [][[package]]-name = "types-aioboto3"-version = "15.5.0"+name = "types-aiobotocore"+version = "3.6.0"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "botocore-stubs" },- { name = "types-aiobotocore" },- { name = "types-s3transfer" },{ name = "typing-extensions", marker = "python_full_version < '3.12'" },]-sdist = { url = "https://files.pythonhosted.org/packages/56/76/e162ea2ef8d414d4f36f28a6e0b6078ccef3f2f9d5f957859f303995c528/types_aioboto3-15.5.0.tar.gz", hash = "sha256:5769a1c3df7ca1abedf3656ddf0b970c9b0436d0f88cf4686040b55cd2a02925", size = 81059, upload-time = "2025-10-31T01:11:54.445Z" }+sdist = { url = "https://files.pythonhosted.org/packages/b9/e4/5dd83c879eff726931ef222d3ae27f67999c3bc33dfae1ca8237ebccdf17/types_aiobotocore-3.6.0.tar.gz", hash = "sha256:e990056ce9d19094a9d9b36008ca0b2a4d69948ff58f50868dd159a81f6ad69c", size = 87978, upload-time = "2026-05-02T03:05:30.694Z" }wheels = [- { url = "https://files.pythonhosted.org/packages/ec/1d/e187fbe9771dffb5f0801e315ac23a6c383c14d1cbb90da6ca3ad1ea9b06/types_aioboto3-15.5.0-py3-none-any.whl", hash = "sha256:8aed7c9b6fe9b59e6ce74f7a6db7b8a9912a34c8f80ed639fac1fa59d6b20aa1", size = 42521, upload-time = "2025-10-31T01:11:47.832Z" },+ { url = "https://files.pythonhosted.org/packages/19/7c/cadd4b4d0bdd6f1cbc601177a115966dabd9afa022287f3f25423274ab97/types_aiobotocore-3.6.0-py3-none-any.whl", hash = "sha256:e38d5340bfb7ecc17a40acfd1043f4ed91af9f8189daa5e438bda2e7d276d406", size = 54805, upload-time = "2026-05-02T03:05:27.911Z" },][package.optional-dependencies]@@ -5605,41 +5603,28 @@ bedrock-runtime = [{ name = "types-aiobotocore-bedrock-runtime" },]-[[package]]-name = "types-aiobotocore"-version = "3.6.0"-source = { registry = "https://pypi.org/simple" }-dependencies = [- { name = "botocore-stubs" },- { name = "typing-extensions", marker = "python_full_version < '3.12'" },-]-sdist = { url = "https://files.pythonhosted.org/packages/b9/e4/5dd83c879eff726931ef222d3ae27f67999c3bc33dfae1ca8237ebccdf17/types_aiobotocore-3.6.0.tar.gz", hash = "sha256:e990056ce9d19094a9d9b36008ca0b2a4d69948ff58f50868dd159a81f6ad69c", size = 87978, upload-time = "2026-05-02T03:05:30.694Z" }-wheels = [- { url = "https://files.pythonhosted.org/packages/19/7c/cadd4b4d0bdd6f1cbc601177a115966dabd9afa022287f3f25423274ab97/types_aiobotocore-3.6.0-py3-none-any.whl", hash = "sha256:e38d5340bfb7ecc17a40acfd1043f4ed91af9f8189daa5e438bda2e7d276d406", size = 54805, upload-time = "2026-05-02T03:05:27.911Z" },-]-[[package]]name = "types-aiobotocore-bedrock"-version = "2.25.2"+version = "3.6.0"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "typing-extensions", marker = "python_full_version < '3.12'" },]-sdist = { url = "https://files.pythonhosted.org/packages/69/99/b986a2dcd19828b7d79d237d9c6154327bfcc4fd6126b67ea6343322a8b5/types_aiobotocore_bedrock-2.25.2.tar.gz", hash = "sha256:524043f7cf95d4670706b05d48835d8ad3e401fa4095000d107ca444ea3c4e7f", size = 59660, upload-time = "2025-11-12T01:42:00.672Z" }+sdist = { url = "https://files.pythonhosted.org/packages/38/a3/a441b385df47f3a5e36bb6026159f41b5336c6d04c8f9dfe9810b32e2e3b/types_aiobotocore_bedrock-3.6.0.tar.gz", hash = "sha256:37e777f172642412cb160ed3d894cf107a28c9e9c02a2976d18eb942ad151769", size = 63967, upload-time = "2026-05-02T02:56:55.771Z" }wheels = [- { url = "https://files.pythonhosted.org/packages/d1/d3/1d32ce456037008fa0878832f80347d029887a7ea20922745f003def4ab9/types_aiobotocore_bedrock-2.25.2-py3-none-any.whl", hash = "sha256:d06ebd7a8e8ffe22567719136bd73b9a804f77bd83ec7ad02a8077438c5436d3", size = 67366, upload-time = "2025-11-12T01:41:59.369Z" },+ { url = "https://files.pythonhosted.org/packages/96/1b/5c9c50c53585cb160efd76469851e4bfd6be3f41573f98cad7dbff190ab8/types_aiobotocore_bedrock-3.6.0-py3-none-any.whl", hash = "sha256:5f312e58df6267f46bf4fd3f49c166dd5ba40a86e08a73564c724249a224afc1", size = 72208, upload-time = "2026-05-02T02:56:53.651Z" },][[package]]name = "types-aiobotocore-bedrock-runtime"-version = "2.25.2"+version = "3.6.0"source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "typing-extensions", marker = "python_full_version < '3.12'" },]-sdist = { url = "https://files.pythonhosted.org/packages/54/af/47f695dd846b3898feb0a858020ac86f088c65826d0d60f9680a1177837d/types_aiobotocore_bedrock_runtime-2.25.2.tar.gz", hash = "sha256:7068ac2f4cda13852739db2dc822ef7498c6fe81fc031b496dc35bdcb7cc44f3", size = 28451, upload-time = "2025-11-12T01:42:02.961Z" }+sdist = { url = "https://files.pythonhosted.org/packages/4a/ec/e84690725f257ddb4d43940357be280bb34f8db9030c6af72b99b13c8a6c/types_aiobotocore_bedrock_runtime-3.6.0.tar.gz", hash = "sha256:4598c1f758a71a8ea7564e094e8a928270d8f763cf006d6adfc1405018dfdb94", size = 30060, upload-time = "2026-05-02T02:56:56.488Z" }wheels = [- { url = "https://files.pythonhosted.org/packages/01/ba/baeb40c98b0a2be60b5e6c704ed16646f6981618a543087832877aa7b170/types_aiobotocore_bedrock_runtime-2.25.2-py3-none-any.whl", hash = "sha256:8a2e881e0922c6866b5fac1835abfa8b623a2046db9125ea20e2832248ed55a0", size = 34804, upload-time = "2025-11-12T01:42:01.759Z" },+ { url = "https://files.pythonhosted.org/packages/53/37/44fe1bf90773b23c925bb2bd89ca34396437b97d9262199cffc8e3721116/types_aiobotocore_bedrock_runtime-3.6.0-py3-none-any.whl", hash = "sha256:91be41d0096cb9ac9e14fb534f5ca3f03ea3f9e666b7a2add998a26f2cf430f6", size = 36707, upload-time = "2026-05-02T02:56:54.168Z" },][[package]]@@ -6067,12 +6052,3 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/51/47/3fa2286c3cb162c71cdb34c4224d5745a1ceceb391b2bd9b19b668a8d724/yarl-1.23.0-cp314-cp314t-win_arm64.whl", hash = "sha256:44bb7bef4ea409384e3f8bc36c063d77ea1b8d4a5b2706956c0d6695f07dcc25", size = 86041, upload-time = "2026-03-01T22:07:49.026Z" },{ url = "https://files.pythonhosted.org/packages/69/68/c8739671f5699c7dc470580a4f821ef37c32c4cb0b047ce223a7f115757f/yarl-1.23.0-py3-none-any.whl", hash = "sha256:a2df6afe50dea8ae15fa34c9f824a3ee958d785fd5d089063d960bae1daa0a3f", size = 48288, upload-time = "2026-03-01T22:07:51.388Z" },]--[[package]]-name = "zipp"-version = "3.23.1"-source = { registry = "https://pypi.org/simple" }-sdist = { url = "https://files.pythonhosted.org/packages/30/21/093488dfc7cc8964ded15ab726fad40f25fd3d788fd741cc1c5a17d78ee8/zipp-3.23.1.tar.gz", hash = "sha256:32120e378d32cd9714ad503c1d024619063ec28aad2248dc6672ad13edfa5110", size = 25965, upload-time = "2026-04-13T23:21:46.6Z" }-wheels = [- { url = "https://files.pythonhosted.org/packages/08/8a/0861bec20485572fbddf3dfba2910e38fe249796cb73ecdeb74e07eeb8d3/zipp-3.23.1-py3-none-any.whl", hash = "sha256:0b3596c50a5c700c9cb40ba8d86d9f2cc4807e9bedb06bcdf7fac85633e444dc", size = 10378, upload-time = "2026-04-13T23:21:45.386Z" },-]diff --git a/wip/instructor-117-bump-review-deferrals.md b/wip/instructor-117-bump-review-deferrals.mdnew file mode 100644index 000000000..b23e756c7--- /dev/null+++ b/wip/instructor-117-bump-review-deferrals.md@@ -0,0 +1,19 @@+# Deferred review findings from the instructor 1.17 and aiobotocore bump++Status: deferred. Each finding below came out of a `/rev` pass on `chore/Bumping` (items L-260927-56ef15 and L-260928-3a6683, with L-260927-61a69f for the aiobotocore swap), and each section says whether it was verified before it was deferred. An unverified finding rests on the reviewers' reading alone, and whoever picks it up should confirm it first.++## The Anthropic worker compares a structure method with `!=` (unverified)++Deferred in round 2 on L-260927-56ef15, at the `defects` bar, which fixes only confirmed defects that matter, so it was sorted as an improvement. Raised by cubic and Codex. `pipelex/providers/anthropic/anthropic_llm_worker.py`, in `_structure_method_kwargs`, tests `structure_method != StructureMethod.INSTRUCTOR_ANTHROPIC_REASONING_TOOLS` to decide whether to leave the tool choice to the model. The repository's standard is to branch on an enum with an exhaustive `match`/`case`, or through a property on the enum, so that adding a member forces someone to decide how it behaves here. As written, a new structure method silently takes the forced-tool-choice path. The suggested shape is a property such as `StructureMethod.forces_tool_choice`, or a `match` over the members that reach the Anthropic worker.++## Gemini tool mode validates structured output in lax mode (verified)++Deferred in round 2 on L-260928-3a6683, at the `defects` bar, on the developer's decision after a verifier confirmed it. Raised by the Codex adversarial reviewer.++**The defect.** `GoogleLLMWorker._validates_structured_output_strictly` in `pipelex/providers/google/google_llm_worker.py` returns `False` under `Mode.TOOLS`, and `_gen_object` passes that as `strict=`. instructor 1.17's `parse_genai_tools` (`instructor/v2/providers/genai/handlers.py`) validates the function-call arguments with `response_model.model_validate(obj=function_call.args, strict=strict)`, so the whole response goes through pydantic's lax Python-mode validation. Driven through `_gen_object` with a faked Gemini response and a schema of `count: int`, `enabled: bool` and an enum field, the payload `{"count": "001", "enabled": "off", "color": "red"}` was accepted after one call as `count=1, enabled=False`, with no schema re-ask. The same payload under `instructor/genai_structured_outputs` was rejected with `int_type` and re-asked.++**Why it went lax.** On `origin/dev`, instructor 1.15.1 validated this path strictly in Python mode, which refuses a string for an enum field, so every schema with an enum failed on Gemini tool calls, and so did ISO date strings. The branch went lax to fix that, and the looser handling of stringified scalars came with it.++**Its reach.** Lax mode only accepts strings that convert cleanly to the declared type, so a re-ask would have converged on the same value; the cost is that schema-nonconforming output skips the re-ask. The shipped `google.toml` now uses `instructor/genai_structured_outputs`, so tool mode is reached only by an older copied backend file that still names `instructor/genai_tools`, or by a per-model override.++**The fix, and why it was not done in the round.** Validating the tool arguments as strict JSON, `model_validate_json(json.dumps(args), strict=True)`, accepts enum strings, nested enums and ISO dates while rejecting `"001"` and `"off"`; instructor 1.17 already parses Anthropic tool calls that way. But instructor resolves its parse handler from a process-wide registry keyed by provider and mode (`instructor.v2.core.registry.mode_registry`), so the fix means registering a pipelex handler for `(Provider.GENAI, Mode.TOOLS)` over instructor's own, which changes the behaviour for every instructor genai client in the process, or asking instructor upstream to parse genai tool calls as JSON the way it does Anthropic's. One risk is unsettled either way: strict JSON rejects a float for an `int` field, which lax mode accepts, and without a live call it is unknown whether Gemini ever sends an integer argument as `1.0`. Whoever takes this should settle that with a live tool-mode call first, and add tests showing enum strings pass while stringified integers and booleans are rejected and re-asked.