Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
fix: stop forwarding strict mode to Bedrock Converse API
Greyson LaLonde94e7d86df190
diff --git a/lib/crewai/src/crewai/llms/providers/bedrock/completion.py b/lib/crewai/src/crewai/llms/providers/bedrock/completion.pyindex 5932b66f0..54c222c85 100644--- a/lib/crewai/src/crewai/llms/providers/bedrock/completion.py+++ b/lib/crewai/src/crewai/llms/providers/bedrock/completion.py@@ -17,10 +17,7 @@ from crewai.utilities.agent_utils import is_context_length_exceededfrom crewai.utilities.exceptions.context_window_exceeding_exception import (LLMContextLengthExceededError,)-from crewai.utilities.pydantic_schema_utils import (- generate_model_description,- sanitize_tool_params_for_bedrock_strict,-)+from crewai.utilities.pydantic_schema_utils import generate_model_descriptionfrom crewai.utilities.types import LLMMessage@@ -173,7 +170,6 @@ class ToolSpec(TypedDict, total=False):name: Required[str]description: Required[str]inputSchema: ToolInputSchema- strict: boolclass ConverseToolTypeDef(TypedDict):@@ -1988,21 +1984,10 @@ class BedrockCompletion(BaseLLM):"description": description,}- func_info = tool.get("function", {})- strict_enabled = bool(func_info.get("strict"))-if parameters and isinstance(parameters, dict):- schema_params = (- sanitize_tool_params_for_bedrock_strict(parameters)- if strict_enabled- else parameters- )- input_schema: ToolInputSchema = {"json": schema_params}+ input_schema: ToolInputSchema = {"json": parameters}tool_spec["inputSchema"] = input_schema- if strict_enabled:- tool_spec["strict"] = True-converse_tool: ConverseToolTypeDef = {"toolSpec": tool_spec}converse_tools.append(converse_tool)