Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,8 +29,6 @@ deployment_name = "gpt-4o"
|
|
| 29 |
|
| 30 |
print(pyodbc.drivers())
|
| 31 |
|
| 32 |
-
st.title("Generate responses from SQL tables")
|
| 33 |
-
|
| 34 |
mapping = {'History_All_Skus_Availability': 'SKU Availability', \
|
| 35 |
'HISTORY_AVAVBAIL':'AV availability', \
|
| 36 |
'HISTORY_BUFamilyAvailability': 'Family and Business Unit (BU) availability', \
|
|
@@ -41,6 +39,8 @@ mapping = {'History_All_Skus_Availability': 'SKU Availability', \
|
|
| 41 |
'HISTORY_Sku_Shortage': 'SKU Shortage'}
|
| 42 |
inv_mapping = {val: key for (key,val) in mapping.items()}
|
| 43 |
|
|
|
|
|
|
|
| 44 |
template = """
|
| 45 |
|
| 46 |
You are a database expert. Given an input question, first create a syntactically correct {dialect} query to run, then look at the results of the query and return the answer.
|
|
@@ -164,7 +164,7 @@ if __name__ == '__main__':
|
|
| 164 |
if not check_password():
|
| 165 |
st.stop() # Do not continue if check_password is not True.
|
| 166 |
|
| 167 |
-
question = st.chat_input("
|
| 168 |
|
| 169 |
#if 'questions' not in st.session_state:
|
| 170 |
# st.session_state['questions'] = []
|
|
|
|
| 29 |
|
| 30 |
print(pyodbc.drivers())
|
| 31 |
|
|
|
|
|
|
|
| 32 |
mapping = {'History_All_Skus_Availability': 'SKU Availability', \
|
| 33 |
'HISTORY_AVAVBAIL':'AV availability', \
|
| 34 |
'HISTORY_BUFamilyAvailability': 'Family and Business Unit (BU) availability', \
|
|
|
|
| 39 |
'HISTORY_Sku_Shortage': 'SKU Shortage'}
|
| 40 |
inv_mapping = {val: key for (key,val) in mapping.items()}
|
| 41 |
|
| 42 |
+
st.title("Welcome to the Analysis GPT, we have the following tables - {}".format(",".join(list(inv_mapping.keys()))))
|
| 43 |
+
|
| 44 |
template = """
|
| 45 |
|
| 46 |
You are a database expert. Given an input question, first create a syntactically correct {dialect} query to run, then look at the results of the query and return the answer.
|
|
|
|
| 164 |
if not check_password():
|
| 165 |
st.stop() # Do not continue if check_password is not True.
|
| 166 |
|
| 167 |
+
question = st.chat_input("What is your question today? Type and press enter.")
|
| 168 |
|
| 169 |
#if 'questions' not in st.session_state:
|
| 170 |
# st.session_state['questions'] = []
|