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
8f23df57
Commit
8f23df57
authored
Jul 09, 2024
by
Michael Poluektov
Browse files
fix: outlet __event_emitter__
parent
144581a7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
backend/main.py
backend/main.py
+5
-5
No files found.
backend/main.py
View file @
8f23df57
...
@@ -226,7 +226,7 @@ async def get_body_and_model_and_user(request):
...
@@ -226,7 +226,7 @@ async def get_body_and_model_and_user(request):
model_id
=
body
[
"model"
]
model_id
=
body
[
"model"
]
if
model_id
not
in
app
.
state
.
MODELS
:
if
model_id
not
in
app
.
state
.
MODELS
:
raise
"Model not found"
raise
Exception
(
"Model not found"
)
model
=
app
.
state
.
MODELS
[
model_id
]
model
=
app
.
state
.
MODELS
[
model_id
]
user
=
get_current_user
(
user
=
get_current_user
(
...
@@ -1107,21 +1107,21 @@ async def chat_completed(form_data: dict, user=Depends(get_verified_user)):
...
@@ -1107,21 +1107,21 @@ async def chat_completed(form_data: dict, user=Depends(get_verified_user)):
else
:
else
:
pass
pass
async
def
__event_emitter__
(
data
):
async
def
__event_emitter__
(
event_
data
):
await
sio
.
emit
(
await
sio
.
emit
(
"chat-events"
,
"chat-events"
,
{
{
"chat_id"
:
data
[
"chat_id"
],
"chat_id"
:
data
[
"chat_id"
],
"message_id"
:
data
[
"id"
],
"message_id"
:
data
[
"id"
],
"data"
:
data
,
"data"
:
event_
data
,
},
},
to
=
data
[
"session_id"
],
to
=
data
[
"session_id"
],
)
)
async
def
__event_call__
(
data
):
async
def
__event_call__
(
event_
data
):
response
=
await
sio
.
call
(
response
=
await
sio
.
call
(
"chat-events"
,
"chat-events"
,
{
"chat_id"
:
data
[
"chat_id"
],
"message_id"
:
data
[
"id"
],
"data"
:
data
},
{
"chat_id"
:
data
[
"chat_id"
],
"message_id"
:
data
[
"id"
],
"data"
:
event_
data
},
to
=
data
[
"session_id"
],
to
=
data
[
"session_id"
],
)
)
return
response
return
response
...
...
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