From c596a71b0a7ad982e819cc20b4649c46be74e5c3 Mon Sep 17 00:00:00 2001 From: lorenzejay Date: Mon, 23 Mar 2026 11:42:15 -0700 Subject: [PATCH] linted --- lib/crewai/src/crewai/flow/human_feedback.py | 5 +++-- lib/crewai/src/crewai/llms/providers/bedrock/completion.py | 4 +++- lib/crewai/src/crewai/llms/providers/gemini/completion.py | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/crewai/src/crewai/flow/human_feedback.py b/lib/crewai/src/crewai/flow/human_feedback.py index 1c67ae973..9d00701b1 100644 --- a/lib/crewai/src/crewai/flow/human_feedback.py +++ b/lib/crewai/src/crewai/flow/human_feedback.py @@ -94,7 +94,9 @@ def _serialize_llm_for_context(llm: Any) -> dict[str, Any] | str | None: return f"{provider}/{model}" if provider and "/" not in model else model -def _deserialize_llm_from_context(llm_data: dict[str, Any] | str | None) -> BaseLLM | None: +def _deserialize_llm_from_context( + llm_data: dict[str, Any] | str | None, +) -> BaseLLM | None: """Reconstruct an LLM instance from serialized context data. Handles both the new dict format (with full config) and the legacy @@ -118,7 +120,6 @@ def _deserialize_llm_from_context(llm_data: dict[str, Any] | str | None) -> Base return None - @dataclass class HumanFeedbackResult: """Result from a @human_feedback decorated method. diff --git a/lib/crewai/src/crewai/llms/providers/bedrock/completion.py b/lib/crewai/src/crewai/llms/providers/bedrock/completion.py index a983acc6c..83b664d98 100644 --- a/lib/crewai/src/crewai/llms/providers/bedrock/completion.py +++ b/lib/crewai/src/crewai/llms/providers/bedrock/completion.py @@ -1897,7 +1897,9 @@ class BedrockCompletion(BaseLLM): # Anthropic (Claude) models reject assistant-last messages when # tools are in the request. Append a user message so the # Converse API accepts the payload. - elif "anthropic" in self.model.lower() or "claude" in self.model.lower(): + elif ( + "anthropic" in self.model.lower() or "claude" in self.model.lower() + ): converse_messages.append( { "role": "user", diff --git a/lib/crewai/src/crewai/llms/providers/gemini/completion.py b/lib/crewai/src/crewai/llms/providers/gemini/completion.py index d017644ad..6f40ef2d0 100644 --- a/lib/crewai/src/crewai/llms/providers/gemini/completion.py +++ b/lib/crewai/src/crewai/llms/providers/gemini/completion.py @@ -197,8 +197,8 @@ class GeminiCompletion(BaseLLM): else s for s in self.safety_settings ] - except Exception: - pass + except Exception: # noqa: S110 + pass # non-serializable safety_settings — omit from config return config def _initialize_client(self, use_vertexai: bool = False) -> genai.Client: