mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[GH-ISSUE #7852] Manifold functions don't preserve value of valves when executed #30438
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @reecelikesramen on GitHub (Dec 14, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/7852
Bug Report
Installation Method
Standard Docker installation found in "Quick Start" section of the docs.
Environment
Open WebUI Version: [v0.4.8]
Ollama (if applicable): [N/A]
Operating System: [Ubuntu 20.04 x64]
Browser (if applicable): [Arc Browser (Chromium Engine Version 131.0.6778.140)]
Confirmation:
Expected Behavior:
When using a model provided by a manifold function, in
def pipe, the value ofself.valvesshould be equal the value ofself.valvesduring construction.Actual Behavior:
For a Valves class with a single string field, that field is populated during construction, but if checked during
def pipthat field is an empty string.Description
Bug Summary:
I am using the Anthropic function. The Valve for the Anthropic API key in the constructor is set properly using the environment variables, but then when the
def pipefunction is executed by using an Anthropic model, printing the value of the Anthropic API key Valve is empty.Reproduction Details
Steps to Reproduce:
self.valves = self.Valves(**{"ANTHROPIC_API_KEY": os.getenv("ANTHROPIC_API_KEY", "<put some value here>")}).print("CONSTRUCTOR", self.valves)after that in the constructor.print("PIPE", self.valves)anywhere in thedef pipefunction.def pipefunction.Logs and Screenshots
Docker Container Logs:
Log section after saving the function. You can see
ANTHROPIC_API_KEY='sk-ant-<omitted>'is where I callprint(self.valves)in the constructor:Log section after the previous log and trying to send a chat message to an Anthropic model. You can see
ANTHROPIC_API_KEY=''after the linevalvesis where I callprint(self.valves)in thedef pipefunction.Browser logs:
@reecelikesramen commented on GitHub (Dec 14, 2024):
For now I get around this by just calling os.getenv("ANTHROPIC_API_KEY") inside the
def pipemethod.@reecelikesramen commented on GitHub (Dec 14, 2024):
I tested adding an additional field to the Valves class and populating it in the constructor. Its value was also emptied by the time it was printed in
def pipe