Spaces:
Runtime error
Runtime error
edited seamless_client name
Browse files
app.py
CHANGED
|
@@ -222,14 +222,18 @@ def convert_to_markdown(vectara_response_json):
|
|
| 222 |
|
| 223 |
def process_and_query(text=None, image=None, audio=None):
|
| 224 |
try:
|
|
|
|
|
|
|
| 225 |
# If an image is provided, process it with OpenAI and use the response as the text query for Vectara
|
| 226 |
if image is not None:
|
| 227 |
text = process_image(image)
|
|
|
|
| 228 |
if audio is not None:
|
| 229 |
text = process_speech(audio)
|
|
|
|
|
|
|
| 230 |
|
| 231 |
-
|
| 232 |
-
text = "the user asks the following to his health adviser " + text
|
| 233 |
# Now, use the text (either provided by the user or obtained from OpenAI) to query Vectara
|
| 234 |
vectara_response_json = query_vectara(text)
|
| 235 |
markdown_output = convert_to_markdown(vectara_response_json)
|
|
|
|
| 222 |
|
| 223 |
def process_and_query(text=None, image=None, audio=None):
|
| 224 |
try:
|
| 225 |
+
# augment the prompt before feeding it to vectara
|
| 226 |
+
text = "the user asks the following to his health adviser " + text
|
| 227 |
# If an image is provided, process it with OpenAI and use the response as the text query for Vectara
|
| 228 |
if image is not None:
|
| 229 |
text = process_image(image)
|
| 230 |
+
return text
|
| 231 |
if audio is not None:
|
| 232 |
text = process_speech(audio)
|
| 233 |
+
# augment the prompt before feeding it to vectara
|
| 234 |
+
text = "the user asks the following to his health adviser " + text
|
| 235 |
|
| 236 |
+
|
|
|
|
| 237 |
# Now, use the text (either provided by the user or obtained from OpenAI) to query Vectara
|
| 238 |
vectara_response_json = query_vectara(text)
|
| 239 |
markdown_output = convert_to_markdown(vectara_response_json)
|