浏览代码

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

Alex Cheema 8 月之前
父节点
当前提交
394935711b
共有 1 个文件被更改,包括 3 次插入0 次删除
  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"