mirror of
https://github.com/open-webui/open-webui
synced 2025-02-23 13:51:07 +00:00
fix: user direct connections
This commit is contained in:
parent
deeb04e695
commit
f20b7c2f33
@ -187,6 +187,11 @@ async def generate_chat_completion(
|
|||||||
|
|
||||||
model = models[model_id]
|
model = models[model_id]
|
||||||
|
|
||||||
|
if getattr(request.state, "direct", False):
|
||||||
|
return await generate_direct_chat_completion(
|
||||||
|
request, form_data, user=user, models=models
|
||||||
|
)
|
||||||
|
else:
|
||||||
# Check if user has access to the model
|
# Check if user has access to the model
|
||||||
if not bypass_filter and user.role == "user":
|
if not bypass_filter and user.role == "user":
|
||||||
try:
|
try:
|
||||||
@ -194,12 +199,6 @@ async def generate_chat_completion(
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
if getattr(request.state, "direct", False):
|
|
||||||
return await generate_direct_chat_completion(
|
|
||||||
request, form_data, user=user, models=models
|
|
||||||
)
|
|
||||||
|
|
||||||
else:
|
|
||||||
if model["owned_by"] == "arena":
|
if model["owned_by"] == "arena":
|
||||||
model_ids = model.get("info", {}).get("meta", {}).get("model_ids")
|
model_ids = model.get("info", {}).get("meta", {}).get("model_ids")
|
||||||
filter_mode = model.get("info", {}).get("meta", {}).get("filter_mode")
|
filter_mode = model.get("info", {}).get("meta", {}).get("filter_mode")
|
||||||
|
Loading…
Reference in New Issue
Block a user