Spaces:
Runtime error
Runtime error
Commit
•
afc1cb3
1
Parent(s):
c63b1d2
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import openai
|
3 |
|
|
|
4 |
def generate_plantuml(api_key, text):
|
5 |
openai.api_key = api_key
|
6 |
response = openai.ChatCompletion.create(
|
@@ -14,7 +15,7 @@ def generate_plantuml(api_key, text):
|
|
14 |
],
|
15 |
)
|
16 |
print(response)
|
17 |
-
return response["
|
18 |
|
19 |
iface = gr.Interface(
|
20 |
fn=generate_plantuml,
|
|
|
1 |
import gradio as gr
|
2 |
import openai
|
3 |
|
4 |
+
|
5 |
def generate_plantuml(api_key, text):
|
6 |
openai.api_key = api_key
|
7 |
response = openai.ChatCompletion.create(
|
|
|
15 |
],
|
16 |
)
|
17 |
print(response)
|
18 |
+
return response["choices"][0]["message"]["content"]
|
19 |
|
20 |
iface = gr.Interface(
|
21 |
fn=generate_plantuml,
|