mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-02 06:39:02 -05:00
[PR #4724] [MERGED] feat: Add __tools__ optional param for function pipes
#8346
Reference in New Issue
Block a user
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/4724
Author: @michaelpoluektov
Created: 8/19/2024
Status: ✅ Merged
Merged: 8/20/2024
Merged by: @tjbck
Base:
dev← Head:tools-refac-2.1📝 Commits (10+)
3164354refactor into single wrapper32874a8add filter toggle envvarsce7a1a7remove more nestingfd422d2use filters envvarsa4a7d67move tools utils to utils.tools18965dcdelete keys if envvars are set13c03bfadd tools custom parama933319import error?528df12fix: nonetype error5edc211pass docstring to function📊 Changes
6 files changed (+249 additions, -133 deletions)
View changed files
📝
backend/apps/ollama/main.py(+2 -5)📝
backend/apps/webui/main.py(+19 -11)📝
backend/config.py(+0 -1)📝
backend/main.py(+38 -115)➕
backend/utils/schemas.py(+104 -0)📝
backend/utils/tools.py(+86 -1)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
__tools__param to function pipes.Added
__tools__: dict[str, dict]param for tool calling.The
__tools__dict maps tool names to a dict with keys"toolkit_id","callable","spec",pydantic_model,"file_handler"and"citation"where"file_handler"and"citation"are booleans for whether or not the tool handles files and has a citation object (mostly useful for the tool prepending thing) and"spec"is an OpenAI compatible "function" spec for the tool.Testing
Tested with Ollama, OpenAI and an OpenAI proxy function, with the flags enabled and disabled.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.