FUNCTIONS_DIR with local files is respected and Function is visible in UI.
Actual Behavior:
Only Functions in database show up, no Python files that exist in FUNCTIONS_DIR.
Description
Thanks for the nice work! I'm trying to get a custom function to show up in the UI by settingFUNCTIONS_DIR, but they're not showing up. My directory structure in the container looks like:
Combined with FUNCTIONS_DIR=/app/backend/functions.
Instead, when I upload a function through the UI, it ends up in the database and does show in the UI.
When scanning the code base I could not find how FUNCTIONS_DIR is actually picked up. Is something misconfigured?
Reproduction Details
Steps to Reproduce:
Build an image with a functions folder containing a *.py file.
Start the container with FUNCTIONS_DIR pointing to that directory
Open UI
Additional Information
N/A
Originally created by @gpgn on GitHub (Oct 4, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/5907
# Bug Report
## Installation Method
Docker image: `ghcr.io/open-webui/open-webui:0.3.23-ollama`
## Environment
- **Open WebUI Version:** v0.3.23
- `FUNCTIONS_DIR: "/app/backend/functions"`
## Expected Behavior:
`FUNCTIONS_DIR` with local files is respected and Function is visible in UI.
## Actual Behavior:
Only Functions in database show up, no Python files that exist in `FUNCTIONS_DIR`.
## Description
Thanks for the nice work! I'm trying to get a custom function to show up in the UI by [setting](https://docs.openwebui.com/getting-started/env-configuration/#functions_dir) `FUNCTIONS_DIR`, but they're not showing up. My directory structure in the container looks like:
```txt
app
├── backend
│ ├── functions
│ │ ├── some_function.py
```
Combined with `FUNCTIONS_DIR=/app/backend/functions`.
Instead, when I upload a function through the UI, it ends up in the database and does show in the UI.
When scanning the code base I could not find how `FUNCTIONS_DIR` is actually picked up. Is something misconfigured?
## Reproduction Details
**Steps to Reproduce:**
- Build an image with a functions folder containing a `*.py` file.
- Start the container with `FUNCTIONS_DIR` pointing to that directory
- Open UI
## Additional Information
N/A
@tjbck Thanks for confirming. Is there another way to keep functions as code and under version control, and have them available at startup of the container?
I guess we can do inserts in the database but its more cumbersome and messy to manage in a declarative/IaC way.
<!-- gh-comment-id:2394017616 -->
@gpgn commented on GitHub (Oct 4, 2024):
@tjbck Thanks for confirming. Is there another way to keep functions as code and under version control, and have them available at startup of the container?
I guess we can do inserts in the database but its more cumbersome and messy to manage in a declarative/IaC way.
Unfortunately not at the moment, migration to the database had to be introduced to enable uses cases like using multiple open webui instances for load balancing, but I will try to think of something that might streamline your workflow once I'm done implementing all the priority features!
<!-- gh-comment-id:2394322405 -->
@tjbck commented on GitHub (Oct 4, 2024):
Unfortunately not at the moment, migration to the database had to be introduced to enable uses cases like using multiple open webui instances for load balancing, but I will try to think of something that might streamline your workflow once I'm done implementing all the priority features!
Git integration has long been on the roadmap, I'm sure Tim will come up with something nice!
<!-- gh-comment-id:2397324040 -->
@justinh-rahb commented on GitHub (Oct 7, 2024):
Git integration has long been on the roadmap, I'm sure Tim will come up with something nice!
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @gpgn on GitHub (Oct 4, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/5907
Bug Report
Installation Method
Docker image:
ghcr.io/open-webui/open-webui:0.3.23-ollamaEnvironment
FUNCTIONS_DIR: "/app/backend/functions"Expected Behavior:
FUNCTIONS_DIRwith local files is respected and Function is visible in UI.Actual Behavior:
Only Functions in database show up, no Python files that exist in
FUNCTIONS_DIR.Description
Thanks for the nice work! I'm trying to get a custom function to show up in the UI by setting
FUNCTIONS_DIR, but they're not showing up. My directory structure in the container looks like:Combined with
FUNCTIONS_DIR=/app/backend/functions.Instead, when I upload a function through the UI, it ends up in the database and does show in the UI.
When scanning the code base I could not find how
FUNCTIONS_DIRis actually picked up. Is something misconfigured?Reproduction Details
Steps to Reproduce:
*.pyfile.FUNCTIONS_DIRpointing to that directoryAdditional Information
N/A
@tjbck commented on GitHub (Oct 4, 2024):
Good catch,
FUNCTIONS_DIRhas been Deprecated.@gpgn commented on GitHub (Oct 4, 2024):
@tjbck Thanks for confirming. Is there another way to keep functions as code and under version control, and have them available at startup of the container?
I guess we can do inserts in the database but its more cumbersome and messy to manage in a declarative/IaC way.
@tjbck commented on GitHub (Oct 4, 2024):
Unfortunately not at the moment, migration to the database had to be introduced to enable uses cases like using multiple open webui instances for load balancing, but I will try to think of something that might streamline your workflow once I'm done implementing all the priority features!
@justinh-rahb commented on GitHub (Oct 7, 2024):
Git integration has long been on the roadmap, I'm sure Tim will come up with something nice!