Spaces:
Sleeping
Sleeping
json_response = json.loads(response.choices[0].message.content)["questions"]
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
|
|
2 |
import pandas as pd
|
3 |
import os
|
4 |
from openai import OpenAI
|
|
|
5 |
|
6 |
OPEN_AI_KEY = os.getenv("OPEN_AI_KEY")
|
7 |
client = OpenAI(api_key=OPEN_AI_KEY)
|
@@ -56,7 +57,7 @@ def generate_questions(df_string):
|
|
56 |
}
|
57 |
|
58 |
response = client.chat.completions.create(**request_payload)
|
59 |
-
json_response = response.choices[0].message.content["questions"]
|
60 |
print("=====json_response=====")
|
61 |
print(json_response)
|
62 |
|
|
|
2 |
import pandas as pd
|
3 |
import os
|
4 |
from openai import OpenAI
|
5 |
+
import json
|
6 |
|
7 |
OPEN_AI_KEY = os.getenv("OPEN_AI_KEY")
|
8 |
client = OpenAI(api_key=OPEN_AI_KEY)
|
|
|
57 |
}
|
58 |
|
59 |
response = client.chat.completions.create(**request_payload)
|
60 |
+
json_response = json.loads(response.choices[0].message.content)["questions"]
|
61 |
print("=====json_response=====")
|
62 |
print(json_response)
|
63 |
|