mirror of
https://github.com/open-webui/docs
synced 2025-05-20 11:18:42 +00:00
Merge pull request #345 from 0xThresh/enh-functions-doc
Minor updates to functions docs
This commit is contained in:
commit
57daaf3f5e
@ -5,7 +5,7 @@ title: "🧰 Functions"
|
||||
|
||||
## 🚀 What Are Functions?
|
||||
|
||||
Functions are like **plugins** for OpenWebUI. They help you **extend its capabilities**—whether it’s adding support for new AI models like Anthropic or Vertex AI, tweaking how messages are processed, or introducing custom buttons to the interface for better usability.
|
||||
Functions are like **plugins** for OpenWebUI. They help you **extend its capabilities**—whether it’s adding support for new AI model providers like Anthropic or Vertex AI, tweaking how messages are processed, or introducing custom buttons to the interface for better usability.
|
||||
|
||||
Unlike external tools that may require complex integrations, **Functions are built-in and run within the OpenWebUI environment.** That means they are fast, modular, and don’t rely on external dependencies.
|
||||
|
||||
@ -29,7 +29,7 @@ A **Pipe Function** is how you create **custom agents/models** or integrations,
|
||||
|
||||
**Use case example:**
|
||||
Imagine you want to query Google Search directly from OpenWebUI. You can create a Pipe Function that:
|
||||
1. Takes your input.
|
||||
1. Takes your message as the search query.
|
||||
2. Sends the query to Google Search’s API.
|
||||
3. Processes the response and returns it to you inside the WebUI like a normal "model" response.
|
||||
|
||||
@ -82,7 +82,7 @@ Learn how to set them up in the [**Action Functions Guide**](./action.mdx).
|
||||
Here's how to put Functions to work in OpenWebUI:
|
||||
|
||||
### 1. **Install Functions**
|
||||
You can install Functions via the OpenWebUI interface or by importing them manually.
|
||||
You can install Functions via the OpenWebUI interface or by importing them manually. You can find community-created functions on the [OpenWebUI Community Site](https://openwebui.com/functions).
|
||||
|
||||
⚠️ **Be cautious.** Only install Functions from trusted sources. Running unknown code poses security risks.
|
||||
|
||||
|
@ -8,9 +8,9 @@ import Common from './tab-shared/Common.md';
|
||||
|
||||
|
||||
#### Pipe
|
||||
A Pipe is used to create a "Model" with custom logic and processing. A Pipe will always show up as it's own singular model in the OpenWebUI interface and will, much like a filter
|
||||
A Pipe is used to create a "Model" with custom logic and processing. A Pipe will always show up as its own singular model in the OpenWebUI interface.
|
||||
|
||||
A Pipe has a single main component called a pipe function. This component encapsulates all of the primary logic that the Pipe will perform.
|
||||
A Pipe has a single main component called a **pipe function**. This component encapsulates all of the primary logic that the Pipe will perform.
|
||||
|
||||
<details>
|
||||
<summary>Example</summary>
|
||||
@ -43,12 +43,12 @@ class Pipe:
|
||||
</details>
|
||||
|
||||
#### Manifold
|
||||
A Manifold is used to create a collection of Pipes. If a Pipe creates a singular "Model", a Manifold creates a set of "Models." Manifolds are typically used to create integrations with other providers.
|
||||
A Manifold is used to create a collection of Pipes. If a Pipe creates a singular "Model", a Manifold creates a set of "Models." Manifolds are typically used to create integrations with other model providers, such as Anthropic or Groq.
|
||||
|
||||
A Manifold has two main components:
|
||||
|
||||
##### Pipes Function
|
||||
This is used to simply initiate a dictionary to hold all of the Pipes created by the manifold
|
||||
This is used to simply initiate a dictionary to hold all of the Pipes created by the manifold.
|
||||
|
||||
##### Pipe Function
|
||||
As referenced above, this component encapsulates all of the primary logic that the Pipe will perform.
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
### Valves and UserValves - (optional, but HIGHLY encouraged)
|
||||
|
||||
Valves and UserValves are used to allow users to provide dyanmic details such as an API key or a configuration option. These will create a fillable field or a bool switch in the GUI menu for the given function.
|
||||
Valves and UserValves are used to allow users to provide dynamic details such as an API key or a configuration option. These will create a fillable field or a bool switch in the GUI menu for the given function.
|
||||
|
||||
Valves are configurable by admins alone and UserValves are configurable by any users.
|
||||
|
||||
|
@ -95,7 +95,7 @@ Each tool must have type hints for arguments. As of version OpenWebUI version 0.
|
||||
|
||||
### Valves and UserValves - (optional, but HIGHLY encouraged)
|
||||
|
||||
Valves and UserValves are used to allow users to provide dyanmic details such as an API key or a configuration option. These will create a fillable field or a bool switch in the GUI menu for the given Tool.
|
||||
Valves and UserValves are used to allow users to provide dynamic details such as an API key or a configuration option. These will create a fillable field or a bool switch in the GUI menu for the given Tool.
|
||||
|
||||
Valves are configurable by admins alone and UserValves are configurable by any users.
|
||||
|
||||
@ -147,7 +147,7 @@ This is used to add statuses to a message while it is performing steps. These ca
|
||||
await __event_emitter__(
|
||||
{
|
||||
"type": "status", # We set the type here
|
||||
"data": {"description": "Message that shows up in the chat", "done": False},
|
||||
"data": {"description": "Message that shows up in the chat", "done": False, "hidden": False},
|
||||
# Note done is False here indicating we are still emitting statuses
|
||||
}
|
||||
)
|
||||
@ -178,8 +178,9 @@ async def test_function(
|
||||
await __event_emitter__(
|
||||
{
|
||||
"type": "status",
|
||||
"data": {"description": "Completed a task message", "done": True},
|
||||
"data": {"description": "Completed a task message", "done": True, "hidden": False},
|
||||
# Note done is True here indicating we are done emitting statuses
|
||||
# You can also set "hidden": True if you want to remove the status once the message is returned
|
||||
}
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user