mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-15 02:58:30 +00:00
Consistently storing async and sync output for context
This commit is contained in:
1804
tests/cassettes/test_async_execution_single_task.yaml
Normal file
1804
tests/cassettes/test_async_execution_single_task.yaml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -521,6 +521,36 @@ def test_async_task_execution_completion():
|
||||
)
|
||||
|
||||
|
||||
# TODO: Improve this test once I get feedback from Joao.
|
||||
@pytest.mark.vcr(filter_headers=["authorization"])
|
||||
def test_async_execution_single_task():
|
||||
from unittest.mock import patch
|
||||
|
||||
researcher_agent = Agent(
|
||||
role="Researcher",
|
||||
goal="Make the best research and analysis on content about AI and AI agents",
|
||||
backstory="You're an expert researcher, specialized in technology, software engineering, AI and startups. You work as a freelancer and is now working on doing research and analysis for a new customer.",
|
||||
allow_delegation=False,
|
||||
)
|
||||
|
||||
list_ideas = Task(
|
||||
description="Give me a list of 5 interesting ideas to explore for na article, what makes them unique and interesting.",
|
||||
expected_output="Bullet point list of 5 important events.",
|
||||
agent=researcher_agent,
|
||||
async_execution=True,
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[researcher_agent],
|
||||
process=Process.sequential,
|
||||
tasks=[list_ideas],
|
||||
)
|
||||
|
||||
result = crew.kickoff()
|
||||
print(result)
|
||||
assert result.final_output == ""
|
||||
|
||||
|
||||
# TODO: Make sure sync and async task execution keeps right order of expected outputs
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user