Spaces:
Paused
Paused
Upload 4 files
Browse files56 unmodified lines5758596061626352 unmodified lines116117118119120121122125 unmodified lines24824925025125225325456 unmodified lineskey_manager = APIKeyManager()current_api_key = key_manager.get_available_key()logger.info(f"Current API key: {current_api_key}")GEMINI_MODELS = [{"id": "gemini-pro"},52 unmodified linesglobal current_api_keyis_authenticated, auth_error, status_code = func.authenticate_request(request)if not is_authenticated:return auth_error if auth_error else jsonify({'error': 'Unauthorized'}), status_code if status_code else 401try:request_data = request.get_json()messages = request_data.get('messages', [])125 unmodified linesdef list_models():is_authenticated, auth_error, status_code = func.authenticate_request(request)if not is_authenticated:return auth_error if auth_error else jsonify({'error': 'Unauthorized'}), status_code if status_code else 401response = {"object": "list", "data": GEMINI_MODELS}return jsonify(response)56 unmodified lines5758596061626352 unmodified lines116117118119120121122125 unmodified lines24824925025125225325456 unmodified lineskey_manager = APIKeyManager()current_api_key = key_manager.get_available_key()logger.info(f"Current API key: {current_api_key[:11]}...")GEMINI_MODELS = [{"id": "gemini-pro"},52 unmodified linesglobal current_api_keyis_authenticated, auth_error, status_code = func.authenticate_request(request)if not is_authenticated:return auth_error if auth_error else jsonify({'error': '未授权'}), status_code if status_code else 401try:request_data = request.get_json()messages = request_data.get('messages', [])125 unmodified linesdef list_models():is_authenticated, auth_error, status_code = func.authenticate_request(request)if not is_authenticated:return auth_error if auth_error else jsonify({'error': '未授权'}), status_code if status_code else 401response = {"object": "list", "data": GEMINI_MODELS}return jsonify(response)
app.py+3-3