feat: add HoloLake personal channel module runtime
This commit is contained in:
parent
bb96d5eb89
commit
a106b23f9b
21 changed files with 786 additions and 31 deletions
|
|
@ -47,9 +47,10 @@ interface Props {
|
|||
apiBase: string;
|
||||
runtimeRevision?: number;
|
||||
onClose?: () => void;
|
||||
onWorldChanged?: () => void;
|
||||
}
|
||||
|
||||
export default function AgentChat({ apiBase, runtimeRevision = 0, onClose }: Props) {
|
||||
export default function AgentChat({ apiBase, runtimeRevision = 0, onClose, onWorldChanged }: Props) {
|
||||
const [messages, setMessages] = useState<Message[]>([]);
|
||||
const [conversations, setConversations] = useState<ConversationSummary[]>([]);
|
||||
const [activeConversationId, setActiveConversationId] = useState('');
|
||||
|
|
@ -172,6 +173,7 @@ export default function AgentChat({ apiBase, runtimeRevision = 0, onClose }: Pro
|
|||
setPendingActions(data.actions || []);
|
||||
setMessages(data.messages || messages);
|
||||
await refreshConversationList();
|
||||
if (decision === 'confirm') onWorldChanged?.();
|
||||
} catch (error) {
|
||||
setMessages(previous => [...previous, { role: 'assistant', content: `动作未执行:${error instanceof Error ? error.message : String(error)}`, timestamp: new Date().toISOString() }]);
|
||||
} finally {
|
||||
|
|
|
|||
Loading…
Reference in a new issue