Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -279,12 +279,20 @@ def process_and_query(text=None):
|
|
279 |
# text = "the user asks the following to his health adviser " + text
|
280 |
|
281 |
|
282 |
-
|
|
|
283 |
vectara_response_json = query_vectara(text)
|
|
|
|
|
284 |
markdown_output = convert_to_markdown(vectara_response_json)
|
285 |
-
|
286 |
-
|
287 |
-
|
|
|
|
|
|
|
|
|
|
|
288 |
|
289 |
completion = client.chat.completions.create(
|
290 |
model="gpt-3.5-turbo",
|
|
|
279 |
# text = "the user asks the following to his health adviser " + text
|
280 |
|
281 |
|
282 |
+
|
283 |
+
# Use the text to query Vectara
|
284 |
vectara_response_json = query_vectara(text)
|
285 |
+
|
286 |
+
# Convert the Vectara response to Markdown
|
287 |
markdown_output = convert_to_markdown(vectara_response_json)
|
288 |
+
|
289 |
+
# Process the summary with OpenAI
|
290 |
+
final_response = process_summary_with_openai(markdown_output)
|
291 |
+
|
292 |
+
# Return the processed summary along with the full output
|
293 |
+
return f"**Summary**: {final_response}\n\n**Full output**:\n{markdown_output}"
|
294 |
+
except Exception as e:
|
295 |
+
return str(e)
|
296 |
|
297 |
completion = client.chat.completions.create(
|
298 |
model="gpt-3.5-turbo",
|