Commit f4a3ad11 by Sixong.Zhu

im

parent 46a73ad5
Showing with 6 additions and 5 deletions
...@@ -13,12 +13,13 @@ export async function getChatModelInfo( ...@@ -13,12 +13,13 @@ export async function getChatModelInfo(
id: string | number, id: string | number,
detailname?: string detailname?: string
) { ) {
if (chatInfo[id]) { const key = `${modelName}-${id}`
if (chatInfo[key]) {
return Promise.resolve({ return Promise.resolve({
uniplatId: chatInfo[id].row.UniplatChatId.value, uniplatId: chatInfo[key].row.UniplatChatId.value,
chat_id: +chatInfo[id].row.UniplatImChatId.value, chat_id: +chatInfo[key].row.UniplatImChatId.value,
uniplat_version: 0, uniplat_version: 0,
data: chatInfo[id], data: chatInfo[key],
}); });
} }
const info = await Chat.getSdk() const info = await Chat.getSdk()
...@@ -26,7 +27,7 @@ export async function getChatModelInfo( ...@@ -26,7 +27,7 @@ export async function getChatModelInfo(
.detail(id + "", detailname) .detail(id + "", detailname)
.query(); .query();
const data = info; const data = info;
chatInfo[id] = data; chatInfo[key] = data;
return { return {
uniplatId: info.row.UniplatChatId.value, uniplatId: info.row.UniplatChatId.value,
chat_id: Number(info.row.UniplatImChatId.value), chat_id: Number(info.row.UniplatImChatId.value),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment