Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -17,6 +17,9 @@ def codeinterpreter(openai_key,prompt, files):
|
|
17 |
for idx, file in enumerate(files):
|
18 |
fileList.append(file)
|
19 |
|
|
|
|
|
|
|
20 |
with CodeInterpreterSession(model="gpt-3.5-turbo",openai_api_key=openai_key) as session:
|
21 |
#async with CodeInterpreterSession(model="gpt-3.5-turbo",openai_api_key="") as session:
|
22 |
response = session.generate_response_sync(prompt, fileList,True)
|
|
|
17 |
for idx, file in enumerate(files):
|
18 |
fileList.append(file)
|
19 |
|
20 |
+
if openai_api_key == "":
|
21 |
+
return ['openai key must set!',None]
|
22 |
+
|
23 |
with CodeInterpreterSession(model="gpt-3.5-turbo",openai_api_key=openai_key) as session:
|
24 |
#async with CodeInterpreterSession(model="gpt-3.5-turbo",openai_api_key="") as session:
|
25 |
response = session.generate_response_sync(prompt, fileList,True)
|