Add smart ACK provider for WeChat MP replies
Replace fixed ackText with a rule-based AckProvider that picks response templates by message type and intent (translate, summary, rewrite, poster, ppt, mindmap, code, search, schedule). Pure sync, zero I/O, auto-falls back to config.ackText on any error. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { createContext, useContext, type ReactNode } from 'react';
|
||||
import { RechargeModal } from '../components/RechargeModal';
|
||||
import { SubscribeModal } from '../components/SubscribeModal';
|
||||
import { useTKMindChat } from '../hooks/useTKMindChat';
|
||||
import type { CapabilityMap, PortalUser } from '../types';
|
||||
|
||||
@@ -36,6 +37,17 @@ export function ChatProvider({
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<SubscribeModal
|
||||
open={chat.subscribePrompt}
|
||||
onClose={chat.dismissSubscribe}
|
||||
onSuccess={(subscription, balanceCents) => {
|
||||
chat.completeSubscribe(balanceCents, subscription);
|
||||
}}
|
||||
onRechargeNeeded={() => {
|
||||
chat.dismissSubscribe();
|
||||
chat.openRecharge(false);
|
||||
}}
|
||||
/>
|
||||
</ChatContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user