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.
33 lines
788 B
33 lines
788 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? agentsystemPrompt(String agentId) {
|
|
final foundAgent = config.agents.firstWhere((agent) => agent.id == agentId);
|
|
return foundAgent.systemPrompt;
|
|
}
|
|
|
|
static List<String> allproductNames() {
|
|
List<String> names =
|
|
config.products.map((user) => user.devicename).toList();
|
|
return names;
|
|
}
|
|
}
|
|
|