The crew is chugging along then it failed
> Entering new CrewAgentExecutor chain...
Action: Ask question to co-worker
Action Input: {
"question": "Can you provide me with the key facts about the new iPad Air from Apple?",
"context": "The new iPad Air is available in new blue and purple finishes, along with starlight and space gray. Customers can order the new iPad Air today, with availability beginning Wednesday, May 15."
}
Action: Delegate work to co-worker
Action Input: {
"task": "Verify the accuracy of the AI Information Researcher report for Apple Inc.(Stock code :AAPL).",
"context": "The new iPad Air is available in new blue and purple finishes, along with starlight and space gray. Customers can order the new iPad Air today, with availability beginning Wednesday, May 15."
}
Thought: After getting the key facts from the co-worker, I will cross-check them against authoritative references to confirm factual correctness.Thought: To begin, let's ask the Information Researcher for the key facts about the new iPad Air from Apple.
Action: Ask question to co-worker
Action Input: {
"question": "Can you provide me with the key facts about the new iPad Air from Apple?",
"context": "The new iPad Air is available in new blue and purple finishes, along with starlight and space gray. Customers can order the new iPad Air today, with availability beginning Wednesday, May 15."
}
Thought: Once we have the key facts, I'll delegate a task to the co-worker to verify their accuracy.Thought: Let's correct the input and proceed with the actions.
Action: Ask question to co-worker
Action Input: {
"question": "Can you provide me with the key facts about the new iPad Air from Apple?",
"context": "The new iPad Air is available in new blue and purple finishes, along with starlight and space gray. Customers can order the new iPad Air today, with availability beginning Wednesday, May 15."
}
I encountered an error while trying to use the tool. This was the error: 'NoneType' object has no attribute 'startswith'.
Tool Ask question to co-worker accepts these inputs: Ask question to co-worker(question: str, context: str, coworker: Optional[str] = None, **kwargs) - Ask a specific question to one of the following co-workers: [Information Researcher]
The input to this tool should be the co-worker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don't reference things but instead explain them.
Code
from crewai import Agent, Task, Crew, Process
from langchain_community.tools import DuckDuckGoSearchRun
from crewai.tasks.task_output import TaskOutput
from langchain.agents import Tool
from langchain_community.llms import Ollama
mistral_client = Ollama(model="openhermes")
research_topic = "Apple Inc.(Stock code :AAPL)"
#Solve the spelling mistake in "search\_tool" on mistral ai**
search = DuckDuckGoSearchRun()
search_tool = Tool(
name="search\_tool",
description="A search tool used to query DuckDuckGo for search results when trying to find information from the internet.",
func=search.run
)
def search_result_callback(output: TaskOutput):
if output.result is not None:
print("Search task completed successfully!")
print("Search Results:\n", output.result)
else:
print("Search task failed to produce output.")
# Define agents with specific roles and tools
researcher = Agent(
role='Information Researcher',
goal=f'Search the internet for the latest news , announcement about {research_topic} with accurate sourcing.',
backstory="""As a Researcher, passionate and knowledgable about technology industry's forefront, you meticulously gather and verify the latest business trend and products developments. Your quest for truth requires verifying the authenticity of information, ensuring a credible knowledge base for informed decision-making.""",
verbose=True,
llm=mistral_client
)
fact_checker = Agent(
role='Information Fact Checker',
goal="Provide judgement to AI Information Researcher findings on the credibility of the information by 'True' or 'False' or 'unknown'.",
backstory="""As the guardian of truth, you critically assess the AI Information Researcher's data for accuracy by cross check from internet. Your expertise ensures the integrity and credibility of information shared, maintaining a standard of trustworthiness in a data-saturated world.""",
verbose=True,
llm=mistral_client
)
# Create tasks for the agents
research_task = Task(
description=f'Search 3 topic for the latest news {research_topic} within May of 2024, ensuring all data is backed by credible sources. Compile a report detailing each finding and its source for verification.',
expected_output=f'Summary of 3 latest news on {research_topic} from May 2024 with credible sources.',
tools=[search_tool],
agent=researcher,
callback=search_result_callback
)
fact_checker_task = Task(
description=f'Verify the accuracy of the AI Information Researcher report for {research_topic}. Cross-check all cited sources against authoritative references to confirm factual correctness, highlighting any inaccuracies or areas needing further verification.',
expected_output=f'Verification report on {research_topic} with accuracy assessment and source validation.',
tools=[search_tool],
agent=fact_checker
)
# Assemble the crew with a sequential process
my_crew = Crew(
agents=[researcher, fact_checker],
tasks=[research_task, fact_checker_task],
process=Process.sequential,
verbose=2,
)
# Start the crew's task execution
result = my_crew.kickoff()
print(result)
I also tired llama3 or gemma using Ollama also failed.
> Entering new CrewAgentExecutor chain...
Thought: I need to search for the latest news about Apple Inc. (Stock code: AAPL) within May 2024. To ensure accuracy and credibility, I will rely on reputable sources.
Action: search_tool
Action Input: {"q": "latest news apple inc aapl may 2024", "source": "reputationNo good DuckDuckGo Search Result was found
No good DuckDuckGo Search Result was found
Thought:
It seems that the initial search did not yield any satisfactory results. Since I need to rely on reputable sources for accurate information, I will delegate the task of searching for credible news articles about Apple Inc. (Stock code: AAPL) within May 2024 to my co-worker.
Action: Delegate work to co-worker
Action Input: {"task": "search latest news apple inc aapl may 2024", "context": "Apple Inc.'s stock code is AAPL, and I'm looking for credible sources from reputable news outlets. The timeframe is within May 2024.", "coworker": "Information Fact Checker
Error executing tool. Co-worker mentioned not found, it must to be one of the following options:
- information fact checker
It seems that I made a mistake by trying to delegate a task to an incorrect co-worker. Let me try again.
Thought:
I will ask my Information Fact Checker co-worker for help in searching for credible news articles about Apple Inc. (Stock code: AAPL) within May 2024.
Action: Ask question to co-worker
Action Input: {"question": "Can you please find the latest news articles about Apple Inc. (Stock code: AAPL) from reputable sources, focusing on the timeframe of May 2024?", "context": "Apple's stock code is AAPL, and I'm looking for credible sources from reliable news outlets."
I encountered an error while trying to use the tool. This was the error: 'NoneType' object has no attribute 'startswith'.
Tool Ask question to co-worker accepts these inputs: Ask question to co-worker(question: str, context: str, coworker: Optional[str] = None, **kwargs) - Ask a specific question to one of the following co-workers: [Information Fact Checker]
The input to this tool should be the co-worker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don't reference things but instead explain them.
The crew is chugging along then it failed
Code
I also tired
llama3orgemmausing Ollama also failed.