MCPcopy Create free account
hub / github.com/NatsUIJM/autoContents / generate

Function generate

app.py:291–306  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

289 if len(configs) <= 1:
290 return jsonify({'status': 'error', 'message': '至少需要保留一个配置'}), 400
291
292 new_configs = [c for c in configs if c.get('id') != config_id]
293 if len(new_configs) == len(configs):
294 return jsonify({'status': 'error', 'message': f'配置 {config_id} 不存在'}), 404
295
296 data['configs'] = new_configs
297 if data.get('active_id') == config_id:
298 data['active_id'] = new_configs[0]['id']
299
300 save_config_file(data)
301 return jsonify({'status': 'success', 'message': '配置已删除', 'active_id': data['active_id']})
302 except Exception as e:
303 logger.error(f"删除 LLM 配置失败:{str(e)}")
304 return jsonify({'status': 'error', 'message': f'删除配置失败:{str(e)}'}), 500
305
306@app.route('/set_active_config/<config_id>', methods=['POST'])
307def set_active_config(config_id):
308 try:
309 data = load_config_file()

Callers 1

stream_logFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected