diff --git a/src/crewai/agent.py b/src/crewai/agent.py index b631be8cb..9ee73e98b 100644 --- a/src/crewai/agent.py +++ b/src/crewai/agent.py @@ -98,7 +98,7 @@ class Agent(BaseAgent): allow_code_execution: Optional[bool] = Field( default=False, description="Enable code execution for the agent." ) - respect_context_window: Optional[bool] = Field( + respect_context_window: bool = Field( default=True, description="Keep messages under the context window size by summarizing content.", ) diff --git a/src/crewai/agents/crew_agent_executor.py b/src/crewai/agents/crew_agent_executor.py index 932711dcb..ccd82174d 100644 --- a/src/crewai/agents/crew_agent_executor.py +++ b/src/crewai/agents/crew_agent_executor.py @@ -24,7 +24,7 @@ class CrewAgentExecutor(CrewAgentExecutorMixin): task: Any, crew: Any, agent: Any, - prompt: str, + prompt: dict[str, str], max_iter: int, tools: List[Any], tools_names: str, @@ -260,5 +260,5 @@ class CrewAgentExecutor(CrewAgentExecutorMixin): def _format_answer(self, answer: str) -> str: return CrewAgentParser(agent=self.agent).parse(answer) - def _format_msg(self, prompt: str, role: str = "user") -> List[Dict[str, str]]: + def _format_msg(self, prompt: str, role: str = "user") -> Dict[str, str]: return {"role": role, "content": prompt} diff --git a/src/crewai/cli/authentication/utils.py b/src/crewai/cli/authentication/utils.py index 09e7491b1..2f5fc183f 100644 --- a/src/crewai/cli/authentication/utils.py +++ b/src/crewai/cli/authentication/utils.py @@ -79,7 +79,7 @@ class TokenManager: """ encrypted_data = self.read_secure_file(self.file_path) - decrypted_data = self.fernet.decrypt(encrypted_data) + decrypted_data = self.fernet.decrypt(encrypted_data) # type: ignore data = json.loads(decrypted_data) expiration = datetime.fromisoformat(data["expiration"]) diff --git a/src/crewai/tasks/task_output.py b/src/crewai/tasks/task_output.py index b0e8aecd4..d527f6fdb 100644 --- a/src/crewai/tasks/task_output.py +++ b/src/crewai/tasks/task_output.py @@ -35,7 +35,7 @@ class TaskOutput(BaseModel): return self @property - def json(self) -> Optional[str]: + def json(self) -> str: if self.output_format != OutputFormat.JSON: raise ValueError( """