tommy24 commited on
Commit
34adc36
·
1 Parent(s): 3a2af74

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -1018,10 +1018,10 @@ def classify(platform, UserInput, Images, Textbox2, Textbox3):
1018
  print(f"Booking enquiry for {full_name} with contact number {contact_number}.")
1019
  return f"Booking enquiry for {full_name} with contact number {contact_number} declined!. Please try again or Contact our support team"
1020
 
1021
- def clear_history(command: str):
1022
  """
1023
- This function allow the user to clear the history.
1024
- @param command: This should be always clear history or something like that
1025
  """
1026
  messages.clear()
1027
  messages.append(
@@ -1121,14 +1121,14 @@ def classify(platform, UserInput, Images, Textbox2, Textbox3):
1121
  },
1122
 
1123
  {
1124
- "name": "clear_history",
1125
- "description": "This function allow the user to clear the history",
1126
  "parameters": {
1127
  "type": "object",
1128
  "properties": {
1129
  "command": {
1130
  "type": "string",
1131
- "description": "This should be always clear history or something like that",
1132
  },
1133
  },
1134
  "required": ["command"],
@@ -1203,8 +1203,8 @@ def classify(platform, UserInput, Images, Textbox2, Textbox3):
1203
  arguments_str = comp["function_call"]["arguments"]
1204
  arguments_dict = json.loads(arguments_str)
1205
 
1206
- if function_name == "clear_history":
1207
- function_response = clear_history(
1208
  command=arguments_dict["command"]
1209
  )
1210
  elif function_name == "book_enquiry":
@@ -1220,7 +1220,7 @@ def classify(platform, UserInput, Images, Textbox2, Textbox3):
1220
 
1221
  print("FUNCTION_RESPONSE:", function_response)
1222
  # print("ARGUMENTS VALUES:", arguments_dict["location"], arguments_dict["unit"])
1223
- if function_name == "clear_history":
1224
  print(f"ARGUMENTS VALUES: Command: {arguments_dict['command']}")
1225
  elif function_name == "book_enquiry":
1226
  print(f"ARGUMENTS VALUES: Full_name: {arguments_dict['full_name']}, Contact Number: {arguments_dict['contact_number']}, Street Address: {arguments_dict['street_address']}, Landmark: {arguments_dict['landmark']}, Zip Code: {arguments_dict['zip_code']}, Emirate: {arguments_dict['emirate']}, Reason: {arguments_dict['reason']}")
 
1018
  print(f"Booking enquiry for {full_name} with contact number {contact_number}.")
1019
  return f"Booking enquiry for {full_name} with contact number {contact_number} declined!. Please try again or Contact our support team"
1020
 
1021
+ def clear_chat_history(command: str):
1022
  """
1023
+ This function allow the user to clear the chat history.
1024
+ @param command: This should be always clear chat history or something like that
1025
  """
1026
  messages.clear()
1027
  messages.append(
 
1121
  },
1122
 
1123
  {
1124
+ "name": "clear_chat_history",
1125
+ "description": "This function allow the user to clear the chat history",
1126
  "parameters": {
1127
  "type": "object",
1128
  "properties": {
1129
  "command": {
1130
  "type": "string",
1131
+ "description": "This should be always clear chat history or something like that",
1132
  },
1133
  },
1134
  "required": ["command"],
 
1203
  arguments_str = comp["function_call"]["arguments"]
1204
  arguments_dict = json.loads(arguments_str)
1205
 
1206
+ if function_name == "clear_chat_history":
1207
+ function_response = clear_chat_history(
1208
  command=arguments_dict["command"]
1209
  )
1210
  elif function_name == "book_enquiry":
 
1220
 
1221
  print("FUNCTION_RESPONSE:", function_response)
1222
  # print("ARGUMENTS VALUES:", arguments_dict["location"], arguments_dict["unit"])
1223
+ if function_name == "clear_chat_history":
1224
  print(f"ARGUMENTS VALUES: Command: {arguments_dict['command']}")
1225
  elif function_name == "book_enquiry":
1226
  print(f"ARGUMENTS VALUES: Full_name: {arguments_dict['full_name']}, Contact Number: {arguments_dict['contact_number']}, Street Address: {arguments_dict['street_address']}, Landmark: {arguments_dict['landmark']}, Zip Code: {arguments_dict['zip_code']}, Emirate: {arguments_dict['emirate']}, Reason: {arguments_dict['reason']}")