Spaces:
Runtime error
Runtime error
Commit
·
6f9b2f6
1
Parent(s):
73f0134
Update gpt.py
Browse files
gpt.py
CHANGED
@@ -40,7 +40,7 @@ def get_keywords(question):
|
|
40 |
function_call={"name": "list_keywords", "arguments": ["list"]},
|
41 |
)
|
42 |
|
43 |
-
arguments = response.choices[0]
|
44 |
print(arguments)
|
45 |
return " ".join(arguments).split(" ")
|
46 |
|
@@ -91,8 +91,8 @@ Sur la base des informations ci-dessus, quelle est la réponse à cette question
|
|
91 |
)
|
92 |
|
93 |
try:
|
94 |
-
function_call = response.choices[0]
|
95 |
-
arguments = function_call
|
96 |
result = json.loads(arguments)
|
97 |
return result
|
98 |
except KeyError:
|
|
|
40 |
function_call={"name": "list_keywords", "arguments": ["list"]},
|
41 |
)
|
42 |
|
43 |
+
arguments = response.choices[0].message.function_call.arguments.lower()
|
44 |
print(arguments)
|
45 |
return " ".join(arguments).split(" ")
|
46 |
|
|
|
91 |
)
|
92 |
|
93 |
try:
|
94 |
+
function_call = response.choices[0].message.function_call
|
95 |
+
arguments = function_call.arguments.lower()
|
96 |
result = json.loads(arguments)
|
97 |
return result
|
98 |
except KeyError:
|