You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
622 B
28 lines
622 B
import 'dart:convert';
|
|
|
|
import 'package:deep_voice/data/models/appconfig_model.dart';
|
|
|
|
class AppConfig {
|
|
static late UserGetAppConfigResp config;
|
|
|
|
// 可选:提供初始化方法
|
|
static void initialize(UserGetAppConfigResp resp) {
|
|
config = resp;
|
|
}
|
|
|
|
//环境变量
|
|
static String? env(String key) {
|
|
return config.env[key];
|
|
}
|
|
|
|
//mcp配置
|
|
static dynamic mcpConfig() {
|
|
return {"mcpServers": config.mcps};
|
|
}
|
|
|
|
//智能体配置
|
|
static String agent(String agentId) {
|
|
final foundAgent = config.agents.firstWhere((agent) => agent.id == agentId);
|
|
return jsonEncode((foundAgent));
|
|
}
|
|
}
|
|
|