should be the user question."""retriever_tool = create_retriever_tool(        retriever,        name='sql_get_similar_examples',        description=tool_description    )custom_tool_list = [retriever_tool]Now we can create the agent, adjusting the standard SQL Agent suffix to consider our use case. Although the most straightforward way to handle this would be to include it just in the tool description, this is often not enough and we need to specify it in the agent prompt using the suffix argument in the constructor.from langchain.agents import create_sql_agent, AgentTypefrom langchain.agents.agent_toolkits import SQLDatabaseToolkitfrom langchain.utilities import SQLDatabasefrom langchain.chat_models import ChatOpenAIdb = SQLDatabase.from_uri("sqlite:///Chinook.db")llm = ChatOpenAI(model_name='gpt-4',temperature=0)toolkit = SQLDatabaseToolkit(db=db, llm=llm)custom_suffix = """I should first get the similar examples I know.If the examples are enough to construct the query, I can build it.Otherwise, I can then look at the tables in the database to see what I can query.Then I should query the schema of the most relevant tables"""agent = create_sql_agent(llm=llm,                         toolkit=toolkit,                         verbose=True,                         agent_type=AgentType.OPENAI_FUNCTIONS,                         extra_tools=custom_tool_list,                         suffix=custom_suffix                        )Let's try it out:agent.run("How many employees do we have?")            > Entering new AgentExecutor chain...        Invoking: `sql_get_similar_examples` with `How many employees do we have?`            [Document(page_content='How many employees are there', metadata={'sql_query': 'SELECT COUNT(*) FROM "employee"'}), Document(page_content='Find the total number of invoices.', metadata={'sql_query': 'SELECT COUNT(*) FROM invoices;'})]    Invoking: `sql_db_query_checker` with `SELECT COUNT(*) FROM employee`    responded: {content}        SELECT COUNT(*)
Open In Colab
Open In Colab ->: should be the user question."""retriever_tool = create_retriever_tool(        retriever,        name='sql_get_similar_examples',        description=tool_description    )custom_tool_list = [retriever_tool]Now we can create the agent, adjusting the standard SQL Agent suffix to consider our use case. Although the most straightforward way to handle this would be to include it just in the tool description, this is often not enough and we need to specify it in the agent prompt using the suffix argument in the constructor.from langchain.agents import create_sql_agent, AgentTypefrom langchain.agents.agent_toolkits import SQLDatabaseToolkitfrom langchain.utilities import SQLDatabasefrom langchain.chat_models import ChatOpenAIdb = SQLDatabase.from_uri("sqlite:///Chinook.db")llm = ChatOpenAI(model_name='gpt-4',temperature=0)toolkit = SQLDatabaseToolkit(db=db, llm=llm)custom_suffix = """I should first get the similar examples I know.If the examples are enough to construct the query, I can build it.Otherwise, I can then look at the tables in the database to see what I can query.Then I should query the schema of the most relevant tables"""agent = create_sql_agent(llm=llm,                         toolkit=toolkit,                         verbose=True,                         agent_type=AgentType.OPENAI_FUNCTIONS,                         extra_tools=custom_tool_list,                         suffix=custom_suffix                        )Let's try it out:agent.run("How many employees do we have?")            > Entering new AgentExecutor chain...        Invoking: `sql_get_similar_examples` with `How many employees do we have?`            [Document(page_content='How many employees are there', metadata={'sql_query': 'SELECT COUNT(*) FROM "employee"'}), Document(page_content='Find the total number of invoices.', metadata={'sql_query': 'SELECT COUNT(*) FROM invoices;'})]    Invoking: `sql_db_query_checker` with `SELECT COUNT(*) FROM employee`    responded: {content}        SELECT COUNT(*)