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
6f9a31eb
Commit
6f9a31eb
authored
Jun 18, 2024
by
Timothy J. Baek
Browse files
feat: tool cache dir
parent
eef125d0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
backend/apps/webui/routers/tools.py
backend/apps/webui/routers/tools.py
+5
-1
No files found.
backend/apps/webui/routers/tools.py
View file @
6f9a31eb
...
@@ -15,8 +15,9 @@ from constants import ERROR_MESSAGES
...
@@ -15,8 +15,9 @@ from constants import ERROR_MESSAGES
from
importlib
import
util
from
importlib
import
util
import
os
import
os
from
pathlib
import
Path
from
config
import
DATA_DIR
from
config
import
DATA_DIR
,
CACHE_DIR
TOOLS_DIR
=
f
"
{
DATA_DIR
}
/tools"
TOOLS_DIR
=
f
"
{
DATA_DIR
}
/tools"
...
@@ -79,6 +80,9 @@ async def create_new_toolkit(
...
@@ -79,6 +80,9 @@ async def create_new_toolkit(
specs
=
get_tools_specs
(
TOOLS
[
form_data
.
id
])
specs
=
get_tools_specs
(
TOOLS
[
form_data
.
id
])
toolkit
=
Tools
.
insert_new_tool
(
user
.
id
,
form_data
,
specs
)
toolkit
=
Tools
.
insert_new_tool
(
user
.
id
,
form_data
,
specs
)
tool_cache_dir
=
Path
(
CACHE_DIR
)
/
"tools"
/
form_data
.
id
tool_cache_dir
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
if
toolkit
:
if
toolkit
:
return
toolkit
return
toolkit
else
:
else
:
...
...
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