Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -70,14 +70,19 @@ rag_chain = (
|
|
70 |
import gradio as gr
|
71 |
|
72 |
# Function to stream responses
|
73 |
-
def rag_memory_stream(
|
74 |
partial_text = ""
|
75 |
-
for new_text in rag_chain.stream(
|
76 |
partial_text += new_text
|
77 |
yield partial_text
|
78 |
|
|
|
|
|
|
|
|
|
|
|
79 |
# Title and description for the app
|
80 |
-
title = "AI Medical Assistant for Drug Information and Side Effects"
|
81 |
description = """
|
82 |
This AI-powered chatbot provides reliable information about drugs, their side effects, and related medical conditions.
|
83 |
Powered by the Groq API and LangChain, it delivers real-time, accurate responses.
|
@@ -111,6 +116,7 @@ demo = gr.ChatInterface(fn=rag_memory_stream,
|
|
111 |
title=title,
|
112 |
description=description,
|
113 |
fill_height=True,
|
|
|
114 |
theme="glass",
|
115 |
)
|
116 |
|
|
|
70 |
import gradio as gr
|
71 |
|
72 |
# Function to stream responses
|
73 |
+
def rag_memory_stream(message, history):
|
74 |
partial_text = ""
|
75 |
+
for new_text in rag_chain.stream(message): # Assuming rag_chain is pre-defined
|
76 |
partial_text += new_text
|
77 |
yield partial_text
|
78 |
|
79 |
+
examples = [
|
80 |
+
"What are the side effects of aspirin?",
|
81 |
+
"What is the disease for constant fatigue and muscle weakness?"
|
82 |
+
]
|
83 |
+
|
84 |
# Title and description for the app
|
85 |
+
title = "CareBot: AI Medical Assistant for Drug Information and Side Effects"
|
86 |
description = """
|
87 |
This AI-powered chatbot provides reliable information about drugs, their side effects, and related medical conditions.
|
88 |
Powered by the Groq API and LangChain, it delivers real-time, accurate responses.
|
|
|
116 |
title=title,
|
117 |
description=description,
|
118 |
fill_height=True,
|
119 |
+
examples=examples,
|
120 |
theme="glass",
|
121 |
)
|
122 |
|