c
This commit is contained in:
parent
a7b6aeeb31
commit
384e607fe1
@ -23,26 +23,26 @@ export default function AskHello({ setUserMessages, setConversationId, setIsHell
|
||||
try {
|
||||
// UI
|
||||
setIsHello(false);
|
||||
setUserMessages([
|
||||
{
|
||||
id: Math.random().toString(36).substring(2, 9),
|
||||
content: text,
|
||||
role: 'user',
|
||||
timestamp: new Date().toISOString()
|
||||
},
|
||||
{
|
||||
id: Math.random().toString(36).substring(2, 9),
|
||||
content: "keepSearchIng",
|
||||
role: 'assistant',
|
||||
timestamp: new Date().toISOString()
|
||||
}
|
||||
]);
|
||||
// setUserMessages([
|
||||
// {
|
||||
// id: Math.random().toString(36).substring(2, 9),
|
||||
// content: text,
|
||||
// role: 'user',
|
||||
// timestamp: new Date().toISOString()
|
||||
// },
|
||||
// {
|
||||
// id: Math.random().toString(36).substring(2, 9),
|
||||
// content: "keepSearchIng",
|
||||
// role: 'assistant',
|
||||
// timestamp: new Date().toISOString()
|
||||
// }
|
||||
// ]);
|
||||
|
||||
const sessionId = await createNewConversation(text);
|
||||
if (!sessionId) {
|
||||
console.error("Failed to create a new conversation.");
|
||||
//
|
||||
setUserMessages(prev => prev.filter(item => item.content !== 'keepSearchIng'));
|
||||
// setUserMessages(prev => prev.filter(item => item.content !== 'keepSearchIng'));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -65,7 +65,7 @@ export default function AskHello({ setUserMessages, setConversationId, setIsHell
|
||||
} catch (err) {
|
||||
console.error('handleCase failed:', err);
|
||||
//
|
||||
setUserMessages(prev => prev.filter(item => item.content !== 'keepSearchIng'));
|
||||
// setUserMessages(prev => prev.filter(item => item.content !== 'keepSearchIng'));
|
||||
} finally {
|
||||
inFlightRef.current = false;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user