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
2be14d57
Commit
2be14d57
authored
Jun 11, 2024
by
Timothy J. Baek
Browse files
fix
parent
61e0a85a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
3 deletions
+5
-3
backend/apps/webui/models/tools.py
backend/apps/webui/models/tools.py
+2
-1
backend/apps/webui/routers/tools.py
backend/apps/webui/routers/tools.py
+2
-1
backend/utils/tools.py
backend/utils/tools.py
+1
-1
No files found.
backend/apps/webui/models/tools.py
View file @
2be14d57
...
@@ -92,7 +92,8 @@ class ToolsTable:
...
@@ -92,7 +92,8 @@ class ToolsTable:
return
tool
return
tool
else
:
else
:
return
None
return
None
except
:
except
Exception
as
e
:
print
(
f
"Error creating tool:
{
e
}
"
)
return
None
return
None
def
get_tool_by_id
(
self
,
id
:
str
)
->
Optional
[
ToolModel
]:
def
get_tool_by_id
(
self
,
id
:
str
)
->
Optional
[
ToolModel
]:
...
...
backend/apps/webui/routers/tools.py
View file @
2be14d57
...
@@ -84,9 +84,10 @@ async def create_new_toolkit(
...
@@ -84,9 +84,10 @@ async def create_new_toolkit(
else
:
else
:
raise
HTTPException
(
raise
HTTPException
(
status_code
=
status
.
HTTP_400_BAD_REQUEST
,
status_code
=
status
.
HTTP_400_BAD_REQUEST
,
detail
=
ERROR_MESSAGES
.
FILE_EXISTS
,
detail
=
ERROR_MESSAGES
.
DEFAULT
(
"Error creating toolkit"
)
,
)
)
except
Exception
as
e
:
except
Exception
as
e
:
print
(
e
)
raise
HTTPException
(
raise
HTTPException
(
status_code
=
status
.
HTTP_400_BAD_REQUEST
,
status_code
=
status
.
HTTP_400_BAD_REQUEST
,
detail
=
ERROR_MESSAGES
.
DEFAULT
(
e
),
detail
=
ERROR_MESSAGES
.
DEFAULT
(
e
),
...
...
backend/utils/tools.py
View file @
2be14d57
...
@@ -42,7 +42,7 @@ def get_tools_specs(tools) -> List[dict]:
...
@@ -42,7 +42,7 @@ def get_tools_specs(tools) -> List[dict]:
**
(
**
(
{
{
"enum"
:
(
"enum"
:
(
param_annotation
.
__args__
str
(
param_annotation
.
__args__
)
if
hasattr
(
param_annotation
,
"__args__"
)
if
hasattr
(
param_annotation
,
"__args__"
)
else
None
else
None
)
)
...
...
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