tommy24 commited on
Commit
c0e2327
·
1 Parent(s): b527090

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -10
app.py CHANGED
@@ -966,7 +966,7 @@ def classify(platform, UserInput, Images, Textbox2, Textbox3):
966
  # return None
967
 
968
  # @openai_func
969
- def testing_this(name: str, number: str) -> str:
970
  """
971
  This function ask user for their name and a random integer and returns it.
972
  @param name: The name of the user
@@ -1032,18 +1032,26 @@ def classify(platform, UserInput, Images, Textbox2, Textbox3):
1032
  function_name = comp["function_call"]["name"]
1033
 
1034
  function_response = testing_this(
1035
- name= comp.get("name"),
1036
- number = comp.get("number")
1037
  )
1038
- messages.append(comp)
1039
- messages.append({
1040
- "role": "function",
1041
- "name": function_name,
1042
- "content": function_response
1043
- })
1044
  second_response = openai.ChatCompletion.create(
1045
  model="gpt-3.5-turbo",
1046
- messages=messages
 
 
 
 
 
 
 
 
1047
  )
1048
  print("YES_FUNCTION_CALL RESPONSE TRY (NO IMAGE)")
1049
  return second_response
 
966
  # return None
967
 
968
  # @openai_func
969
+ def testing_this(name: str, number: str):
970
  """
971
  This function ask user for their name and a random integer and returns it.
972
  @param name: The name of the user
 
1032
  function_name = comp["function_call"]["name"]
1033
 
1034
  function_response = testing_this(
1035
+ name=comp.get("name"),
1036
+ number=comp.get("number")
1037
  )
1038
+ # messages.append(comp)
1039
+ # messages.append({
1040
+ # "role": "function",
1041
+ # "name": function_name,
1042
+ # "content": function_response
1043
+ # })
1044
  second_response = openai.ChatCompletion.create(
1045
  model="gpt-3.5-turbo",
1046
+ messages=[
1047
+ {"role": "user", "content": UserInput},
1048
+ comp,
1049
+ {
1050
+ "role": "function",
1051
+ "name": function_name,
1052
+ "content": function_response
1053
+ },
1054
+ ],
1055
  )
1056
  print("YES_FUNCTION_CALL RESPONSE TRY (NO IMAGE)")
1057
  return second_response