Hi everyone,
I followed the quickstart example and managed to run the workflow successfully, so I tried modifying it.
As I expect the Agent to interact with an internal API, I need to provide it additional prompts through system_template
, prompt_template
, and response_template
.
I started seeing errors once the prompts are specified in the arguments.
Error while using gpt-4o
:
Received None or empty response from LLM call.
An unknown error occurred. Please check the details below.
Error details: Invalid response from LLM call - None or empty.
An unknown error occurred. Please check the details below.
Error details: Invalid response from LLM call - None or empty.
Error while using gemini-1.5-pro
:
Error during LLM call: litellm.BadRequestError: VertexAIException BadRequestError - {
“error”: {
“code”: 400,
“message”: “Unable to submit request because it has a stopSequences value of 0 but the supported range is from 1 (inclusive) to 17 (exclusive). Update the value and try again.”,
“status”: “INVALID_ARGUMENT”
}
}
Both errors are cryptic, and I wasn’t sure which part where I might’ve made a mistake.
Despite transitioning to direct code definition of Agent, Task, and Crew, the error persists.
Pasting the full code definition here:
from crewai import Agent, Crew, Process, Task
from crewai_tools import SerperDevTool
researcher = Agent(
role="{topic} Senior Data Researcher",
goal="Uncover cutting-edge developments in {topic}",
backstory="""
You're a seasoned researcher with a knack for uncovering the latest developments in {topic}.
Known for your ability to find the most relevant information and present it in a clear and concise manner.
""",
verbose=True,
tools=[SerperDevTool()],
system_template="""
You're a seasoned researcher with a knack for uncovering the latest
developments in {topic}. Known for your ability to find the most relevant
information and present it in a clear and concise manner.
""",
prompt_template="""
Please research and summarize the latest developments in {topic} as of 2025.
""",
response_template="""
The results of research: {{ .Response }}
""",
use_system_prompt=True,
llm="gemini/gemini-1.5-pro"
)
reporting_analyst = Agent(
role="Reporting Analyst",
goal="Create detailed reports based on {topic} data analysis and research findings",
backstory="""
You're a meticulous analyst with a keen eye for detail.
You're known for your ability to turn complex data into clear and concise reports,
making it easy for others to understand and act on the information you provide.
""",
verbose=True
)
research_task = Task(
description="""
Conduct a thorough research about {topic}
Make sure you find any interesting and relevant information given the current year is 2025.
""",
expected_output="A list with 10 bullet points of the most relevant information about {topic}.",
agent=researcher
)
reporting_task = Task(
description="""
Review the context you got and expand each topic into a full section for a report.
Make sure the report is detailed and contains any and all relevant information.
""",
expected_output="""
A fully fledge reports with the mains topics, each with a full section of information.
Formatted as markdown without '```'
""",
agent=reporting_analyst,
output_file='output/report.md' # This is the file that will be contain the final report.
)
crew = Crew(
agents=[researcher,reporting_analyst],
tasks=[research_task,reporting_task],
process=Process.sequential,
verbose=True
)
Appreciate your guidance!