Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
5f2d37dc
Commit
5f2d37dc
authored
Jun 23, 2024
by
Timothy J. Baek
Browse files
fix: valves
parent
2eb15ea1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
backend/main.py
backend/main.py
+9
-4
No files found.
backend/main.py
View file @
5f2d37dc
...
@@ -270,8 +270,9 @@ async def get_function_call_response(
...
@@ -270,8 +270,9 @@ async def get_function_call_response(
if
hasattr
(
toolkit_module
,
"valves"
)
and
hasattr
(
if
hasattr
(
toolkit_module
,
"valves"
)
and
hasattr
(
toolkit_module
,
"Valves"
toolkit_module
,
"Valves"
):
):
valves
=
Tools
.
get_tool_valves_by_id
(
tool_id
)
toolkit_module
.
valves
=
toolkit_module
.
Valves
(
toolkit_module
.
valves
=
toolkit_module
.
Valves
(
**
Tools
.
get_tool_valves_by_id
(
tool_id
)
**
(
valves
if
valves
else
{}
)
)
)
function
=
getattr
(
toolkit_module
,
result
[
"name"
])
function
=
getattr
(
toolkit_module
,
result
[
"name"
])
...
@@ -417,8 +418,9 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware):
...
@@ -417,8 +418,9 @@ class ChatCompletionMiddleware(BaseHTTPMiddleware):
if
hasattr
(
function_module
,
"valves"
)
and
hasattr
(
if
hasattr
(
function_module
,
"valves"
)
and
hasattr
(
function_module
,
"Valves"
function_module
,
"Valves"
):
):
valves
=
Functions
.
get_function_valves_by_id
(
filter_id
)
function_module
.
valves
=
function_module
.
Valves
(
function_module
.
valves
=
function_module
.
Valves
(
**
Functions
.
get_function_valves_by_id
(
filter_id
)
**
(
valves
if
valves
else
{}
)
)
)
try
:
try
:
...
@@ -906,8 +908,10 @@ async def generate_chat_completions(form_data: dict, user=Depends(get_verified_u
...
@@ -906,8 +908,10 @@ async def generate_chat_completions(form_data: dict, user=Depends(get_verified_u
if
hasattr
(
function_module
,
"valves"
)
and
hasattr
(
if
hasattr
(
function_module
,
"valves"
)
and
hasattr
(
function_module
,
"Valves"
function_module
,
"Valves"
):
):
valves
=
Functions
.
get_function_valves_by_id
(
pipe_id
)
function_module
.
valves
=
function_module
.
Valves
(
function_module
.
valves
=
function_module
.
Valves
(
**
Functions
.
get_function_valves_by_id
(
pipe_id
)
**
(
valves
if
valves
else
{}
)
)
)
pipe
=
function_module
.
pipe
pipe
=
function_module
.
pipe
...
@@ -1134,8 +1138,9 @@ async def chat_completed(form_data: dict, user=Depends(get_verified_user)):
...
@@ -1134,8 +1138,9 @@ async def chat_completed(form_data: dict, user=Depends(get_verified_user)):
if
hasattr
(
function_module
,
"valves"
)
and
hasattr
(
if
hasattr
(
function_module
,
"valves"
)
and
hasattr
(
function_module
,
"Valves"
function_module
,
"Valves"
):
):
valves
=
Functions
.
get_function_valves_by_id
(
filter_id
)
function_module
.
valves
=
function_module
.
Valves
(
function_module
.
valves
=
function_module
.
Valves
(
**
Functions
.
get_function_valves_by_id
(
filter_id
)
**
(
valves
if
valves
else
{}
)
)
)
try
:
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment