feat:精简
Some checks failed
Create and publish Docker images with specific build args / build-main-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-main-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda126-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda126-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Create and publish Docker images with specific build args / build-ollama-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-ollama-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Create and publish Docker images with specific build args / build-slim-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-slim-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Python CI / Format Backend (3.11.x) (push) Has been cancelled
Python CI / Format Backend (3.12.x) (push) Has been cancelled
Frontend Build / Format & Build Frontend (push) Has been cancelled
Frontend Build / Frontend Unit Tests (push) Has been cancelled
Create and publish Docker images with specific build args / merge-main-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-cuda-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-cuda126-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-ollama-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-slim-images (push) Has been cancelled
Close inactive issues / close-issues (push) Has been cancelled

This commit is contained in:
2026-01-16 18:34:38 +08:00
parent 16263710d9
commit 11fcec9387
137 changed files with 68993 additions and 6435 deletions

View File

@@ -7,7 +7,6 @@ import logging
import re
from open_webui.utils.chat import generate_chat_completion
from open_webui.utils.credit.utils import check_credit_by_user_id
from open_webui.utils.task import (
title_generation_template,
follow_up_generation_template,
@@ -167,8 +166,6 @@ async def update_task_config(
async def generate_title(
request: Request, form_data: dict, user=Depends(get_verified_user)
):
check_credit_by_user_id(user_id=user.id, form_data=form_data)
if not request.app.state.config.ENABLE_TITLE_GENERATION:
return JSONResponse(
status_code=status.HTTP_200_OK,
@@ -252,8 +249,6 @@ async def generate_title(
async def generate_follow_ups(
request: Request, form_data: dict, user=Depends(get_verified_user)
):
check_credit_by_user_id(user_id=user.id, form_data=form_data)
if not request.app.state.config.ENABLE_FOLLOW_UP_GENERATION:
return JSONResponse(
status_code=status.HTTP_200_OK,
@@ -326,8 +321,6 @@ async def generate_follow_ups(
async def generate_chat_tags(
request: Request, form_data: dict, user=Depends(get_verified_user)
):
check_credit_by_user_id(user_id=user.id, form_data=form_data)
if not request.app.state.config.ENABLE_TAGS_GENERATION:
return JSONResponse(
status_code=status.HTTP_200_OK,
@@ -400,8 +393,6 @@ async def generate_chat_tags(
async def generate_image_prompt(
request: Request, form_data: dict, user=Depends(get_verified_user)
):
check_credit_by_user_id(user_id=user.id, form_data=form_data)
if getattr(request.state, "direct", False) and hasattr(request.state, "model"):
models = {
request.state.model["id"]: request.state.model,
@@ -468,8 +459,6 @@ async def generate_image_prompt(
async def generate_queries(
request: Request, form_data: dict, user=Depends(get_verified_user)
):
check_credit_by_user_id(user_id=user.id, form_data=form_data)
type = form_data.get("type")
if type == "web_search":
if not request.app.state.config.ENABLE_SEARCH_QUERY_GENERATION:
@@ -553,8 +542,6 @@ async def generate_queries(
async def generate_autocompletion(
request: Request, form_data: dict, user=Depends(get_verified_user)
):
check_credit_by_user_id(user_id=user.id, form_data=form_data)
if not request.app.state.config.ENABLE_AUTOCOMPLETE_GENERATION:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
@@ -641,8 +628,6 @@ async def generate_autocompletion(
async def generate_emoji(
request: Request, form_data: dict, user=Depends(get_verified_user)
):
check_credit_by_user_id(user_id=user.id, form_data=form_data)
if getattr(request.state, "direct", False) and hasattr(request.state, "model"):
models = {
request.state.model["id"]: request.state.model,
@@ -710,8 +695,6 @@ async def generate_emoji(
async def generate_moa_response(
request: Request, form_data: dict, user=Depends(get_verified_user)
):
check_credit_by_user_id(user_id=user.id, form_data=form_data)
if getattr(request.state, "direct", False) and hasattr(request.state, "model"):
models = {
request.state.model["id"]: request.state.model,