Skip to content

Commit f812072

Browse files
committed
refac
1 parent 8934bfb commit f812072

1 file changed

Lines changed: 25 additions & 21 deletions

File tree

backend/open_webui/tools/builtin.py

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,8 @@ async def search_memories(
595595
__user__: dict = None,
596596
) -> str:
597597
"""
598-
Search the user's stored memories for relevant information.
598+
Search saved user memories for preferences, facts, or prior context that
599+
may help personalize the answer.
599600
600601
:param query: The search query to find relevant memories
601602
:param count: Number of memories to return (default 5)
@@ -640,7 +641,7 @@ async def add_memory(
640641
__user__: dict = None,
641642
) -> str:
642643
"""
643-
Store a new memory for the user.
644+
Save a user-provided preference, fact, or instruction as memory for future chats.
644645
645646
:param content: The memory content to store
646647
:return: Confirmation that the memory was stored
@@ -670,7 +671,7 @@ async def replace_memory_content(
670671
__user__: dict = None,
671672
) -> str:
672673
"""
673-
Update the content of an existing memory by its ID.
674+
Update an existing saved memory by its ID when its content needs correction.
674675
675676
:param memory_id: The ID of the memory to update
676677
:param content: The new content for the memory
@@ -704,7 +705,7 @@ async def delete_memory(
704705
__user__: dict = None,
705706
) -> str:
706707
"""
707-
Delete a memory by its ID.
708+
Delete a saved memory by its ID.
708709
709710
:param memory_id: The ID of the memory to delete
710711
:return: Confirmation that the memory was deleted
@@ -735,7 +736,7 @@ async def list_memories(
735736
__user__: dict = None,
736737
) -> str:
737738
"""
738-
List all stored memories for the user.
739+
List all stored memories for the user, including IDs and timestamps.
739740
740741
:return: JSON list of all memories with id, content, and dates
741742
"""
@@ -779,7 +780,7 @@ async def search_notes(
779780
__user__: dict = None,
780781
) -> str:
781782
"""
782-
Search the user's notes by title and content.
783+
Search the user's saved notes by title and content.
783784
784785
:param query: The search query to find matching notes
785786
:param count: Maximum number of results to return (default: 5)
@@ -982,7 +983,7 @@ async def replace_note_content(
982983
__user__: dict = None,
983984
) -> str:
984985
"""
985-
Update the content of a note. Use this to modify task lists, add notes, or update content.
986+
Update the markdown content, and optionally the title, of an existing note.
986987
987988
:param note_id: The ID of the note to update
988989
:param content: The new markdown content for the note
@@ -1059,6 +1060,7 @@ async def search_chats(
10591060
) -> str:
10601061
"""
10611062
Search the user's previous chat conversations by title and message content.
1063+
Helpful for finding details from earlier conversations.
10621064
10631065
:param query: The search query to find matching chats
10641066
:param count: Maximum number of results to return (default: 5)
@@ -1136,7 +1138,8 @@ async def view_chat(
11361138
__user__: dict = None,
11371139
) -> str:
11381140
"""
1139-
Get the full conversation history of a chat by its ID.
1141+
Get the full conversation history of a chat by its ID after a relevant
1142+
previous chat has been identified.
11401143
11411144
:param chat_id: The ID of the chat to retrieve
11421145
:return: JSON with the chat's id, title, and messages
@@ -1206,7 +1209,7 @@ async def search_channels(
12061209
__user__: dict = None,
12071210
) -> str:
12081211
"""
1209-
Search for channels by name and description that the user has access to.
1212+
Search channels by name and description to find accessible team spaces.
12101213
12111214
:param query: The search query to find matching channels
12121215
:param count: Maximum number of results to return (default: 5)
@@ -1260,7 +1263,8 @@ async def search_channel_messages(
12601263
__user__: dict = None,
12611264
) -> str:
12621265
"""
1263-
Search for messages in channels the user is a member of, including thread replies.
1266+
Search messages in channels the user is a member of, including thread replies.
1267+
Helpful for finding prior team/channel discussion.
12641268
12651269
:param query: The search query to find matching messages
12661270
:param count: Maximum number of results to return (default: 10)
@@ -1488,7 +1492,8 @@ async def list_knowledge_bases(
14881492
__user__: dict = None,
14891493
) -> str:
14901494
"""
1491-
List the user's accessible knowledge bases.
1495+
List the user's accessible knowledge bases so a relevant internal source
1496+
can be chosen.
14921497
14931498
:param count: Maximum number of KBs to return (default: 10)
14941499
:param skip: Number of results to skip for pagination (default: 0)
@@ -1546,7 +1551,8 @@ async def search_knowledge_bases(
15461551
__user__: dict = None,
15471552
) -> str:
15481553
"""
1549-
Search the user's accessible knowledge bases by name and description.
1554+
Search the user's accessible knowledge bases by name and description to find
1555+
a relevant internal source.
15501556
15511557
:param query: The search query to find matching knowledge bases
15521558
:param count: Maximum number of results to return (default: 5)
@@ -1609,6 +1615,7 @@ async def search_knowledge_files(
16091615
"""
16101616
Search files by filename across knowledge bases the user has access to.
16111617
When the model has attached knowledge, searches only within attached KBs and files.
1618+
Helpful when looking for a specific document or file name.
16121619
16131620
:param query: The search query to find matching files by filename
16141621
:param knowledge_id: Optional KB id to limit search to a specific knowledge base
@@ -1780,6 +1787,7 @@ async def grep_knowledge_files(
17801787
Search for exact text across knowledge files. Returns matching lines with line numbers.
17811788
Unlike query_knowledge_files (semantic/vector search), this performs exact string matching.
17821789
Automatically detects regex patterns (e.g. "error|warn", "version \\d+").
1790+
Helpful for literal strings, identifiers, error messages, or regex-style searches.
17831791
17841792
:param pattern: The text pattern to search for (regex auto-detected)
17851793
:param file_id: Optional file ID to search within a single file only
@@ -2342,6 +2350,7 @@ async def query_knowledge_files(
23422350
"""
23432351
Search knowledge base files using semantic/vector search. Searches across collections (KBs),
23442352
individual files, and notes that the user has access to.
2353+
Helpful for internal documentation, uploaded knowledge, and attached model knowledge.
23452354
23462355
:param query: The search query to find semantically relevant content
23472356
:param knowledge_ids: Optional list of KB ids to limit search to specific knowledge bases
@@ -2557,7 +2566,7 @@ async def query_knowledge_bases(
25572566
"""
25582567
Search knowledge bases by semantic similarity to query.
25592568
Finds KBs whose name/description match the meaning of your query.
2560-
Use this to discover relevant knowledge bases before querying their files.
2569+
Helpful for discovering which knowledge base to query next.
25612570
25622571
:param query: Natural language query describing what you're looking for
25632572
:param count: Maximum results (default: 5)
@@ -2763,9 +2772,7 @@ async def create_tasks(
27632772
__user__: dict = None,
27642773
) -> str:
27652774
"""
2766-
Create a task checklist to track progress on multi-step work.
2767-
Call this once at the start to define all steps, then use
2768-
update_task to mark each task as you complete it.
2775+
Create a visible task checklist for multi-step work so progress can be shown in chat.
27692776
27702777
:param tasks: List of task items. Each item: content (string, required), status (pending|in_progress|completed|cancelled, default pending), id (optional, auto-generated).
27712778
:return: JSON with the full task list and summary counts
@@ -2816,9 +2823,7 @@ async def update_task(
28162823
__user__: dict = None,
28172824
) -> str:
28182825
"""
2819-
Mark a single task as completed, in_progress, pending, or cancelled.
2820-
Call this after finishing each step. You MUST call this for every
2821-
task, including the very last one.
2826+
Mark a single visible task item as completed, in_progress, pending, or cancelled.
28222827
28232828
:param id: The task ID to update
28242829
:param status: New status: completed, in_progress, pending, or cancelled (default: completed)
@@ -3258,8 +3263,7 @@ async def search_calendar_events(
32583263
) -> str:
32593264
"""
32603265
Search calendar events, reminders, and scheduled items by text and/or date range.
3261-
Use this to check what's coming up, find a specific event or reminder, or list
3262-
the user's schedule for a time period.
3266+
Helpful for finding upcoming events, reminders, or schedule items.
32633267
32643268
:param query: Search text to match against event title, description, or location (optional)
32653269
:param start: Only return events starting at or after this datetime, e.g. "2026-04-20 00:00" (optional)

0 commit comments

Comments
 (0)