feat: 添加自动化任务(automation_jobs)功能模块
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user