Browse Source

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

Alex Cheema 8 months ago
parent
commit
394935711b
1 changed files with 3 additions and 0 deletions
  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"