LogicDataSolutions commited on
Commit
0ba731e
·
verified ·
1 Parent(s): 120a806

Update ping.py

Browse files
Files changed (1) hide show
  1. ping.py +3 -3
ping.py CHANGED
@@ -1,16 +1,16 @@
1
  from fastapi import FastAPI
2
 
3
- def add_ping_route(app: FastAPI, chat_function):
4
  """
5
  Adds a /ping route to the given FastAPI app.
6
- Calls the provided chat_function with a test message to verify it's working.
7
  """
8
  @app.get("/ping")
9
  def ping():
10
  """Simple health check that also calls the chat function."""
11
  try:
12
  # Call the chat function with test message and empty history
13
- result = chat_function("What is your name?", [])
14
  return {"status": "ok", "chat_result": result}
15
  except Exception as e:
16
  return {"status": "error", "detail": str(e)}
 
1
  from fastapi import FastAPI
2
 
3
+ def add_ping_route(app: FastAPI, call_langflow):
4
  """
5
  Adds a /ping route to the given FastAPI app.
6
+ Calls the provided call_langflow function with a test message to verify it's working.
7
  """
8
  @app.get("/ping")
9
  def ping():
10
  """Simple health check that also calls the chat function."""
11
  try:
12
  # Call the chat function with test message and empty history
13
+ result = call_langflow("What is your name?", [])
14
  return {"status": "ok", "chat_result": result}
15
  except Exception as e:
16
  return {"status": "error", "detail": str(e)}