Spaces:
Build error
Build error
Merge branch 'main' into chatbot
Browse files
app.py
CHANGED
|
@@ -69,24 +69,15 @@ def main(query, history):
|
|
| 69 |
thread_id=thread.id, run_id=run.id
|
| 70 |
)
|
| 71 |
|
|
|
|
| 72 |
# If run is completed, get messages
|
| 73 |
if run_status.status == "completed":
|
| 74 |
messages = client.beta.threads.messages.list(thread_id=thread.id)
|
| 75 |
response = ""
|
| 76 |
-
|
| 77 |
-
data = messages.data
|
| 78 |
-
first_thread_message = data[0]
|
| 79 |
-
content = first_thread_message.content
|
| 80 |
-
response = content[0].text.value
|
| 81 |
-
return response
|
| 82 |
-
else:
|
| 83 |
-
continue
|
| 84 |
-
|
| 85 |
-
|
| 86 |
# Create a Gradio Interface
|
| 87 |
with gr.Blocks() as iface:
|
| 88 |
with gr.Tab("MeroHealthAI Chatbot"):
|
| 89 |
-
|
| 90 |
with gr.Row():
|
| 91 |
symptom_chatbot = gr.ChatInterface(
|
| 92 |
main
|
|
@@ -110,4 +101,4 @@ with gr.Blocks() as iface:
|
|
| 110 |
)
|
| 111 |
|
| 112 |
if __name__ == "__main__":
|
| 113 |
-
iface.launch()
|
|
|
|
| 69 |
thread_id=thread.id, run_id=run.id
|
| 70 |
)
|
| 71 |
|
| 72 |
+
|
| 73 |
# If run is completed, get messages
|
| 74 |
if run_status.status == "completed":
|
| 75 |
messages = client.beta.threads.messages.list(thread_id=thread.id)
|
| 76 |
response = ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
# Create a Gradio Interface
|
| 78 |
with gr.Blocks() as iface:
|
| 79 |
with gr.Tab("MeroHealthAI Chatbot"):
|
| 80 |
+
gr.Markdown("MeroHealthAI is an AI assited chatbot that gathers symptoms from the user, documents it and sends it to the nearest most relevant doctor available. Our app also suppors medical report analysis")
|
| 81 |
with gr.Row():
|
| 82 |
symptom_chatbot = gr.ChatInterface(
|
| 83 |
main
|
|
|
|
| 101 |
)
|
| 102 |
|
| 103 |
if __name__ == "__main__":
|
| 104 |
+
iface.launch()
|