Replies: 5 comments
-
@HariNuve I believe If this does'nt solve the issue pls drop the error after execution. |
Beta Was this translation helpful? Give feedback.
-
@HariNuve what's the output you are getting and what's the format you expect? |
Beta Was this translation helpful? Give feedback.
-
@pravincoder Changing the url to http://localhost:11434/v1 didn't worked,experienced an error as follows :
|
Beta Was this translation helpful? Give feedback.
-
@zinyando Iam expecting breaking down complex questions into simple sub questions.What iam getting is answer to those questions |
Beta Was this translation helpful? Give feedback.
-
@HariNuve I think your issue is related to your prompts not being clear enough for the LLM. I played around with it and got it working. You can definitely improve the output. from crewai import Agent, Task, Crew
from langchain.llms import Ollama
import os
os.environ["OPENAI_API_KEY"] = "NA"
llm = Ollama(model="llama3.1", base_url="http://localhost:11434")
general_agent = Agent(
role="Sub Question Generator",
goal="""Break a complex question in to multiple simple sub-questions""",
backstory="""You are an excellent english professor able to modify complex question into multiple simple questions in a way that everyone can understand.Do not Answer corresponding to any of the questions""",
allow_delegation=False,
verbose=True,
llm=llm,
)
question = "What is Multiple Sclerosis and what are the symptoms in young adults"
task = Task(
description=f"Break the following complex question into multiple simple sub-questions: {question}",
agent=general_agent,
expected_output="A breakdown of the question without answering it clearly formatted as markdown.",
)
crew = Crew(agents=[general_agent], tasks=[task], verbose=2)
result = crew.kickoff(
inputs={"question": question},
)
print(result) Be sure to set the Ollama agent to the one you want to use. An example output I got is below
Just so you know, I think these type of questions are better suited to be posted in Discord and not on GitHub issues. You can join it here Join CrewAI Discord |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
My requirement was use CrewAI to build an agent able to breakdown Complex input Questions into simple sub questions.I have followed as per the instructions and maintaing agent's structure specified in your documentation page.But failed to perform as per my requirements.failed sample code is as follows:
Beta Was this translation helpful? Give feedback.
All reactions