mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 16:48:30 +00:00
Add in missing triple quote and execution time to resume agent functionality. (#1025)
* Add in missing triple quote and execution time to resume agent functionality * Fixing broken kwargs and other issues causing our tests to fail
This commit is contained in:
committed by
GitHub
parent
b8ff35f076
commit
134be4984b
@@ -8,7 +8,6 @@ from unittest.mock import MagicMock, patch
|
||||
|
||||
import pydantic_core
|
||||
import pytest
|
||||
|
||||
from crewai.agent import Agent
|
||||
from crewai.agents.cache import CacheHandler
|
||||
from crewai.crew import Crew
|
||||
@@ -572,47 +571,6 @@ def test_api_calls_throttling(capsys):
|
||||
moveon.assert_called()
|
||||
|
||||
|
||||
# This test is not consistent, some issue is happening on the CI when it comes to Prompt tokens
|
||||
# {'usage_metrics': {'completion_tokens': 34, 'prompt_tokens': 0, 'successful_requests': 2, 'total_tokens': 34}} CI OUTPUT
|
||||
# {'usage_metrics': {'completion_tokens': 34, 'prompt_tokens': 314, 'successful_requests': 2, 'total_tokens': 348}}
|
||||
# The issue might be related to the calculate_usage_metrics function
|
||||
# @pytest.mark.vcr(filter_headers=["authorization"])
|
||||
# def test_crew_full_output():
|
||||
# agent = Agent(
|
||||
# role="test role",
|
||||
# goal="test goal",
|
||||
# backstory="test backstory",
|
||||
# allow_delegation=False,
|
||||
# verbose=True,
|
||||
# )
|
||||
|
||||
# task1 = Task(
|
||||
# description="just say hi!",
|
||||
# expected_output="your greeting",
|
||||
# agent=agent,
|
||||
# )
|
||||
# task2 = Task(
|
||||
# description="just say hello!",
|
||||
# expected_output="your greeting",
|
||||
# agent=agent,
|
||||
# )
|
||||
|
||||
# crew = Crew(agents=[agent], tasks=[task1, task2], full_output=True)
|
||||
|
||||
# result = crew.kickoff()
|
||||
|
||||
# assert result == {
|
||||
# "final_output": "Hello!",
|
||||
# "tasks_outputs": [task1.output, task2.output],
|
||||
# "usage_metrics": {
|
||||
# "total_tokens": 348,
|
||||
# "prompt_tokens": 314,
|
||||
# "completion_tokens": 34,
|
||||
# "successful_requests": 2,
|
||||
# },
|
||||
# }
|
||||
|
||||
|
||||
@pytest.mark.vcr(filter_headers=["authorization"])
|
||||
def test_crew_kickoff_usage_metrics():
|
||||
inputs = [
|
||||
|
||||
Reference in New Issue
Block a user