Skip to content

Commit

Permalink
优化请求
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanyutin753 authored Feb 26, 2024
1 parent d0cc050 commit 7ce92ae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2279,6 +2279,8 @@ def chat_completions():
accessible_model_list = get_accessible_model_list()
if model not in accessible_model_list and not 'gpt-4-gizmo-' in model:
return jsonify({"error": "model is not accessible"}), 401
elif 'gpt-4-gizmo-' in model and not KEY_FOR_GPTS_INFO:
return jsonify({"error": "key_for_gpts_info is not accessible"}), 400

stream = data.get('stream', False)

Expand Down Expand Up @@ -2441,6 +2443,8 @@ def images_generations():
accessible_model_list = get_accessible_model_list()
if model not in accessible_model_list and not 'gpt-4-gizmo-' in model:
return jsonify({"error": "model is not accessible"}), 401
elif 'gpt-4-gizmo-' in model and not KEY_FOR_GPTS_INFO:
return jsonify({"error": "key_for_gpts_info is not accessible"}), 400

prompt = data.get('prompt', '')

Expand Down

0 comments on commit 7ce92ae

Please sign in to comment.