colin4554 commited on
Commit
8c4ff88
1 Parent(s): 23536d8

add email if

Browse files
Files changed (1) hide show
  1. functions.py +13 -6
functions.py CHANGED
@@ -17,12 +17,19 @@ def call_function(messages, function_call):
17
  function_call["arguments"]
18
  )
19
  print("Looking up order status")
20
- results = get_lookup_order_status(parsed_output["email_address"], parsed_output["order_number"])
21
- return {
22
- "role": "function",
23
- "name": function_call["name"],
24
- "content": str(results),
25
- }
 
 
 
 
 
 
 
26
  except Exception as e:
27
  # print(parsed_output)
28
  print(f"Function execution failed")
 
17
  function_call["arguments"]
18
  )
19
  print("Looking up order status")
20
+ if parsed_output["email_address"] == "colin.flueck@gmail.com" or parsed_output["email_address"] == "colinflueck@gmail.com":
21
+ results = get_lookup_order_status(parsed_output["email_address"], parsed_output["order_number"])
22
+ return {
23
+ "role": "function",
24
+ "name": function_call["name"],
25
+ "content": str(results),
26
+ }
27
+ else:
28
+ return {
29
+ "role": "function",
30
+ "name": function_call["name"],
31
+ "content": "I'm sorry we couldn't find any orders with that information, please have the customer double check their input."
32
+ }
33
  except Exception as e:
34
  # print(parsed_output)
35
  print(f"Function execution failed")