mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #4602] [MERGED] refactor, perf: Tools refactor (progress PR 1) #21521
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/4602
Author: @michaelpoluektov
Created: 8/14/2024
Status: ✅ Merged
Merged: 8/17/2024
Merged by: @tjbck
Base:
dev← Head:tools-refac-1📝 Commits (10+)
3befadbremove unnecessary nesting, remove unused endpoint589efcdis_chat_completion_request helper, remove nesting23f1beecleanup60003c9rename to chat_completions_inlet_handler for clarity556141crefactor task0c9119dmove task to metadata9fb7096factor out get_content_from_responsea68b918refactor get_function_call_responseff9d899fix more LSP errorse866882factor out get_function_calling_payload📊 Changes
3 files changed (+350 additions, -447 deletions)
View changed files
📝
backend/apps/webui/models/users.py(+3 -10)📝
backend/main.py(+346 -436)📝
backend/utils/task.py(+1 -1)📄 Description
Pull Request Checklist
Reviewing is easier to be done commit-by-commit. No single commit should break anything.
NOTE:
This is not the PR that implements OpenAI tool calling. This is an intermediate PR that refactors everything around tool calling to better support passing tools to the request body (as well as improve performance slightly).
Before submitting, make sure you've checked the following:
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
Breaking Changes
taskto be passed throughbody["metadata"]["task"]rather thanbody["task"]. This is consistent with other types of functions/pipelines and should not affect any function/pipeline examples (none of them seem to usetaskin inlets).Additional Information
I have tested this with 2 toolkits, one of which had 2 tools, as well as an OpenAI proxy function, default OpenAI API and Ollama (llama3.1:8b). Pipelines were not tested.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.