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
0a08a4d2
Commit
0a08a4d2
authored
Jul 08, 2024
by
Timothy J. Baek
Browse files
refac
parent
1b7ff1c5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
backend/main.py
backend/main.py
+14
-0
No files found.
backend/main.py
View file @
0a08a4d2
...
@@ -1188,6 +1188,14 @@ async def chat_completed(form_data: dict, user=Depends(get_verified_user)):
...
@@ -1188,6 +1188,14 @@ async def chat_completed(form_data: dict, user=Depends(get_verified_user)):
to
=
data
[
"session_id"
],
to
=
data
[
"session_id"
],
)
)
async
def
__event_call__
(
data
):
response
=
await
sio
.
call
(
"chat-events"
,
{
"chat_id"
:
data
[
"chat_id"
],
"message_id"
:
data
[
"id"
],
"data"
:
data
},
to
=
data
[
"session_id"
],
)
return
response
def
get_priority
(
function_id
):
def
get_priority
(
function_id
):
function
=
Functions
.
get_function_by_id
(
function_id
)
function
=
Functions
.
get_function_by_id
(
function_id
)
if
function
is
not
None
and
hasattr
(
function
,
"valves"
):
if
function
is
not
None
and
hasattr
(
function
,
"valves"
):
...
@@ -1275,6 +1283,12 @@ async def chat_completed(form_data: dict, user=Depends(get_verified_user)):
...
@@ -1275,6 +1283,12 @@ async def chat_completed(form_data: dict, user=Depends(get_verified_user)):
"__event_emitter__"
:
__event_emitter__
,
"__event_emitter__"
:
__event_emitter__
,
}
}
if
"__event_call__"
in
sig
.
parameters
:
params
=
{
**
params
,
"__event_call__"
:
__event_call__
,
}
if
inspect
.
iscoroutinefunction
(
outlet
):
if
inspect
.
iscoroutinefunction
(
outlet
):
data
=
await
outlet
(
**
params
)
data
=
await
outlet
(
**
params
)
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