mirror of
https://github.com/open-webui/open-webui
synced 2025-05-29 09:42:12 +00:00
remove config options for now
This commit is contained in:
parent
9d7037b730
commit
556bc8669a
@ -293,16 +293,15 @@ async def generate_function_chat_completion(form_data, user, files, tool_ids):
|
|||||||
"__event_call__": __event_call__,
|
"__event_call__": __event_call__,
|
||||||
"__task__": __task__,
|
"__task__": __task__,
|
||||||
}
|
}
|
||||||
if not ENABLE_TOOLS_FILTER:
|
tools_params = {
|
||||||
tools_params = {
|
**extra_params,
|
||||||
**extra_params,
|
"__model__": app.state.MODELS[form_data["model"]],
|
||||||
"__model__": app.state.MODELS[form_data["model"]],
|
"__messages__": form_data["messages"],
|
||||||
"__messages__": form_data["messages"],
|
"__files__": files,
|
||||||
"__files__": files,
|
}
|
||||||
}
|
configured_tools = get_tools(app, tool_ids, user, tools_params)
|
||||||
configured_tools = get_tools(app, tool_ids, user, tools_params)
|
|
||||||
|
|
||||||
extra_params["__tools__"] = configured_tools
|
extra_params["__tools__"] = configured_tools
|
||||||
if model_info:
|
if model_info:
|
||||||
if model_info.base_model_id:
|
if model_info.base_model_id:
|
||||||
form_data["model"] = model_info.base_model_id
|
form_data["model"] = model_info.base_model_id
|
||||||
|
@ -174,13 +174,6 @@ for version in soup.find_all("h2"):
|
|||||||
|
|
||||||
CHANGELOG = changelog_json
|
CHANGELOG = changelog_json
|
||||||
|
|
||||||
####################################
|
|
||||||
# FILTERS
|
|
||||||
####################################
|
|
||||||
|
|
||||||
ENABLE_TOOLS_FILTER = os.environ.get("ENABLE_TOOLS_FILTER", "True").lower() == "true"
|
|
||||||
ENABLE_FILES_FILTER = os.environ.get("ENABLE_FILES_FILTER", "True").lower() == "true"
|
|
||||||
|
|
||||||
####################################
|
####################################
|
||||||
# SAFE_MODE
|
# SAFE_MODE
|
||||||
####################################
|
####################################
|
||||||
|
@ -119,8 +119,6 @@ from config import (
|
|||||||
WEBUI_SESSION_COOKIE_SAME_SITE,
|
WEBUI_SESSION_COOKIE_SAME_SITE,
|
||||||
WEBUI_SESSION_COOKIE_SECURE,
|
WEBUI_SESSION_COOKIE_SECURE,
|
||||||
ENABLE_ADMIN_CHAT_ACCESS,
|
ENABLE_ADMIN_CHAT_ACCESS,
|
||||||
ENABLE_TOOLS_FILTER,
|
|
||||||
ENABLE_FILES_FILTER,
|
|
||||||
AppConfig,
|
AppConfig,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -372,10 +370,6 @@ async def get_content_from_response(response) -> Optional[str]:
|
|||||||
async def chat_completion_tools_handler(
|
async def chat_completion_tools_handler(
|
||||||
body: dict, user: UserModel, extra_params: dict
|
body: dict, user: UserModel, extra_params: dict
|
||||||
) -> tuple[dict, dict]:
|
) -> tuple[dict, dict]:
|
||||||
log.debug(f"{ENABLE_TOOLS_FILTER=}")
|
|
||||||
if not ENABLE_TOOLS_FILTER:
|
|
||||||
return body, {}
|
|
||||||
|
|
||||||
# If tool_ids field is present, call the functions
|
# If tool_ids field is present, call the functions
|
||||||
tool_ids = body.pop("tool_ids", None)
|
tool_ids = body.pop("tool_ids", None)
|
||||||
if not tool_ids:
|
if not tool_ids:
|
||||||
@ -467,10 +461,6 @@ async def chat_completion_tools_handler(
|
|||||||
|
|
||||||
|
|
||||||
async def chat_completion_files_handler(body) -> tuple[dict, dict[str, list]]:
|
async def chat_completion_files_handler(body) -> tuple[dict, dict[str, list]]:
|
||||||
log.debug(f"{ENABLE_FILES_FILTER=}")
|
|
||||||
if not ENABLE_FILES_FILTER:
|
|
||||||
return body, {}
|
|
||||||
|
|
||||||
contexts = []
|
contexts = []
|
||||||
citations = []
|
citations = []
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user