aymanemalih commited on
Commit
d822936
·
1 Parent(s): 9bc40bd

Update gpt.py

Browse files
Files changed (1) hide show
  1. gpt.py +3 -3
gpt.py CHANGED
@@ -141,7 +141,7 @@ def get_keywords(question):
141
  function_call={"name": "list_keywords", "arguments": ["list"]},
142
  )
143
 
144
- arguments = response["choices"][0]["message"]["function_call"]["arguments"].lower()
145
  keywords = json.loads(arguments)["list"]
146
 
147
  return " ".join(keywords).split(" ")
@@ -193,8 +193,8 @@ Sur la base des informations ci-dessus, quelle est la réponse à cette question
193
  )
194
 
195
  try:
196
- function_call = response["choices"][0]["message"]["function_call"]
197
- arguments = function_call["arguments"].lower()
198
  result = json.loads(arguments)
199
  return result
200
  except KeyError:
 
141
  function_call={"name": "list_keywords", "arguments": ["list"]},
142
  )
143
 
144
+ arguments = response.choices[0].message.function_call.arguments.lower()
145
  keywords = json.loads(arguments)["list"]
146
 
147
  return " ".join(keywords).split(" ")
 
193
  )
194
 
195
  try:
196
+ function_call = response.choices[0].message.function_call
197
+ arguments = function_call.arguments.lower()
198
  result = json.loads(arguments)
199
  return result
200
  except KeyError: