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
9a6cbafd
Commit
9a6cbafd
authored
Jul 04, 2024
by
Timothy J. Baek
Browse files
fix: user valves
parent
f6dcffab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
backend/apps/webui/models/functions.py
backend/apps/webui/models/functions.py
+2
-2
backend/apps/webui/models/tools.py
backend/apps/webui/models/tools.py
+2
-2
No files found.
backend/apps/webui/models/functions.py
View file @
9a6cbafd
...
@@ -185,7 +185,7 @@ class FunctionsTable:
...
@@ -185,7 +185,7 @@ class FunctionsTable:
)
->
Optional
[
dict
]:
)
->
Optional
[
dict
]:
try
:
try
:
user
=
Users
.
get_user_by_id
(
user_id
)
user
=
Users
.
get_user_by_id
(
user_id
)
user_settings
=
user
.
settings
.
model_dump
()
user_settings
=
user
.
settings
.
model_dump
()
if
user
.
settings
else
{}
# Check if user has "functions" and "valves" settings
# Check if user has "functions" and "valves" settings
if
"functions"
not
in
user_settings
:
if
"functions"
not
in
user_settings
:
...
@@ -203,7 +203,7 @@ class FunctionsTable:
...
@@ -203,7 +203,7 @@ class FunctionsTable:
)
->
Optional
[
dict
]:
)
->
Optional
[
dict
]:
try
:
try
:
user
=
Users
.
get_user_by_id
(
user_id
)
user
=
Users
.
get_user_by_id
(
user_id
)
user_settings
=
user
.
settings
.
model_dump
()
user_settings
=
user
.
settings
.
model_dump
()
if
user
.
settings
else
{}
# Check if user has "functions" and "valves" settings
# Check if user has "functions" and "valves" settings
if
"functions"
not
in
user_settings
:
if
"functions"
not
in
user_settings
:
...
...
backend/apps/webui/models/tools.py
View file @
9a6cbafd
...
@@ -141,7 +141,7 @@ class ToolsTable:
...
@@ -141,7 +141,7 @@ class ToolsTable:
)
->
Optional
[
dict
]:
)
->
Optional
[
dict
]:
try
:
try
:
user
=
Users
.
get_user_by_id
(
user_id
)
user
=
Users
.
get_user_by_id
(
user_id
)
user_settings
=
user
.
settings
.
model_dump
()
user_settings
=
user
.
settings
.
model_dump
()
if
user
.
settings
else
{}
# Check if user has "tools" and "valves" settings
# Check if user has "tools" and "valves" settings
if
"tools"
not
in
user_settings
:
if
"tools"
not
in
user_settings
:
...
@@ -159,7 +159,7 @@ class ToolsTable:
...
@@ -159,7 +159,7 @@ class ToolsTable:
)
->
Optional
[
dict
]:
)
->
Optional
[
dict
]:
try
:
try
:
user
=
Users
.
get_user_by_id
(
user_id
)
user
=
Users
.
get_user_by_id
(
user_id
)
user_settings
=
user
.
settings
.
model_dump
()
user_settings
=
user
.
settings
.
model_dump
()
if
user
.
settings
else
{}
# Check if user has "tools" and "valves" settings
# Check if user has "tools" and "valves" settings
if
"tools"
not
in
user_settings
:
if
"tools"
not
in
user_settings
:
...
...
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