I got a basic news report crew running after using this tutorial: https://www.youtube.com/watch?v=ONKOXwucLvE and it seems to be working somewhat but with some major issues.
Token limit of 2048
It looks like there is a max_token limit somewhere as I get this message in the server.log:
time=2024-12-29T12:00:38.943+01:00 level=WARN source=runner.go:129 msg="truncating input prompt" limit=2048 prompt=2527 keep=4 new=2048
I tried this: ollama_llm = LLM(model='ollama/granite3.1-dense',base_url='http://localhost:11434', max_tokens=8192)
and this:
@agent
def file_writer(self) -> Agent:
return Agent(
config=self.agents_config['file_writer'],
tools=[FileWriterTool()],
verbose=True,
max_tokens=8192,
llm=self.ollama_llm # ollama_llm, # tilføjet for Olama,
)
But i still get that same token limit of 2048, where else do I need to set it… perhaps it’s some basic OLLAMA limit but where do I set it?
The 2048 tolken limit seems to limit the amount of output a lot, links are cut off and
FileWriterTool
As you can see I also use the FileWriterTool, for some reason it does not fully work. Often it will create the file but with some short random text other times it will write a report, but it looks very cut off. Also there is a issue regarding the directory often the FileWriterTool will put the file in a directory called ‘None’ and always requires an existing sub directory (in my case one called ‘news’).
This is the agent and the task:
file_writer:
role: >
File Writer
goal: >
Write the report from the previous agents to a file using FileWriterTool
backstory: >
You'er a skilled file writer, an expert in writing unmodified reports to a file.
file_writer_task:
description: >
Using FileWriterTool write the output to a file '{date}_CAPnews.md' in the 'news' directory
expected_output: >
Write the output to a new file named '{date}_CAPnews.md' in the 'news' directory
agent: file_writer