diff --git a/docs/core-concepts/Crews.md b/docs/core-concepts/Crews.md index 3687f3ab3..43c190573 100644 --- a/docs/core-concepts/Crews.md +++ b/docs/core-concepts/Crews.md @@ -170,6 +170,13 @@ To use the replay feature, follow these steps: 2. Navigate to the directory where your CrewAI project is located. 3. Run the following command: +To view latest kickoff task_ids use: + +```shell +crewai log-tasks-outputs +``` + + ```shell crewai replay -t ``` diff --git a/src/crewai/agent.py b/src/crewai/agent.py index e24bd9d27..bfe980813 100644 --- a/src/crewai/agent.py +++ b/src/crewai/agent.py @@ -5,7 +5,6 @@ from typing import Any, List, Optional, Tuple from langchain.agents.agent import RunnableAgent from langchain.agents.tools import BaseTool from langchain.agents.tools import tool as LangChainTool -from langchain.tools.base import StructuredTool from langchain_core.agents import AgentAction from langchain_core.callbacks import BaseCallbackHandler from langchain_openai import ChatOpenAI @@ -299,7 +298,7 @@ class Agent(BaseAgent): agent=RunnableAgent(runnable=inner_agent), **executor_args ) - def get_delegation_tools(self, agents: List[BaseAgent]) -> List[StructuredTool]: + def get_delegation_tools(self, agents: List[BaseAgent]): agent_tools = AgentTools(agents=agents) tools = agent_tools.tools() return tools diff --git a/src/crewai/memory/storage/kickoff_task_outputs_storage.py b/src/crewai/memory/storage/kickoff_task_outputs_storage.py index a850714cf..a99232c8d 100644 --- a/src/crewai/memory/storage/kickoff_task_outputs_storage.py +++ b/src/crewai/memory/storage/kickoff_task_outputs_storage.py @@ -14,7 +14,7 @@ class KickoffTaskOutputsSQLiteStorage: """ def __init__( - self, db_path: str = f"{db_storage_path()}/kickoff_task_outputs.db" + self, db_path: str = f"{db_storage_path()}/long_term_memory_storage.dbs" ) -> None: self.db_path = db_path self._printer: Printer = Printer() @@ -126,7 +126,7 @@ class KickoffTaskOutputsSQLiteStorage: with sqlite3.connect(self.db_path) as conn: cursor = conn.cursor() cursor.execute(""" - SELECT task_id, expected_output, output, task_index, inputs, was_replayed, timestamp + SELECT * FROM latest_kickoff_task_outputs ORDER BY task_index """) diff --git a/tests/crew_test.py b/tests/crew_test.py index 064c18d1a..543a16509 100644 --- a/tests/crew_test.py +++ b/tests/crew_test.py @@ -1236,10 +1236,10 @@ def test_agent_usage_metrics_are_captured_for_hierarchical_process(): print(crew.usage_metrics) assert crew.usage_metrics == { - "total_tokens": 2217, - "prompt_tokens": 1847, - "completion_tokens": 370, - "successful_requests": 4, + "total_tokens": 311, + "prompt_tokens": 224, + "completion_tokens": 87, + "successful_requests": 1, }