Skip to content

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.

fix reasoning tests

Louis Choquel46a8f6bbf131
diff --git a/tests/e2e/pipelex/pipes/pipe_operators/pipe_llm/test_pipe_llm_object_list.py b/tests/e2e/pipelex/pipes/pipe_operators/pipe_llm/test_pipe_llm_object_list.py
index c9f8e4d44..5ec7971a0 100644
--- a/tests/e2e/pipelex/pipes/pipe_operators/pipe_llm/test_pipe_llm_object_list.py
+++ b/tests/e2e/pipelex/pipes/pipe_operators/pipe_llm/test_pipe_llm_object_list.py
@@ -3,7 +3,6 @@
import pytest
from pipelex import pretty_print
-from pipelex.core.stuffs.structured_content import StructuredContent
from pipelex.core.stuffs.text_content import TextContent
from pipelex.pipe_run.pipe_run_mode import PipeRunMode
from pipelex.pipeline.runner import PipelexRunner
diff --git a/tests/unit/pipelex/cogt/llm/test_llm_config_reasoning.py b/tests/unit/pipelex/cogt/llm/test_llm_config_reasoning.py
index 1b6e572e5..52e73fe38 100644
--- a/tests/unit/pipelex/cogt/llm/test_llm_config_reasoning.py
+++ b/tests/unit/pipelex/cogt/llm/test_llm_config_reasoning.py
@@ -5,8 +5,8 @@ from pipelex.cogt.llm.llm_job_components import LLMJobConfig, ReasoningEffort
from pipelex.system.exceptions import ConfigValidationError
_DEFAULT_EFFORT_TO_BUDGET_MAPS: dict[str, dict[str, int]] = {
- "anthropic": {"none": 0, "minimal": 512, "low": 1024, "medium": 5000, "high": 16384, "max": 65536},
- "gemini": {"none": 0, "minimal": 512, "low": 1024, "medium": 5000, "high": 16384, "max": 65536},
+ "anthropic": {"none": 0, "minimal": 512, "low": 1024, "medium": 5000, "high": 16384, "xhigh": 32768, "max": 65536},
+ "gemini": {"none": 0, "minimal": 512, "low": 1024, "medium": 5000, "high": 16384, "xhigh": 32768, "max": 65536},
}
_DEFAULT_OPENAI_LEVEL_MAP: dict[str, str] = {
@@ -15,6 +15,7 @@ _DEFAULT_OPENAI_LEVEL_MAP: dict[str, str] = {
"low": "low",
"medium": "medium",
"high": "high",
+ "xhigh": "xhigh",
"max": "xhigh",
}
@@ -24,6 +25,7 @@ _DEFAULT_ANTHROPIC_LEVEL_MAP: dict[str, str] = {
"low": "low",
"medium": "medium",
"high": "high",
+ "xhigh": "xhigh",
"max": "max",
}
@@ -33,6 +35,7 @@ _DEFAULT_GOOGLE_LEVEL_MAP: dict[str, str] = {
"low": "low",
"medium": "medium",
"high": "high",
+ "xhigh": "high",
"max": "high",
}
@@ -42,6 +45,7 @@ _DEFAULT_MISTRAL_LEVEL_MAP: dict[str, str] = {
"low": "reasoning",
"medium": "reasoning",
"high": "reasoning",
+ "xhigh": "reasoning",
"max": "reasoning",
}
@@ -108,7 +112,7 @@ class TestLLMConfigReasoning:
def test_validator_invalid_effort_level_raises(self):
invalid_maps = {
- "anthropic": {"none": 0, "minimal": 512, "low": 1024, "medium": 5000, "high": 16384, "max": 65536, "ultra": 999999},
+ "anthropic": {"none": 0, "minimal": 512, "low": 1024, "medium": 5000, "high": 16384, "xhigh": 32768, "max": 65536, "ultra": 999999},
}
with pytest.raises(ConfigValidationError, match="Invalid reasoning effort levels"):
_make_llm_config(effort_to_budget_maps=invalid_maps)
@@ -134,6 +138,7 @@ class TestLLMConfigReasoning:
ReasoningEffort.LOW,
ReasoningEffort.MEDIUM,
ReasoningEffort.HIGH,
+ ReasoningEffort.XHIGH,
ReasoningEffort.MAX,
],
)
@@ -220,6 +225,7 @@ class TestLLMConfigReasoning:
"low": "low",
"medium": "medium",
"high": "high",
+ "xhigh": "xhigh",
"max": "xhigh",
"ultra": "super",
}
@@ -280,6 +286,7 @@ class TestLLMConfigReasoning:
"low": "disabled",
"medium": "disabled",
"high": "disabled",
+ "xhigh": "disabled",
"max": "disabled",
}
config = _make_llm_config(
diff --git a/tests/unit/pipelex/plugins/google/test_google_reasoning.py b/tests/unit/pipelex/plugins/google/test_google_reasoning.py
index ec5eb5e77..023a8b77a 100644
--- a/tests/unit/pipelex/plugins/google/test_google_reasoning.py
+++ b/tests/unit/pipelex/plugins/google/test_google_reasoning.py
@@ -14,6 +14,7 @@ _GOOGLE_LEVEL_MAP: dict[str, str] = {
"low": "low",
"medium": "medium",
"high": "high",
+ "xhigh": "high",
"max": "high",
}
@@ -54,6 +55,7 @@ class TestGoogleReasoning:
(ReasoningEffort.LOW, 1024),
(ReasoningEffort.MEDIUM, 5000),
(ReasoningEffort.HIGH, 16384),
+ (ReasoningEffort.XHIGH, 32768),
(ReasoningEffort.MAX, 65536),
],
)
@@ -89,6 +91,7 @@ class TestGoogleReasoning:
(ReasoningEffort.LOW, genai_types.ThinkingLevel.LOW),
(ReasoningEffort.MEDIUM, genai_types.ThinkingLevel.MEDIUM),
(ReasoningEffort.HIGH, genai_types.ThinkingLevel.HIGH),
+ (ReasoningEffort.XHIGH, genai_types.ThinkingLevel.HIGH),
(ReasoningEffort.MAX, genai_types.ThinkingLevel.HIGH),
],
)
diff --git a/tests/unit/pipelex/plugins/mistral/test_mistral_reasoning.py b/tests/unit/pipelex/plugins/mistral/test_mistral_reasoning.py
index 0d75f4ab5..ad973c9d3 100644
--- a/tests/unit/pipelex/plugins/mistral/test_mistral_reasoning.py
+++ b/tests/unit/pipelex/plugins/mistral/test_mistral_reasoning.py
@@ -12,6 +12,7 @@ _MISTRAL_LEVEL_MAP: dict[str, str] = {
"low": "reasoning",
"medium": "reasoning",
"high": "reasoning",
+ "xhigh": "reasoning",
"max": "reasoning",
}
@@ -67,6 +68,7 @@ class TestMistralReasoning:
(ReasoningEffort.LOW, "reasoning"),
(ReasoningEffort.MEDIUM, "reasoning"),
(ReasoningEffort.HIGH, "reasoning"),
+ (ReasoningEffort.XHIGH, "reasoning"),
(ReasoningEffort.MAX, "reasoning"),
],
)
diff --git a/tests/unit/pipelex/plugins/openai/test_openai_completions_reasoning.py b/tests/unit/pipelex/plugins/openai/test_openai_completions_reasoning.py
index 8a68544be..b566a9707 100644
--- a/tests/unit/pipelex/plugins/openai/test_openai_completions_reasoning.py
+++ b/tests/unit/pipelex/plugins/openai/test_openai_completions_reasoning.py
@@ -12,6 +12,7 @@ _OPENAI_LEVEL_MAP: dict[str, str] = {
"low": "low",
"medium": "medium",
"high": "high",
+ "xhigh": "xhigh",
"max": "xhigh",
}
@@ -54,6 +55,7 @@ class TestOpenAICompletionsReasoning:
(ReasoningEffort.LOW, "low"),
(ReasoningEffort.MEDIUM, "medium"),
(ReasoningEffort.HIGH, "high"),
+ (ReasoningEffort.XHIGH, "xhigh"),
(ReasoningEffort.MAX, "xhigh"),
],
)
diff --git a/tests/unit/pipelex/plugins/openai/test_openai_responses_reasoning.py b/tests/unit/pipelex/plugins/openai/test_openai_responses_reasoning.py
index d43b58d48..e8ddb84ad 100644
--- a/tests/unit/pipelex/plugins/openai/test_openai_responses_reasoning.py
+++ b/tests/unit/pipelex/plugins/openai/test_openai_responses_reasoning.py
@@ -12,6 +12,7 @@ _OPENAI_LEVEL_MAP: dict[str, str] = {
"low": "low",
"medium": "medium",
"high": "high",
+ "xhigh": "xhigh",
"max": "xhigh",
}
@@ -54,6 +55,7 @@ class TestOpenAIResponsesReasoning:
(ReasoningEffort.LOW, "low"),
(ReasoningEffort.MEDIUM, "medium"),
(ReasoningEffort.HIGH, "high"),
+ (ReasoningEffort.XHIGH, "xhigh"),
(ReasoningEffort.MAX, "xhigh"),
],
)