aparnavellala commited on
Commit
91e4626
·
verified ·
1 Parent(s): ecafb2c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -200,7 +200,7 @@ visitor_email="[email protected]"
200
  doctor_name="Normand Joseph"
201
  department_name="Orthopedics"
202
 
203
- state = VisitorState(
204
  visitor_name=visitor_name,
205
  visitor_mobile=visitor_mobile,
206
  visitor_email=visitor_email,
@@ -208,9 +208,8 @@ state = VisitorState(
208
  department_name=department_name,
209
  )
210
  # Execute workflow
211
- #result = compiled_graph.invoke(state.dict())
212
- #result = compiled_graph.invoke(state.model_dump())
213
-
214
 
215
 
216
  # ---------------------------------------
@@ -218,7 +217,6 @@ state = VisitorState(
218
  # ---------------------------------------
219
  def gradio_interface(visitor_name, visitor_mobile, visitor_email, doctor_name, department_name):
220
  #Interface for Gradio application.
221
-
222
  state = VisitorState(
223
  visitor_name=visitor_name,
224
  visitor_mobile=visitor_mobile,
@@ -228,8 +226,10 @@ def gradio_interface(visitor_name, visitor_mobile, visitor_email, doctor_name, d
228
  )
229
  # Execute workflow
230
  #result = compiled_graph.invoke(state.dict())
231
- result = compiled_graph.invoke(state.model_dump())
232
- return "\n".join(result["messages"])
 
 
233
 
234
  iface = gr.Interface(
235
  fn=gradio_interface,
@@ -240,9 +240,10 @@ iface = gr.Interface(
240
  gr.Textbox(label="Doctor Name"),
241
  gr.Textbox(label="Department Name"),
242
  ],
243
- outputs="textbox",
244
  )
245
 
 
246
  # Execute the Gradio interface
247
  if __name__ == "__main__":
248
  iface.launch()
 
200
  doctor_name="Normand Joseph"
201
  department_name="Orthopedics"
202
 
203
+ gstate = VisitorState(
204
  visitor_name=visitor_name,
205
  visitor_mobile=visitor_mobile,
206
  visitor_email=visitor_email,
 
208
  department_name=department_name,
209
  )
210
  # Execute workflow
211
+ result = compiled_graph.invoke(gstate.dict())
212
+ result = compiled_graph.invoke(gstate.model_dump())
 
213
 
214
 
215
  # ---------------------------------------
 
217
  # ---------------------------------------
218
  def gradio_interface(visitor_name, visitor_mobile, visitor_email, doctor_name, department_name):
219
  #Interface for Gradio application.
 
220
  state = VisitorState(
221
  visitor_name=visitor_name,
222
  visitor_mobile=visitor_mobile,
 
226
  )
227
  # Execute workflow
228
  #result = compiled_graph.invoke(state.dict())
229
+ #result = compiled_graph.invoke(state.model_dump())
230
+ #return "\n".join(result["messages"])
231
+ return "Here returning a string for testing gradio interface!" + visitor_name
232
+
233
 
234
  iface = gr.Interface(
235
  fn=gradio_interface,
 
240
  gr.Textbox(label="Doctor Name"),
241
  gr.Textbox(label="Department Name"),
242
  ],
243
+ outputs="textbox"
244
  )
245
 
246
+
247
  # Execute the Gradio interface
248
  if __name__ == "__main__":
249
  iface.launch()