Skip to content

Commit

Permalink
improving types
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomdmoura committed Sep 13, 2024
1 parent 5f46a6d commit bd0e840
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/crewai/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
)
Expand Down
4 changes: 2 additions & 2 deletions src/crewai/agents/crew_agent_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(
task: Any,
crew: Any,
agent: Any,
prompt: str,
prompt: dict[str, str],
max_iter: int,
tools: List[Any],
tools_names: str,
Expand Down Expand Up @@ -260,5 +260,5 @@ def _format_prompt(self, prompt: str, inputs: Dict[str, str]) -> str:
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}
2 changes: 1 addition & 1 deletion src/crewai/cli/authentication/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def get_token(self) -> Optional[str]:
"""
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"])
Expand Down
2 changes: 1 addition & 1 deletion src/crewai/tasks/task_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def set_summary(self):
return self

@property
def json(self) -> Optional[str]:
def json(self) -> str:
if self.output_format != OutputFormat.JSON:
raise ValueError(
"""
Expand Down

0 comments on commit bd0e840

Please sign in to comment.