ParthSadaria commited on
Commit
707dc28
·
verified ·
1 Parent(s): 11c1372

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +6 -1
main.py CHANGED
@@ -102,7 +102,12 @@ def generate_search(query: str, systemprompt: Optional[str] = None, stream: bool
102
  if not stream:
103
  yield streaming_text
104
 
105
-
 
 
 
 
 
106
  @app.get("/searchgpt")
107
  async def search_gpt(q: str, stream: Optional[bool] = False, systemprompt: Optional[str] = None):
108
  if not q:
 
102
  if not stream:
103
  yield streaming_text
104
 
105
+ @app.get("/ping")
106
+ async def ping():
107
+ start_time = time()
108
+ response_time = time() - start_time
109
+ return {"message": "pong", "response_time": f"{response_time:.6f} seconds"}
110
+
111
  @app.get("/searchgpt")
112
  async def search_gpt(q: str, stream: Optional[bool] = False, systemprompt: Optional[str] = None):
113
  if not q: