mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
Fix lint issues: remove trailing whitespace from docstring
Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
@@ -309,27 +309,27 @@ class Crew(FlowTrackable, BaseModel):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def validate_embedder_config(cls, v: Any) -> Any:
|
def validate_embedder_config(cls, v: Any) -> Any:
|
||||||
"""Validates embedder configuration and provides clear error messages.
|
"""Validates embedder configuration and provides clear error messages.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
v: The embedder configuration to be validated.
|
v: The embedder configuration to be validated.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The embedder config if it is valid.
|
The embedder config if it is valid.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
PydanticCustomError: If the embedder configuration is invalid,
|
PydanticCustomError: If the embedder configuration is invalid,
|
||||||
with a clear, helpful error message.
|
with a clear, helpful error message.
|
||||||
"""
|
"""
|
||||||
if v is None:
|
if v is None:
|
||||||
return v
|
return v
|
||||||
|
|
||||||
if not isinstance(v, dict):
|
if not isinstance(v, dict):
|
||||||
return v
|
return v
|
||||||
|
|
||||||
provider = v.get("provider")
|
provider = v.get("provider")
|
||||||
if not provider:
|
if not provider:
|
||||||
return v
|
return v
|
||||||
|
|
||||||
valid_providers = [
|
valid_providers = [
|
||||||
"azure",
|
"azure",
|
||||||
"amazon-bedrock",
|
"amazon-bedrock",
|
||||||
@@ -350,7 +350,7 @@ class Crew(FlowTrackable, BaseModel):
|
|||||||
"voyageai",
|
"voyageai",
|
||||||
"watsonx",
|
"watsonx",
|
||||||
]
|
]
|
||||||
|
|
||||||
if provider not in valid_providers:
|
if provider not in valid_providers:
|
||||||
raise PydanticCustomError(
|
raise PydanticCustomError(
|
||||||
"invalid_embedder_provider",
|
"invalid_embedder_provider",
|
||||||
@@ -361,7 +361,7 @@ class Crew(FlowTrackable, BaseModel):
|
|||||||
),
|
),
|
||||||
{},
|
{},
|
||||||
)
|
)
|
||||||
|
|
||||||
providers_requiring_config = [
|
providers_requiring_config = [
|
||||||
"google-generativeai",
|
"google-generativeai",
|
||||||
"google-vertex",
|
"google-vertex",
|
||||||
@@ -371,7 +371,7 @@ class Crew(FlowTrackable, BaseModel):
|
|||||||
"text2vec",
|
"text2vec",
|
||||||
"voyageai",
|
"voyageai",
|
||||||
]
|
]
|
||||||
|
|
||||||
if provider in providers_requiring_config and "config" not in v:
|
if provider in providers_requiring_config and "config" not in v:
|
||||||
example_config = {}
|
example_config = {}
|
||||||
if provider == "google-generativeai":
|
if provider == "google-generativeai":
|
||||||
@@ -406,7 +406,7 @@ class Crew(FlowTrackable, BaseModel):
|
|||||||
"model_name": "your_model_name",
|
"model_name": "your_model_name",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
raise PydanticCustomError(
|
raise PydanticCustomError(
|
||||||
"invalid_embedder_config_structure",
|
"invalid_embedder_config_structure",
|
||||||
(
|
(
|
||||||
@@ -417,7 +417,7 @@ class Crew(FlowTrackable, BaseModel):
|
|||||||
),
|
),
|
||||||
{},
|
{},
|
||||||
)
|
)
|
||||||
|
|
||||||
return v
|
return v
|
||||||
|
|
||||||
@model_validator(mode="after")
|
@model_validator(mode="after")
|
||||||
|
|||||||
Reference in New Issue
Block a user