Skip to content

Commit 422f9d9

Browse files
committed
style: solve linter issues
1 parent dbf4fd7 commit 422f9d9

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

src/crewai/agent.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from typing import (
66
Any,
77
Literal,
8+
cast,
89
)
910

1011
from pydantic import Field, InstanceOf, PrivateAttr, model_validator
@@ -326,7 +327,7 @@ def execute_task(
326327
agent=self,
327328
task=task,
328329
)
329-
memory = contextual_memory.build_context_for_task(task, context)
330+
memory = contextual_memory.build_context_for_task(task, context or "")
330331
if memory.strip() != "":
331332
task_prompt += self.i18n.slice("memory").format(memory=memory)
332333

@@ -578,7 +579,7 @@ def create_agent_executor(
578579
agent=self,
579580
crew=self.crew,
580581
tools=parsed_tools,
581-
prompt=prompt,
582+
prompt=cast(dict[str, str], prompt),
582583
original_tools=raw_tools,
583584
stop_words=stop_words,
584585
max_iter=self.max_iter,
@@ -600,9 +601,7 @@ def get_delegation_tools(self, agents: list[BaseAgent]):
600601

601602
def get_platform_tools(self, apps: list[PlatformAppOrAction]) -> list[BaseTool]:
602603
try:
603-
from crewai_tools import (
604-
CrewaiPlatformTools, # type: ignore
605-
)
604+
from crewai_tools import CrewaiPlatformTools # type: ignore[import-untyped]
606605

607606
return CrewaiPlatformTools(apps=apps)
608607
except Exception as e:

src/crewai/agents/agent_builder/base_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class BaseAgent(ABC, BaseModel):
8888
Abstract method to create an agent executor.
8989
get_delegation_tools(agents: list["BaseAgent"]):
9090
Abstract method to set the agents task tools for handling delegation and question asking to other agents in crew.
91-
get_platform_tools(apps: list[PlatformApp], actions: list[str]):
91+
get_platform_tools(apps: list[PlatformAppOrAction]):
9292
Abstract method to get platform tools for the specified list of applications and/or application/action combinations.
9393
get_output_converter(llm, model, instructions):
9494
Abstract method to get the converter class for the agent to create json/pydantic outputs.

src/crewai/crew.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@ def _add_platform_tools(
10801080
def _log_task_start(self, task: Task, role: str = "None"):
10811081
if self.output_log_file:
10821082
self._file_handler.log(
1083-
task_name=task.name, task=task.description, agent=role, status="started"
1083+
task_name=task.name or "unnamed_task", task=task.description, agent=role, status="started"
10841084
)
10851085

10861086
def _update_manager_tools(
@@ -1109,7 +1109,7 @@ def _process_task_result(self, task: Task, output: TaskOutput) -> None:
11091109
role = task.agent.role if task.agent is not None else "None"
11101110
if self.output_log_file:
11111111
self._file_handler.log(
1112-
task_name=task.name,
1112+
task_name=task.name or "unnamed_task",
11131113
task=task.description,
11141114
agent=role,
11151115
status="completed",

src/crewai/utilities/training_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
class CrewTrainingHandler(PickleHandler):
8-
def save_trained_data(self, agent_id: str, trained_data: dict[int, Any]) -> None:
8+
def save_trained_data(self, agent_id: str, trained_data: dict[str, Any]) -> None:
99
"""Save the trained data for a specific agent.
1010
1111
Args:

0 commit comments

Comments
 (0)