mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 16:18:30 +00:00
improving types
This commit is contained in:
@@ -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.",
|
||||
)
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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"])
|
||||
|
||||
@@ -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(
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user