mirror of
https://github.com/open-webui/pipelines
synced 2025-06-26 18:15:58 +00:00
feat: cli
This commit is contained in:
11
main.py
11
main.py
@@ -15,6 +15,8 @@ import uuid
|
||||
from utils import get_last_user_message, stream_message_template
|
||||
from schemas import FilterForm, OpenAIChatCompletionForm
|
||||
|
||||
|
||||
import sys
|
||||
import os
|
||||
import importlib.util
|
||||
|
||||
@@ -24,8 +26,6 @@ from contextlib import asynccontextmanager
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
|
||||
|
||||
import os
|
||||
|
||||
####################################
|
||||
# Load .env file
|
||||
####################################
|
||||
@@ -452,6 +452,13 @@ async def generate_openai_chat_completion(form_data: OpenAIChatCompletionForm):
|
||||
return await run_in_threadpool(job)
|
||||
|
||||
|
||||
@app.get("/v1")
|
||||
@app.get("/")
|
||||
async def get_status():
|
||||
return {"status": True}
|
||||
|
||||
|
||||
@app.post("/v1/restart")
|
||||
@app.post("/restart")
|
||||
def restart_server():
|
||||
sys.exit(42) # Use a distinctive code to indicate a restart request
|
||||
|
||||
Reference in New Issue
Block a user