OjciecTadeusz commited on
Commit
4b77577
·
verified ·
1 Parent(s): 102225f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py CHANGED
@@ -42,6 +42,20 @@ async def query_model(payload):
42
  response = requests.post(API_URL, headers=headers, json=payload)
43
  return response.json()
44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  @app.post("/v1/chat/completions")
46
  async def chat_completion(request: Request):
47
  try:
 
42
  response = requests.post(API_URL, headers=headers, json=payload)
43
  return response.json()
44
 
45
+ @app.get("/status")
46
+ async def status():
47
+ try:
48
+ response_text = "it's working"
49
+
50
+ return JSONResponse(
51
+ content=format_chat_response(response_text)
52
+ )
53
+ except Exception as e:
54
+ return JSONResponse(
55
+ status_code=500,
56
+ content={"error": str(e)}
57
+ )
58
+
59
  @app.post("/v1/chat/completions")
60
  async def chat_completion(request: Request):
61
  try: