open-webui/backend/open_webui/tools
Classic298 3d6598fccb
fix: steer models to replace_range in the replace_note_content tool description (#30048)
Asked to add a section or change a few lines, models answer with a whole-note
replace_note_content call and the rest of the note is gone, with nothing to
undo because the editor only records versions on chat inserts. The tool
already supports replace_range operations with an expected guard, but its
description never said when to use them or how the offsets work, so models
defaulted to sending the whole note back.

The docstring, which is the description every model receives for this tool
in note chats and normal chats alike, now states the preference for range
edits and the offset, overlap and expected rules the handler enforces.
Verified the text lands in the generated tool spec unchanged and that range
edits, the expected mismatch rejection and whole-note replace behave as
described against a sqlite data dir.
2026-09-15 22:51:49 -04:00
..
__init__.py feat: native function calling for built-in tools 2026-01-05 04:45:17 +04:00
builtin.py fix: steer models to replace_range in the replace_note_content tool description (#30048) 2026-09-15 22:51:49 -04:00
knowledge_fs.py feat: sort flags for kb_exec file listings (#29840) 2026-09-09 12:30:47 -04:00