Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -430,11 +430,11 @@ Now please provide your results using the following language: {language}.
|
|
| 430 |
try:
|
| 431 |
#client = OpenAI(api_key= valapikey)
|
| 432 |
#response = client.chat.completions.create(
|
| 433 |
-
response = client.
|
| 434 |
model=model,
|
| 435 |
prompt=formattedprompt
|
| 436 |
)
|
| 437 |
-
result = response['choices'][0]['
|
| 438 |
break
|
| 439 |
except Exception as e:
|
| 440 |
print(f"Error occurred on attempt {attempt + 1}: {e}")
|
|
|
|
| 430 |
try:
|
| 431 |
#client = OpenAI(api_key= valapikey)
|
| 432 |
#response = client.chat.completions.create(
|
| 433 |
+
response = client.ChatCompletion.create(
|
| 434 |
model=model,
|
| 435 |
prompt=formattedprompt
|
| 436 |
)
|
| 437 |
+
result = response['choices'][0]['message']#['content']
|
| 438 |
break
|
| 439 |
except Exception as e:
|
| 440 |
print(f"Error occurred on attempt {attempt + 1}: {e}")
|