fix bugs related to system prompt and titles
This commit is contained in:
@@ -237,13 +237,20 @@ export class Search {
|
|||||||
const output: any[] = [];
|
const output: any[] = [];
|
||||||
for (const item of searchResults) {
|
for (const item of searchResults) {
|
||||||
const chatID = item.id;
|
const chatID = item.id;
|
||||||
const chat = this.chats.get(chatID);
|
let chat = this.chats.get(chatID);
|
||||||
if (!chat) {
|
if (!chat) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
chat = { ...chat };
|
||||||
|
|
||||||
let description = chat.messages?.first?.content || '';
|
let description = chat.messages?.first?.content || '';
|
||||||
description = ellipsize(description, 400);
|
description = ellipsize(description, 400);
|
||||||
|
|
||||||
|
if (!chat.title) {
|
||||||
|
chat.title = ellipsize(description, 100);
|
||||||
|
}
|
||||||
|
|
||||||
if (!chat.title || !description) {
|
if (!chat.title || !description) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@@ -81,7 +81,8 @@ export default function ChatPage(props: any) {
|
|||||||
if (id) {
|
if (id) {
|
||||||
saveParameters(id, parameters);
|
saveParameters(id, parameters);
|
||||||
}
|
}
|
||||||
}, [parameters]);
|
saveParameters('', parameters);
|
||||||
|
}, [id, parameters]);
|
||||||
|
|
||||||
const onNewMessage = useCallback(async (message?: string) => {
|
const onNewMessage = useCallback(async (message?: string) => {
|
||||||
if (props.share) {
|
if (props.share) {
|
||||||
|
Reference in New Issue
Block a user