crewAIInc / crewAI-examples

2.6k stars 965 forks source link

Multiple LLMs will not trigger multiple agent execution calls and infinitely loop #142

Closed Nolanjue closed 1 month ago

Nolanjue commented 1 month ago

I'm not sure if this is stated in the docs, but currently running one agent with a specific model that has a tool which calls another agent(with a different model) will fail to do so and ends up in an infinite loop.

Also, does crewai Verbose thoughts and actions limited to the complexity of the model? certain models like phi3 are not able to even use tools(tested in LM studios).

ex: (i have not included the text inside each text bracket)

"agent using the function"


def new_task(agent):
        return Task(description=f"""
            """,
            agent=agent, 
            expected_output=""". """)

agent= Agent(role="",
            goal="""
                 """,
            backstory="""
                 """,
            tools=[Specific.choose_specific_action,],
            llm=ollama_llm,
            verbose = True,

)
upper_management = Crew(agents = [agent], tasks=[new_task(agent)],)

workflow = upper_management.kickoff()

print("final answer", workflow)

"agent inside the function(using openai LLM)"

class Specific():
    @tool("choose agent to generate a response")
    def choose_specific_action(query: str):
         """ """
         specific_agent = Agent(
          role='info agent',
          goal=
          """ """,
          backstory=
          """
            """,

          allow_delegation=False,
          tools = [RAGsearch],
         #llm = stable_code_llm,
         verbose = True,
          )

         task = Task(
               agent=easy_agent,
               description=
               f""" """,
               expected_output =""
            )
         summary = task.execute()
         print("agent response",summary)
         return summary

Is there a reason for these issues? Would be glad if anyone knew more, and is there a discord for crew ai :3?

Nolanjue commented 1 month ago

wrong repo, meant to post this in the crewaiinc. apologies.