Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -274,7 +274,9 @@ def build_prompt(df):
|
|
| 274 |
Use the following workflow to solve user queries. do not provide sql inputs to the sql tool - you only need to ask in natural language what information you need.
|
| 275 |
- If at any point you cannot determine the next steps - defer to human. you do not have clearance to go beyond the scope the following flow.
|
| 276 |
You are only allowed to provide information relevant to the particular customer. Following is the information about the customer from the last 2 weeks:
|
|
|
|
| 277 |
{df}
|
|
|
|
| 278 |
If this information is not enough, fetch necessary information usign the sql_tool.
|
| 279 |
|
| 280 |
### **Workflow:**
|
|
@@ -306,6 +308,8 @@ def build_prompt(df):
|
|
| 306 |
- You cannot change shipping orders of orders that are already delivered or cancelled.
|
| 307 |
- Retrieve necessary details.
|
| 308 |
- Update the shipping address with `change_address`.
|
|
|
|
|
|
|
| 309 |
|
| 310 |
MANDATORY STEP:
|
| 311 |
After helping the customer with their concern,
|
|
@@ -329,7 +333,7 @@ def build_prompt(df):
|
|
| 329 |
- Log every interaction properly to maintain an audit trail for customer support sessions.
|
| 330 |
"""
|
| 331 |
|
| 332 |
-
st.write(system_message)
|
| 333 |
prompt = ChatPromptTemplate.from_messages([
|
| 334 |
("system", system_message),
|
| 335 |
("human", "{input}"),
|
|
@@ -381,7 +385,7 @@ def fetch_details(email):
|
|
| 381 |
"""
|
| 382 |
|
| 383 |
df = pd.read_sql_query(query, connection, params=(email,))
|
| 384 |
-
st.write(df)
|
| 385 |
return df
|
| 386 |
except Exception as e:
|
| 387 |
st.write(f"Error: {e}")
|
|
|
|
| 274 |
Use the following workflow to solve user queries. do not provide sql inputs to the sql tool - you only need to ask in natural language what information you need.
|
| 275 |
- If at any point you cannot determine the next steps - defer to human. you do not have clearance to go beyond the scope the following flow.
|
| 276 |
You are only allowed to provide information relevant to the particular customer. Following is the information about the customer from the last 2 weeks:
|
| 277 |
+
|
| 278 |
{df}
|
| 279 |
+
|
| 280 |
If this information is not enough, fetch necessary information usign the sql_tool.
|
| 281 |
|
| 282 |
### **Workflow:**
|
|
|
|
| 308 |
- You cannot change shipping orders of orders that are already delivered or cancelled.
|
| 309 |
- Retrieve necessary details.
|
| 310 |
- Update the shipping address with `change_address`.
|
| 311 |
+
### 7. Provide Information
|
| 312 |
+
- If customer asks for his own information, provide accurate information by checking the information provided to you above or if that's not enough use the sql_tool.
|
| 313 |
|
| 314 |
MANDATORY STEP:
|
| 315 |
After helping the customer with their concern,
|
|
|
|
| 333 |
- Log every interaction properly to maintain an audit trail for customer support sessions.
|
| 334 |
"""
|
| 335 |
|
| 336 |
+
# st.write(system_message)
|
| 337 |
prompt = ChatPromptTemplate.from_messages([
|
| 338 |
("system", system_message),
|
| 339 |
("human", "{input}"),
|
|
|
|
| 385 |
"""
|
| 386 |
|
| 387 |
df = pd.read_sql_query(query, connection, params=(email,))
|
| 388 |
+
#st.write(df)
|
| 389 |
return df
|
| 390 |
except Exception as e:
|
| 391 |
st.write(f"Error: {e}")
|