update pay function

This commit is contained in:
2025-11-28 14:00:36 +08:00
parent c1937b9e31
commit 56a7ca7eb3
2 changed files with 8 additions and 1 deletions

View File

@@ -43,6 +43,10 @@ export interface UseAgentChatParams {
toast: ToastFunction; toast: ToastFunction;
/** 重新加载会话列表(发送消息成功后调用) */ /** 重新加载会话列表(发送消息成功后调用) */
loadSessions: () => Promise<void>; loadSessions: () => Promise<void>;
/** 消息列表(从外部传入) */
messages: Message[];
/** 设置消息列表(从外部传入) */
setMessages: Dispatch<SetStateAction<Message[]>>;
} }
/** /**
@@ -107,8 +111,9 @@ export const useAgentChat = ({
clearFiles, clearFiles,
toast, toast,
loadSessions, loadSessions,
messages,
setMessages,
}: UseAgentChatParams): UseAgentChatReturn => { }: UseAgentChatParams): UseAgentChatReturn => {
const [messages, setMessages] = useState<Message[]>([]);
const [inputValue, setInputValue] = useState(''); const [inputValue, setInputValue] = useState('');
const [isProcessing, setIsProcessing] = useState(false); const [isProcessing, setIsProcessing] = useState(false);

View File

@@ -79,6 +79,8 @@ const AgentChat = () => {
clearFiles, clearFiles,
toast, toast,
loadSessions, loadSessions,
messages,
setMessages,
}); });
// ==================== 输入框引用(保留在主组件)==================== // ==================== 输入框引用(保留在主组件)====================