datdevsteve commited on
Commit
2b8772d
·
verified ·
1 Parent(s): a81c2e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -11
app.py CHANGED
@@ -3,23 +3,20 @@ from nivra_agent import nivra_chat
3
 
4
 
5
  def chat_fn(message, history):
6
- history = history or []
7
- try:
8
- response = nivra_chat(message, history)
9
- except Exception:
10
- response = (
11
- "⚠️ Temporary service issue.\n\n"
12
- "Please try again in a moment."
13
- )
14
- history.append((message, response))
15
- return history
16
 
17
 
18
  demo = gr.ChatInterface(
19
  fn=chat_fn,
20
  title="🩺 Nivra AI Agent",
21
  description="Space to access Nivra's Agentic Interface",
 
 
 
 
 
22
  )
23
 
24
- demo.queue()
25
  demo.launch()
 
3
 
4
 
5
  def chat_fn(message, history):
6
+ # DO NOT touch history
7
+ # ChatInterface manages it internally
8
+ return nivra_chat(message, history)
 
 
 
 
 
 
 
9
 
10
 
11
  demo = gr.ChatInterface(
12
  fn=chat_fn,
13
  title="🩺 Nivra AI Agent",
14
  description="Space to access Nivra's Agentic Interface",
15
+ examples=[
16
+ "I have fever and chills",
17
+ "Patient presents skin rash and itching",
18
+ "Patient presents stomach pain and vomiting",
19
+ ],
20
  )
21
 
 
22
  demo.launch()