Spaces:
Build error
Build error
HassanSaado commited on
Commit ·
f140af3
1
Parent(s): ad6be74
Improved UI
Browse files24 unmodified lines252627282930313233343536373812 unmodified lines515253545556575824 unmodified linesagent_executor = create_sql_agent(llm, db=db, agent_type="openai-tools", verbose=False)#sidebarst.sidebar.title("SQL Chatbot")st.sidebar.write("This is a simple chatbot that can answer your SQL queries.")#list of the tables in databasetables = db.get_table_names()st.sidebar.write("Tables in the database:")st.sidebar.write(tables)yes_list = ["yes","Yes", "yes", "YES", "Y", "y","yues", "yeah", "sure", "yea", "ok", "okay", "fine", "cool", "alright", "yup", "yep", "ya", "ye"]def add_spaces_before_newline(input_string):modified_chars = []for char in input_string:12 unmodified linesanswer = agent_executor.invoke(query)return answer["output"]else:return """Welcome, I am a SQL chatbot. Please type a query in the chatbox to get started.To get started do you want me to provide you will the tables and their respective columns? Simply answer yes."""st.title("SQL Chatbot")24 unmodified lines25262728293031323334353637383940414243444512 unmodified lines585960616263646524 unmodified linesagent_executor = create_sql_agent(llm, db=db, agent_type="openai-tools", verbose=False)#sidebarst.sidebar.title("Chinook Database Chatbot")st.sidebar.write("""Use the chatbox to get information about the Chinook Database. Klick link to view the[Database Schema](https://blog.xojo.com/2016/04/13/the-chinook-sample-database/)""")#list of the tables in databasetables = db.get_table_names()st.sidebar.write("""**Example queries**:\n- Get the employees who have the most customers\n- Get the artist with the most albums \n- Show me the first 5 rows in the table 'Artist'\n- Get the most popular genre based on the number of tracks\n""")st.sidebar.write("**Tables in the database**:")st.sidebar.write(tables)yes_list = ["yes","Yes", "yes", "YES", "Y", "y","yues", "yeah", "sure", "yea", "ok", "okay", "fine", "cool", "alright", "yup", "yep", "ya", "ye"]def add_spaces_before_newline(input_string):modified_chars = []for char in input_string:12 unmodified linesanswer = agent_executor.invoke(query)return answer["output"]else:return """Welcome, I am a SQL chatbot that converts natural language into SQL queries.If you want the tables and column in the database, answer me with **yes** 😊"""st.title("SQL Chatbot")
app.py+12-5