history.append(ChatMessage( role='assistant', content=(f"Here are all the details of the route:\n" f" Context: {route.higher_context}\n" f" Route: {route.route}\n" f" Method: {route.method}\n" f" Description: {route.description}\n" f" Request Body: {json.dumps(clean_request_body, indent=2)}\n" f" Parameters: {json.dumps(clean_parameters, indent=2) if route.parameters else 'None'}\n" f" Possible Responses: {json.dumps(clean_responses, indent=2)}\n").strip() )) logging.info(f"history: {history[-1].content}") function_llm = OpenAI(model="gpt-3.5-turbo") agent = OpenAIAgent.from_tools( None, llm=function_llm, verbose=True, system_prompt=( prompt ), chat_history=history, ) doc_tool = QueryEngineTool( query_engine=agent, metadata=ToolMetadata( name=f"{route.title()}", description=tool_summary, ), )