mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 20:07:49 +01:00
enh: v1 endpoint support
This commit is contained in:
@@ -1261,6 +1261,7 @@ if audit_level != AuditLevel.NONE:
|
||||
|
||||
|
||||
@app.get("/api/models")
|
||||
@app.get("/api/v1/models") # Experimental: Compatibility with OpenAI API
|
||||
async def get_models(
|
||||
request: Request, refresh: bool = False, user=Depends(get_verified_user)
|
||||
):
|
||||
@@ -1341,6 +1342,7 @@ async def get_base_models(request: Request, user=Depends(get_admin_user)):
|
||||
|
||||
|
||||
@app.post("/api/embeddings")
|
||||
@app.post("/api/v1/embeddings") # Experimental: Compatibility with OpenAI API
|
||||
async def embeddings(
|
||||
request: Request, form_data: dict, user=Depends(get_verified_user)
|
||||
):
|
||||
@@ -1367,6 +1369,7 @@ async def embeddings(
|
||||
|
||||
|
||||
@app.post("/api/chat/completions")
|
||||
@app.post("/api/v1/chat/completions") # Experimental: Compatibility with OpenAI API
|
||||
async def chat_completion(
|
||||
request: Request,
|
||||
form_data: dict,
|
||||
|
||||
Reference in New Issue
Block a user