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
e4af3852
Commit
e4af3852
authored
Jun 22, 2024
by
Timothy J. Baek
Browse files
refac: allow class in tools
parent
0ac8e974
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
backend/utils/tools.py
backend/utils/tools.py
+3
-1
No files found.
backend/utils/tools.py
View file @
e4af3852
...
@@ -20,7 +20,9 @@ def get_tools_specs(tools) -> List[dict]:
...
@@ -20,7 +20,9 @@ def get_tools_specs(tools) -> List[dict]:
function_list
=
[
function_list
=
[
{
"name"
:
func
,
"function"
:
getattr
(
tools
,
func
)}
{
"name"
:
func
,
"function"
:
getattr
(
tools
,
func
)}
for
func
in
dir
(
tools
)
for
func
in
dir
(
tools
)
if
callable
(
getattr
(
tools
,
func
))
and
not
func
.
startswith
(
"__"
)
if
callable
(
getattr
(
tools
,
func
))
and
not
func
.
startswith
(
"__"
)
and
not
inspect
.
isclass
(
getattr
(
tools
,
func
))
]
]
specs
=
[]
specs
=
[]
...
...
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