Skip to content

functions

Classes

FunctionMeta

Bases: BaseModel

Metadata for a function.

Attributes

description
description: Optional[str] = None

Description of the function.

manifest
manifest: Optional[dict] = {}

Manifest data extracted from the function's frontmatter.

Dict Fields
  • version (str, optional): Version of the function
  • funding_url (str, optional): URL for funding/support
  • required_open_webui_version (str, optional): Minimum required Open WebUI version
  • icon_url (str, optional): URL for function icon

FunctionModel

Bases: BaseModel

Model representing a function.

Attributes

id
id: str

Unique identifier for the function.

user_id
user_id: str

ID of the user who owns the function.

name
name: str

Name of the function.

type
type: str

Type of the function (e.g., 'filter', 'action').

content
content: str

The Python source code content of the function.

meta

Metadata associated with the function.

is_active
is_active: bool = False

Whether the function is currently active.

is_global
is_global: bool = False

Whether the function is globally available.

updated_at
updated_at: int

Timestamp of the last update (epoch time).

created_at
created_at: int

Timestamp of creation (epoch time).

FunctionWithValvesModel

Bases: BaseModel

Model representing a function including its valves configuration.

Attributes

id
id: str

Unique identifier for the function.

user_id
user_id: str

ID of the user who owns the function.

name
name: str

Name of the function.

type
type: str

Type of the function.

content
content: str

The Python source code content of the function.

meta

Metadata associated with the function.

valves
valves: Optional[dict] = None

Configuration values (valves) for the function.

Dict Fields
  • priority (int, optional): Priority level for filter operations
  • max_turns (int, optional): Maximum allowable conversation turns
  • OPENAI_API_BASE_URL (str, optional): Base URL for OpenAI API endpoints
  • OPENAI_API_KEY (str, optional): API key for OpenAI API access
  • Additional keys may exist depending on the specific function implementation
is_active
is_active: bool = False

Whether the function is currently active.

is_global
is_global: bool = False

Whether the function is globally available.

updated_at
updated_at: int

Timestamp of the last update (epoch time).

created_at
created_at: int

Timestamp of creation (epoch time).

FunctionUserResponse

Bases: FunctionModel

Response model for a function including user details.

Attributes

user
user: Optional[UserModel] = None

Details of the user who owns the function.

FunctionResponse

Bases: BaseModel

Response model for function details.

Attributes

id
id: str

Unique identifier for the function.

user_id
user_id: str

ID of the user who owns the function.

type
type: str

Type of the function.

name
name: str

Name of the function.

meta

Metadata associated with the function.

is_active
is_active: bool

Whether the function is currently active.

is_global
is_global: bool

Whether the function is globally available.

updated_at
updated_at: int

Timestamp of the last update (epoch time).

created_at
created_at: int

Timestamp of creation (epoch time).

FunctionForm

Bases: BaseModel

Form for creating or updating a function.

Attributes

id
id: str

Unique identifier for the function.

name
name: str

Name of the function.

content
content: str

The Python source code content of the function.

meta

Metadata associated with the function.

FunctionValves

Bases: BaseModel

Model for function valves.

Attributes

valves
valves: Optional[dict] = None

Dictionary of valve configuration values.

Dict Fields
  • priority (int, optional): Priority level for filter operations
  • max_turns (int, optional): Maximum allowable conversation turns
  • OPENAI_API_BASE_URL (str, optional): Base URL for OpenAI API endpoints
  • OPENAI_API_KEY (str, optional): API key for OpenAI API access
  • Additional keys may exist depending on the specific function implementation

SyncFunctionsForm

Bases: BaseModel

Form for syncing multiple functions.

Attributes

functions
functions: list[FunctionWithValvesModel] = []

List of functions to sync.

LoadUrlForm

Bases: BaseModel

Form for loading a function from a URL.

Attributes

url
url: HttpUrl

URL to load the function from (e.g., GitHub URL).