perf: response store
This commit is contained in:
@@ -60,7 +60,7 @@ const Chat = ({ appId, chatId }: { appId: string; chatId: string }) => {
|
||||
const prompts = messages.slice(-2);
|
||||
const completionChatId = chatId ? chatId : nanoid();
|
||||
|
||||
const { responseText } = await streamFetch({
|
||||
const { responseText, responseData } = await streamFetch({
|
||||
data: {
|
||||
messages: prompts,
|
||||
variables,
|
||||
@@ -106,7 +106,7 @@ const Chat = ({ appId, chatId }: { appId: string; chatId: string }) => {
|
||||
history: ChatBoxRef.current?.getChatHistory() || state.history
|
||||
}));
|
||||
|
||||
return { responseText };
|
||||
return { responseText, responseData };
|
||||
},
|
||||
[appId, chatId, history, router, setChatData, updateHistory]
|
||||
);
|
||||
|
||||
@@ -46,7 +46,7 @@ const ShareChat = ({ shareId, chatId }: { shareId: string; chatId: string }) =>
|
||||
const prompts = messages.slice(-2);
|
||||
const completionChatId = chatId ? chatId : nanoid();
|
||||
|
||||
const { responseText } = await streamFetch({
|
||||
const { responseText, responseData } = await streamFetch({
|
||||
data: {
|
||||
messages: prompts,
|
||||
variables,
|
||||
@@ -91,7 +91,7 @@ const ShareChat = ({ shareId, chatId }: { shareId: string; chatId: string }) =>
|
||||
'*'
|
||||
);
|
||||
|
||||
return { responseText };
|
||||
return { responseText, responseData };
|
||||
},
|
||||
[chatId, router, saveChatResponse, shareId]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user