Skip to content

Commit

Permalink
Update chat.py
Browse files Browse the repository at this point in the history
  • Loading branch information
spammenotinoz authored Nov 9, 2023
1 parent 7162b8a commit a67f736
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions backend/api/routers/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,15 @@ async def check_limits(user: UserReadAdmin, ask_request: AskRequest):

# 判断是否允许使用附件
if ask_request.openai_web_attachments and len(ask_request.openai_web_attachments) > 0:
if (ask_request.model == OpenaiWebChatModels.gpt_4 or \
ask_request.model == OpenaiWebChatModels.gpt_4_code_interpreter) and \
config.openai_web.enable_uploading_attachments is True:
# Allow attachments
else:
raise WebsocketInvalidAskException("errors.attachmentsNotAllowed")
if (ask_request.model == OpenaiWebChatModels.gpt_4 or \
ask_request.model == OpenaiWebChatModels.gpt_4_code_interpreter) and \
config.openai_web.enable_uploading_attachments is True:
# Allow attachments
else:
raise WebsocketInvalidAskException("errors.attachmentsNotAllowed")

if plugin_id in _plugins_manifests_map:
return _plugins_manifests_map[plugin_id]

def check_message(msg: str):
# 检查消息中的敏感信息
Expand Down

0 comments on commit a67f736

Please sign in to comment.