Fix trailing whitespace to satisfy ruff lint

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2025-10-20 19:30:30 +00:00
parent 36673f89e7
commit 32a013eb2f
2 changed files with 6 additions and 6 deletions

View File

@@ -289,22 +289,22 @@ class Crew(FlowTrackable, BaseModel):
cls, v: dict[str, Any] | None
) -> dict[str, Any] | None:
"""Normalize embedder config to support both flat and nested formats.
Args:
v: The embedder config to be normalized.
Returns:
The normalized embedder config with nested structure.
"""
if v is None or not isinstance(v, dict):
return v
if "provider" in v and "config" not in v:
provider = v["provider"]
config_fields = {k: val for k, val in v.items() if k != "provider"}
if config_fields:
return {"provider": provider, "config": config_fields}
return v
@field_validator("config", mode="before")

View File

@@ -230,7 +230,7 @@ def build_embedder_from_dict(spec):
Args:
spec: A dictionary with 'provider' and optionally 'config' keys.
Supports two formats:
Nested format (recommended):
{
"provider": "openai",
@@ -239,7 +239,7 @@ def build_embedder_from_dict(spec):
"model_name": "text-embedding-3-small"
}
}
Flat format (for backward compatibility):
{
"provider": "openai",