mirror of
https://github.com/open-webui/open-webui
synced 2025-01-01 08:42:14 +00:00
refac
This commit is contained in:
parent
f9a05dd1e1
commit
6efca03a8f
@ -230,6 +230,7 @@ async def generate_function_chat_completion(
|
|||||||
"role": user.role,
|
"role": user.role,
|
||||||
},
|
},
|
||||||
"__metadata__": metadata,
|
"__metadata__": metadata,
|
||||||
|
"__request__": request,
|
||||||
}
|
}
|
||||||
extra_params["__tools__"] = get_tools(
|
extra_params["__tools__"] = get_tools(
|
||||||
request,
|
request,
|
||||||
|
@ -173,6 +173,11 @@ async def user_count(sid):
|
|||||||
await sio.emit("user-count", {"count": len(USER_POOL.items())})
|
await sio.emit("user-count", {"count": len(USER_POOL.items())})
|
||||||
|
|
||||||
|
|
||||||
|
@sio.on("chat")
|
||||||
|
async def chat(sid, data):
|
||||||
|
print("chat", sid, SESSION_POOL[sid], data)
|
||||||
|
|
||||||
|
|
||||||
@sio.event
|
@sio.event
|
||||||
async def disconnect(sid):
|
async def disconnect(sid):
|
||||||
if sid in SESSION_POOL:
|
if sid in SESSION_POOL:
|
||||||
|
@ -237,6 +237,7 @@ async def chat_completed(request: Request, form_data: dict, user: Any):
|
|||||||
"__id__": filter_id,
|
"__id__": filter_id,
|
||||||
"__event_emitter__": __event_emitter__,
|
"__event_emitter__": __event_emitter__,
|
||||||
"__event_call__": __event_call__,
|
"__event_call__": __event_call__,
|
||||||
|
"__request__": request,
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add extra params in contained in function signature
|
# Add extra params in contained in function signature
|
||||||
@ -334,6 +335,7 @@ async def chat_action(request: Request, action_id: str, form_data: dict, user: A
|
|||||||
"__id__": sub_action_id if sub_action_id is not None else action_id,
|
"__id__": sub_action_id if sub_action_id is not None else action_id,
|
||||||
"__event_emitter__": __event_emitter__,
|
"__event_emitter__": __event_emitter__,
|
||||||
"__event_call__": __event_call__,
|
"__event_call__": __event_call__,
|
||||||
|
"__request__": request,
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add extra params in contained in function signature
|
# Add extra params in contained in function signature
|
||||||
|
@ -382,6 +382,7 @@ async def process_chat_payload(request, form_data, user, model):
|
|||||||
"role": user.role,
|
"role": user.role,
|
||||||
},
|
},
|
||||||
"__metadata__": metadata,
|
"__metadata__": metadata,
|
||||||
|
"__request__": request,
|
||||||
}
|
}
|
||||||
|
|
||||||
# Initialize events to store additional event to be sent to the client
|
# Initialize events to store additional event to be sent to the client
|
||||||
|
Loading…
Reference in New Issue
Block a user