Explorar o código

add all chat endpoints without v1 prefix to support ollama / openwebui. related: #175

Alex Cheema hai 8 meses
pai
achega
394935711b
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      exo/api/chatgpt_api.py

+ 3 - 0
exo/api/chatgpt_api.py

@@ -169,8 +169,11 @@ class ChatGPTAPI:
       allow_headers="*",
       allow_methods="*",
     )
+    cors.add(self.app.router.add_get("/models", self.handle_get_models), {"*": cors_options})
     cors.add(self.app.router.add_get("/v1/models", self.handle_get_models), {"*": cors_options})
+    cors.add(self.app.router.add_post("/chat/token/encode", self.handle_post_chat_token_encode), {"*": cors_options})
     cors.add(self.app.router.add_post("/v1/chat/token/encode", self.handle_post_chat_token_encode), {"*": cors_options})
+    cors.add(self.app.router.add_post("/chat/completions", self.handle_post_chat_completions), {"*": cors_options})
     cors.add(self.app.router.add_post("/v1/chat/completions", self.handle_post_chat_completions), {"*": cors_options})
 
     self.static_dir = Path(__file__).parent.parent.parent/"tinychat/examples/tinychat"