Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -152,16 +152,16 @@ def generate_optimized_content(summarized_transcript):
|
|
| 152 |
"""
|
| 153 |
|
| 154 |
try:
|
| 155 |
-
response = openai.
|
| 156 |
model="gpt-3.5-turbo",
|
| 157 |
messages=[
|
| 158 |
-
{"role": "system", "content": "You are
|
| 159 |
-
{"role": "user", "content":
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
except Exception as e:
|
| 166 |
return {"error": str(e)}
|
| 167 |
|
|
|
|
| 152 |
"""
|
| 153 |
|
| 154 |
try:
|
| 155 |
+
response = openai.chat.completions.create(
|
| 156 |
model="gpt-3.5-turbo",
|
| 157 |
messages=[
|
| 158 |
+
{"role": "system", "content": "You are a helpful assistant."},
|
| 159 |
+
{"role": "user", "content": "Hello, how are you?"}
|
| 160 |
+
]
|
| 161 |
+
)
|
| 162 |
+
|
| 163 |
+
# Print the assistant's reply
|
| 164 |
+
print(response.choices[0].message.content)
|
| 165 |
except Exception as e:
|
| 166 |
return {"error": str(e)}
|
| 167 |
|