Open WebUI Functions
Relevant source files
The following files were used as context for generating this wiki page:
Conduit provides a native mobile interface for Open WebUI, a self-hosted AI platform. While Conduit handles core chat interactions natively, it integrates with server-side Open WebUI functions—such as tools, filters, and actions—by reacting to specific events and data structures sent from the server. Conduit prioritizes native rendering of complex outputs generated by these functions, including Mermaid diagrams, LaTeX math, and interactive charts.
Conduit never executes the JavaScript associated with Open WebUI filters or tools on the mobile device. Instead, it interprets documented events sent by the server to modify client state, such as transitioning the user to a new chat session using a different model.
Sources: README.md:143-145, README.md:16-20
Functional Architecture
The integration between Conduit and Open WebUI functions relies on a structured data exchange where the server performs heavy lifting (like code execution or web searching) and the client renders the results using specialized UI components.
Event-Driven Interaction
Open WebUI filters interact with Conduit by emitting documented events. For example, a filter can trigger a model switch or a new chat initiation on the client side. This allows server-side logic to steer the mobile user experience without requiring the mobile app to run arbitrary server scripts.
Sources: README.md:143-145
Data Flow for Function Execution
The following diagram illustrates how Conduit handles a request involving server-side functions like a "Code Interpreter" tool.
The diagram shows the synchronous path where a user request triggers server-side function execution, which then returns structured data for native rendering.
Sources: README.md:112-116, packages/conduit_core/test/fixtures/chat_blobs/06_code_executions.json:45-66
Code Execution and Tools
Conduit natively renders the results of server-side code execution. When a tool like a Code Interpreter runs, the server sends a code_executions block containing the source code, the language, and the results (including text output and generated files).
Execution Data Structure
The client expects a specific JSON schema for code execution results within the assistant's message history.
| Field | Description |
|---|---|
id | Unique identifier for the execution instance. |
name | The name of the tool (e.g., "Code Interpreter"). |
code | The actual source code executed on the server. |
language | The programming language (e.g., "python"). |
result.output | Standard output text from the execution. |
result.files | List of generated file objects with names and URLs. |
Sources: packages/conduit_core/test/fixtures/chat_blobs/06_code_executions.json:45-66
Implementation Example
A typical payload for a Python-based visualization function includes both the code and the resulting image metadata.
{
"id": "ce-4a5b6c7d-8e9f-4012-a3b4-c5d6e7f8a9b0",
"name": "Code Interpreter",
"code": "import numpy as np\nimport matplotlib.pyplot as plt\n...",
"language": "python",
"result": {
"output": "saved\n",
"files": [
{
"name": "sine.png",
"url": "/cache/code/executions/ce-4a5b6c7d/sine.png"
}
]
}
}
Sources: packages/conduit_core/test/fixtures/chat_blobs/06_code_executions.json:47-64
UI Rendering of Function Outputs
Conduit uses native Flutter surfaces rather than web views to display the outputs of Open WebUI functions. This ensures high performance and consistent theming.
Specialized Components
The mobile client maps server-provided metadata to specific UI elements:
- Mermaid Diagrams: Rendered natively using a dedicated submodule.
- LaTeX and Math: Processed for clear display within chat bubbles.
- Code Blocks: Feature syntax highlighting with copy-to-clipboard and preview capabilities.
- Status History: Displays background actions like
knowledge_searchqueries. - Citations: Renders inline citations and source cards from web search or document RAG.
Sources: README.md:112-118, packages/conduit_core/test/fixtures/chat_blobs/06_code_executions.json:37-43, pubspec.yaml:57-63
UI Component Allowlist
Conduit maintains a strict platform_ui_allowlist.yaml to manage the use of Material and Cupertino widgets across its modules, ensuring that function-related UI remains performant and platform-appropriate.
Sources: tool/platform_ui_allowlist.yaml:1-20
Voice and Interaction Functions
Conduit supports advanced interaction functions including voice-call modes and on-device processing.
Voice Activity Detection (VAD)
Conduit integrates a Voice Activity Detection (VAD) system to manage audio input functions. This allows the app to detect when a user starts and stops speaking, which is essential for hands-free "voice call" modes.
The sequence diagram details the local detection of speech boundaries before finalizing the server request.
Sources: third_party/vad/UPSTREAM_README.md:113-145, README.md:128-129
Component Dependencies
| Dependency | Purpose |
|---|---|
vad | Voice Activity Detection using Silero models. |
record | Native audio recording and streaming. |
flutter_tex | Rendering LaTeX math output from functions. |
mermaid_flutter | Native rendering of Mermaid diagrams. |
Sources: pubspec.yaml:57-65, pubspec.yaml:75-78
Summary
Open WebUI Functions in Conduit allow the mobile client to remain lightweight and native while leveraging the complex logic of the Open WebUI ecosystem. By interpreting server-sent events and rendering structured JSON data (such as code execution results and search citations), Conduit provides a desktop-class feature set including interactive diagrams, math, and tools without executing server-side JavaScript locally.
Sources: README.md:16-20, README.md:143-145