timeout added
Browse files
app.py
CHANGED
|
@@ -33,6 +33,7 @@ def diagnoser_query(user_query):
|
|
| 33 |
"""
|
| 34 |
response = client.chat.completions.create(
|
| 35 |
model="gpt-4o-mini",
|
|
|
|
| 36 |
messages=[
|
| 37 |
{
|
| 38 |
"role": "user",
|
|
@@ -45,7 +46,7 @@ def diagnoser_query(user_query):
|
|
| 45 |
}
|
| 46 |
],
|
| 47 |
)
|
| 48 |
-
return response
|
| 49 |
|
| 50 |
def distractors_query(user_query):
|
| 51 |
"""
|
|
@@ -54,9 +55,10 @@ def distractors_query(user_query):
|
|
| 54 |
"""
|
| 55 |
response = client.chat.completions.create(
|
| 56 |
model="gpt-4o-mini",
|
|
|
|
| 57 |
messages=[{"role": "user", "content": user_query}]
|
| 58 |
)
|
| 59 |
-
return response
|
| 60 |
|
| 61 |
# -------------------------------
|
| 62 |
# Build the Gradio Interface
|
|
|
|
| 33 |
"""
|
| 34 |
response = client.chat.completions.create(
|
| 35 |
model="gpt-4o-mini",
|
| 36 |
+
timeout=10,
|
| 37 |
messages=[
|
| 38 |
{
|
| 39 |
"role": "user",
|
|
|
|
| 46 |
}
|
| 47 |
],
|
| 48 |
)
|
| 49 |
+
return response.choices[0].message.content
|
| 50 |
|
| 51 |
def distractors_query(user_query):
|
| 52 |
"""
|
|
|
|
| 55 |
"""
|
| 56 |
response = client.chat.completions.create(
|
| 57 |
model="gpt-4o-mini",
|
| 58 |
+
timeout=10,
|
| 59 |
messages=[{"role": "user", "content": user_query}]
|
| 60 |
)
|
| 61 |
+
return response.choices[0].message.content
|
| 62 |
|
| 63 |
# -------------------------------
|
| 64 |
# Build the Gradio Interface
|