[Python] Agent going into the loop when using the gpt-4 mode with azureopen AI [closed]

Discussão em 'Python' iniciado por Stack, Março 27, 2025.

  1. Stack

    Stack Membro Participativo

    I'm using the AzureOpenAI as llm in this and the issue I face that my sql_db_agent give response correctly but some time it goes into the loop and can't give response or we can say that it exit due to max_iterations. what are the cause of this and what should be the possible solution of this!

    def sql_agent(self, llm):
    from . import db
    sql_toolkit = SQLDatabaseToolkit(db=db, llm=llm)
    sql_toolkit.get_tools()
    if self.model.lower() in ['gpt4', 'gpt-4', 'gpt_4']:
    sqldb_agent = create_sql_agent(llm=llm, toolkit=sql_toolkit, agent_type = AgentType.ZERO_SHOT_REACT_DESCRIPTION, agent_executor_kwargs={'handle_parsing_errors': True, 'return_intermediate_steps': True}, verbose=True, max_execution_time=200, max_iterations=500 )

    Continue reading...

Compartilhe esta Página