|
|
@@ -609,7 +609,7 @@ export function ChatActions(props: {
|
|
|
}
|
|
|
}, [chatStore, currentModel, models]);
|
|
|
|
|
|
- const fetchGuessList = async (record: ChatMessage) => {
|
|
|
+ const fetchGuessList = async (record: { content: string; role: string }) => {
|
|
|
try {
|
|
|
const data = {
|
|
|
appId: session.appId,
|
|
|
@@ -629,13 +629,10 @@ export function ChatActions(props: {
|
|
|
|
|
|
useEffect(() => {
|
|
|
setGuessList([]);
|
|
|
- const messages = session.messages.slice();
|
|
|
- const backList = messages.reverse();
|
|
|
- const item = backList.find(item => item.content && item.role === 'assistant')
|
|
|
- if (item) {
|
|
|
- fetchGuessList(item)
|
|
|
+ if (chatStore.message.content) {
|
|
|
+ fetchGuessList(chatStore.message);
|
|
|
}
|
|
|
- }, [session.messages.length]);
|
|
|
+ }, [chatStore.message]);
|
|
|
|
|
|
return (
|
|
|
<div className={styles["chat-input-actions"]}>
|