mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-02 13:48:09 +00:00
linted
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user