// 小艺意图框架 · 执行型意图:取消午餐(路由即槽位) import { insightIntent, InsightIntentEntry, InsightIntentEntryExecutor } from '@kit.AbilityKit'; import { cancelMealByIntent } from '../utils/A2AServer'; import { hilog } from '@kit.PerformanceAnalysisKit'; const INTENT_DOMAIN = 0x0000; async function runCancel(): Promise> { hilog.info(INTENT_DOMAIN, 'OrderMealIntent', 'CancelLunch execute'); const reply = await cancelMealByIntent('lunch', false); hilog.info(INTENT_DOMAIN, 'OrderMealIntent', 'CancelLunch reply=%{public}s', reply); return { code: 0, result: reply }; } @InsightIntentEntry({ intentName: 'CancelLunch', domain: 'ElderlyCare', intentVersion: '1.0.0', displayName: '取消午餐', displayDescription: '取消老人已预订的午餐', keywords: ['取消午餐', '取消午饭', '不吃午饭', '退订午餐'], llmDescription: '取消老人已预订的午餐。当用户表达"取消午餐""中午不吃了"等意图时调用。执行后返回取消结果说明文本。', parameters: { type: 'object', properties: {} }, result: { type: 'string', description: '取消结果说明文本' }, abilityName: 'EntryAbility', executeMode: [insightIntent.ExecuteMode.UI_ABILITY_BACKGROUND], }) export default class CancelLunchIntent extends InsightIntentEntryExecutor { executeMode: insightIntent.ExecuteMode = insightIntent.ExecuteMode.UI_ABILITY_BACKGROUND; async onExecute(): Promise> { return runCancel(); } }