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
59fa2f8f
".github/vscode:/vscode.git/clone" did not exist on "827b1e58e96e76ef1d7d150e8a984178f2caf923"
Commit
59fa2f8f
authored
Jun 20, 2024
by
Timothy J. Baek
Browse files
refac: pipe function support
parent
d6e4aef6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
backend/apps/webui/main.py
backend/apps/webui/main.py
+4
-4
backend/main.py
backend/main.py
+6
-0
No files found.
backend/apps/webui/main.py
View file @
59fa2f8f
...
...
@@ -120,16 +120,16 @@ async def get_pipe_models():
manifold_pipes
=
[]
# Check if pipes is a function or a list
if
callable
(
pip
e
.
pipes
):
manifold_pipes
=
pip
e
.
pipes
()
if
callable
(
function_modul
e
.
pipes
):
manifold_pipes
=
function_modul
e
.
pipes
()
else
:
manifold_pipes
=
pip
e
.
pipes
manifold_pipes
=
function_modul
e
.
pipes
for
p
in
manifold_pipes
:
manifold_pipe_id
=
f
'
{
pipe
.
id
}
.
{
p
[
"id"
]
}
'
manifold_pipe_name
=
p
[
"name"
]
if
hasattr
(
pip
e
,
"name"
):
if
hasattr
(
function_modul
e
,
"name"
):
manifold_pipe_name
=
f
"
{
pipe
.
name
}{
manifold_pipe_name
}
"
pipe_models
.
append
(
...
...
backend/main.py
View file @
59fa2f8f
...
...
@@ -802,6 +802,12 @@ async def generate_chat_completions(form_data: dict, user=Depends(get_verified_u
pipe
=
model
.
get
(
"pipe"
)
if
pipe
:
form_data
[
"user"
]
=
{
"id"
:
user
.
id
,
"email"
:
user
.
email
,
"name"
:
user
.
name
,
"role"
:
user
.
role
,
}
def
job
():
pipe_id
=
form_data
[
"model"
]
...
...
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