From 6ed0756f67647bc55dd5c4c6197566184d8e20be Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 14 May 2025 22:40:02 +0400 Subject: [PATCH] fix --- docs/tutorials/tips/special_arguments.mdx | 39 ++++++----------------- 1 file changed, 10 insertions(+), 29 deletions(-) diff --git a/docs/tutorials/tips/special_arguments.mdx b/docs/tutorials/tips/special_arguments.mdx index 8d6545e..e2490ea 100644 --- a/docs/tutorials/tips/special_arguments.mdx +++ b/docs/tutorials/tips/special_arguments.mdx @@ -13,16 +13,12 @@ When developping your own `Tools`, `Functions` (`Filters`, `Pipes` or `Actions`) This page aims to detail the type and structure of each special argument as well as provide an example. - - ### `body` A `dict` usually destined to go almost directly to the model. Although it is not strictly a special argument, it is included here for easier reference and because it contains itself some special arguments. -
Example +
+Example ```json @@ -75,7 +71,8 @@ A `dict` with user information. Note that if the `UserValves` class is defined, its instance has to be accessed via `__user__["valves"]`. Otherwise, the `valves` keyvalue is missing entirely from `__user__`. -
Example +
+Example ```json { @@ -94,7 +91,8 @@ Note that if the `UserValves` class is defined, its instance has to be accessed A `dict` with wide ranging information about the chat, model, files, etc. -
Example +
+Example ```json { @@ -137,7 +135,8 @@ A `dict` with wide ranging information about the chat, model, files, etc. A `dict` with information about the model. -
Example +
+Example ```json { @@ -236,14 +235,10 @@ See the `__metadata__["message_id"]` value above. A `Callable` used to display event information to the user. -See the [related Tools page](./development.mdx) for examples. - ### `__event_call__` A `Callable` used for `Actions`. -See the [related Actions page](../functions/action.mdx) for examples. - ### `__files__` A `list` of files sent via the chat. Note that images are not considered files and are sent directly to the model as part of the `body["messages"]` list. @@ -259,7 +254,8 @@ assert the_file.exists() Note that the same files dict can also be accessed via `__metadata__["files"]` (and its value is `[]` if no files are sent) or via `body["files"]` (but the `files` key is missing entirely from `body` if no files are sent). -
Example +
+Example ```json @@ -331,23 +327,12 @@ A `str` for the type of task. Its value is just a shorthand for `__metadata__["t
- - - ### `__task_body__` A `dict` containing the `body` needed to accomplish a given `__task__`. Its value is just a shorthand for `__metadata__["task_body"]` if present, otherwise `None`. Its structure is the same as `body` above, with modifications like using the appropriate model and system message etc. - - ### `__tools__` @@ -355,7 +340,3 @@ A `list` of `ToolUserModel` instances. For details the attributes of `ToolUserModel` instances, the code can be found in [tools.py](https://github.com/open-webui/open-webui/blob/main/backend/open_webui/models/tools.py). -