Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor updates to functions docs #345

Merged
merged 2 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/features/plugin/functions/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.

Expand Down Expand Up @@ -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.

Expand Down
8 changes: 4 additions & 4 deletions docs/features/plugin/functions/pipe.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/features/plugin/functions/tab-shared/Common.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
7 changes: 4 additions & 3 deletions docs/features/plugin/tools/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
}
)
Expand Down Expand Up @@ -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
}
)

Expand Down