From 11a3d4b8401159b4c8d6bb150aca3cc0ef4ced0b Mon Sep 17 00:00:00 2001 From: Eduardo Chiarotti Date: Mon, 9 Dec 2024 11:42:36 -0300 Subject: [PATCH 1/4] docs: Add quotes to agentops installing command (#1729) * docs: Add quotes to agentops installing command * feat: Add ContextualMemory to __init__ * feat: remove import due to circular improt * feat: update tasks config main template typos --- docs/how-to/agentops-observability.mdx | 2 +- src/crewai/cli/templates/crew/config/tasks.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/how-to/agentops-observability.mdx b/docs/how-to/agentops-observability.mdx index ce50d1fc5..b6ade320e 100644 --- a/docs/how-to/agentops-observability.mdx +++ b/docs/how-to/agentops-observability.mdx @@ -57,7 +57,7 @@ This feature is useful for debugging and understanding how agents interact with Install AgentOps with: ```bash - pip install crewai[agentops] + pip install 'crewai[agentops]' ``` or ```bash diff --git a/src/crewai/cli/templates/crew/config/tasks.yaml b/src/crewai/cli/templates/crew/config/tasks.yaml index f30820855..e6c0870a2 100644 --- a/src/crewai/cli/templates/crew/config/tasks.yaml +++ b/src/crewai/cli/templates/crew/config/tasks.yaml @@ -12,6 +12,6 @@ reporting_task: Review the context you got and expand each topic into a full section for a report. Make sure the report is detailed and contains any and all relevant information. expected_output: > - A fully fledge reports with the mains topics, each with a full section of information. + A fully fledged report with the main topics, each with a full section of information. Formatted as markdown without '```' agent: reporting_analyst From bc2a86d66a6ecd53e3524de52a3d0f287c258f28 Mon Sep 17 00:00:00 2001 From: Frieda Huang <124417784+frieda-huang@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:05:54 -0500 Subject: [PATCH 2/4] Fixed output_file not respecting system path (#1726) Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com> --- src/crewai/task.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/crewai/task.py b/src/crewai/task.py index af5b34c54..cedb73c09 100644 --- a/src/crewai/task.py +++ b/src/crewai/task.py @@ -1,6 +1,6 @@ import datetime import json -import os +from pathlib import Path import threading import uuid from concurrent.futures import Future @@ -393,12 +393,13 @@ class Task(BaseModel): if self.output_file is None: raise ValueError("output_file is not set.") - directory = os.path.dirname(self.output_file) # type: ignore # Value of type variable "AnyOrLiteralStr" of "dirname" cannot be "str | None" + resolved_path = Path(self.output_file).expanduser().resolve() + directory = resolved_path.parent - if directory and not os.path.exists(directory): - os.makedirs(directory) + if not directory.exists(): + directory.mkdir(parents=True, exist_ok=True) - with open(self.output_file, "w", encoding="utf-8") as file: + with resolved_path.open("w", encoding="utf-8") as file: if isinstance(result, dict): import json From 46be5e8097a4e18fd9ab05e630b784658e7da2a6 Mon Sep 17 00:00:00 2001 From: Archkon <180910180+Archkon@users.noreply.github.com> Date: Mon, 9 Dec 2024 23:53:55 +0800 Subject: [PATCH 3/4] fix:typo error (#1732) * Update crew_agent_executor.py typo error * Update en.json typo error --- src/crewai/agents/crew_agent_executor.py | 2 +- src/crewai/translations/en.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crewai/agents/crew_agent_executor.py b/src/crewai/agents/crew_agent_executor.py index 00545e760..649360e30 100644 --- a/src/crewai/agents/crew_agent_executor.py +++ b/src/crewai/agents/crew_agent_executor.py @@ -299,7 +299,7 @@ class CrewAgentExecutor(CrewAgentExecutorMixin): self._i18n.slice("summarizer_system_message"), role="system" ), self._format_msg( - self._i18n.slice("sumamrize_instruction").format(group=group), + self._i18n.slice("summarize_instruction").format(group=group), ), ], callbacks=self.callbacks, diff --git a/src/crewai/translations/en.json b/src/crewai/translations/en.json index d30606dc0..7353cfc33 100644 --- a/src/crewai/translations/en.json +++ b/src/crewai/translations/en.json @@ -19,7 +19,7 @@ "human_feedback": "You got human feedback on your work, re-evaluate it and give a new Final Answer when ready.\n {human_feedback}", "getting_input": "This is the agent's final answer: {final_answer}\n\n", "summarizer_system_message": "You are a helpful assistant that summarizes text.", - "sumamrize_instruction": "Summarize the following text, make sure to include all the important information: {group}", + "summarize_instruction": "Summarize the following text, make sure to include all the important information: {group}", "summary": "This is a summary of our conversation so far:\n{merged_summary}", "manager_request": "Your best answer to your coworker asking you this, accounting for the context shared.", "formatted_task_instructions": "Ensure your final answer contains only the content in the following format: {output_format}\n\nEnsure the final output does not include any code block markers like ```json or ```python.", From e01c0a0f4cc2990c5a772040917fad8014414a71 Mon Sep 17 00:00:00 2001 From: Aviral Jain Date: Mon, 9 Dec 2024 21:37:52 +0530 Subject: [PATCH 4/4] call storage.search in user context search instead of memory.search (#1692) Co-authored-by: Eduardo Chiarotti --- src/crewai/memory/user/user_memory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crewai/memory/user/user_memory.py b/src/crewai/memory/user/user_memory.py index 25e36617c..24e5fe035 100644 --- a/src/crewai/memory/user/user_memory.py +++ b/src/crewai/memory/user/user_memory.py @@ -37,7 +37,7 @@ class UserMemory(Memory): limit: int = 3, score_threshold: float = 0.35, ): - results = super().search( + results = self.storage.search( query=query, limit=limit, score_threshold=score_threshold,