mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 15:48:29 +00:00
added to docs and fixed tests
This commit is contained in:
@@ -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 <task_id>
|
||||
```
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
""")
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user