36 lines
946 B
Dart
36 lines
946 B
Dart
const Map<String, String> _toolNameZhMap = {
|
|
'calendar.read': '读取日程',
|
|
'calendar.write': '写入日程',
|
|
'calendar.share': '共享日程',
|
|
'user.lookup': '查找联系人',
|
|
'memory.write': '写入记忆',
|
|
'memory.forget': '清理记忆',
|
|
};
|
|
|
|
const Map<String, String> _toolNameAliases = {
|
|
'calendar_read': 'calendar.read',
|
|
'calendar_write': 'calendar.write',
|
|
'calendar_share': 'calendar.share',
|
|
'user_lookup': 'user.lookup',
|
|
'memory_write': 'memory.write',
|
|
'memory_forget': 'memory.forget',
|
|
};
|
|
|
|
const List<String> automationToolOptions = [
|
|
'calendar.read',
|
|
'calendar.write',
|
|
'calendar.share',
|
|
'user.lookup',
|
|
'memory.write',
|
|
'memory.forget',
|
|
];
|
|
|
|
String localizeToolName(String rawName) {
|
|
final normalized = rawName.trim().toLowerCase();
|
|
if (normalized.isEmpty) {
|
|
return rawName;
|
|
}
|
|
final canonical = _toolNameAliases[normalized] ?? normalized;
|
|
return _toolNameZhMap[canonical] ?? rawName;
|
|
}
|