Description
Description
if llm := agent_info.get("llm"):
AttributeError: 'list' object has no attribute 'get'
This error occurs in the "map_all_agent_variables()" function in crew_base.py.
Steps to Reproduce
- create agents.yaml file and crew.py file
- list agents in dictionary format
- run
crew run kickoff
Expected behavior
To map the llm to the agent
Screenshots/Code snippets
THIS IS FROM CREW.PY.
`from crewai import Agent, Crew, Process, Task, LLM
from crewai.project import CrewBase, agent, crew, task
from dotenv import load_dotenv
import os
load_dotenv()
llm = LLM(
model="ollama/qwen2.5-coder:3b", # REQUIRED provider prefix format
temperature=0.7,
max_tokens=2000,
top_p=0.9,
base_url=os.getenv("OLLAMA_API_BASE")
)
@crewbase
class GameCreatorCrew():
"""Crew responsible for generating HTML5 roguelike platformer games"""
agents_config = 'config/agents.yaml'
tasks_config = 'config/tasks.yaml'
@agent
def game_designer(self) -> Agent:
return Agent(
config=self.agents_config['game_designer'],
llm=llm,
verbose=True
)
`
agents.yaml is formatted like this:
`game_designer:
- name: game_designer
role: Game Designer
llm:
base_url: "http://localhost:11434/v1"
model: "qwen2.5-coder:3b"
temperature: 0.7
top_p: 0.8
goal: Design compelling roguelike platformer game concepts with engaging mechanics
backstory: >
You are an expert game designer specializing in roguelike and platformer games.
You have a deep understanding of procedural generation, character progression systems,
and level design for platformers. Your designs are known for their addictive gameplay loops
and balanced difficulty curves.
verbose: true
allow_delegation: false
game_developer:` ... etc.
Operating System
macOS Catalina
Python Version
3.12
crewAI Version
0.108.0
crewAI Tools Version
0.32.1
Virtual Environment
Venv
Evidence
Possible Solution
None
Additional context
N/A