Update app.py
Browse files
app.py
CHANGED
@@ -296,9 +296,13 @@ class StockAdviser:
|
|
296 |
)
|
297 |
|
298 |
print (initial_response)
|
299 |
-
|
300 |
-
|
301 |
-
|
|
|
|
|
|
|
|
|
302 |
print(function_name)
|
303 |
print(company)
|
304 |
return function_name
|
|
|
296 |
)
|
297 |
|
298 |
print (initial_response)
|
299 |
+
if str(initial_response.choices[0].message.function_call) == "None":
|
300 |
+
function_name = "get_none"
|
301 |
+
company= "NOTICKER"
|
302 |
+
else:
|
303 |
+
function_name = initial_response.choices[0].message.function_call.name
|
304 |
+
function_argument = json.loads(initial_response.choices[0].message.function_call.arguments)
|
305 |
+
company= function_argument['company']
|
306 |
print(function_name)
|
307 |
print(company)
|
308 |
return function_name
|