fix: 对话参数修改
This commit is contained in:
@@ -2,7 +2,7 @@ import type { ChatMessageVo, GetChatListParams, SendDTO } from './types';
|
||||
import { get, post } from '@/utils/request';
|
||||
|
||||
// 发送消息
|
||||
export const send = (data: SendDTO) => post<null>('/ai-chat/send', data);
|
||||
export const send = (data: SendDTO) => post<null>(`/ai-chat/send/${data.sessionId}`, data);
|
||||
|
||||
// 新增对应会话聊天记录
|
||||
export function addChat(data: ChatMessageVo) {
|
||||
|
||||
@@ -49,6 +49,7 @@ export interface SendDTO {
|
||||
* 是否携带上下文
|
||||
*/
|
||||
usingContext?: boolean;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -188,14 +188,10 @@ async function startSSE(chatContent: string) {
|
||||
? `${item.content.substring(0, 2000)}...(内容过长,已省略)`
|
||||
: item.content,
|
||||
})),
|
||||
// sessionId: route.params?.id !== 'not_login' ? String(route.params?.id) : undefined,
|
||||
// userId: userStore.userInfo?.userId,
|
||||
// model: modelStore.currentModelInfo.modelId ?? '',
|
||||
|
||||
sessionId: route.query?.sessionId !== 'not_login' ? String(route.query?.sessionId) : undefined, // 修改点:sessionId 从 query 参数中获取
|
||||
sessionId: route.params?.id !== 'not_login' ? String(route.params?.id) : undefined,
|
||||
stream: true,
|
||||
userId: userStore.userInfo?.userId,
|
||||
model: modelStore.currentModelInfo.modelId ?? '', // 修改点:modelId 改为 model
|
||||
|
||||
model: modelStore.currentModelInfo.modelId ?? '',
|
||||
})) {
|
||||
handleDataChunk(chunk.result as AnyObject);
|
||||
}
|
||||
|
||||
1
Yi.Ai.Vue3/types/import_meta.d.ts
vendored
1
Yi.Ai.Vue3/types/import_meta.d.ts
vendored
@@ -6,6 +6,7 @@ interface ImportMetaEnv {
|
||||
readonly VITE_WEB_ENV: string;
|
||||
readonly VITE_WEB_BASE_API: string;
|
||||
readonly VITE_API_URL: string;
|
||||
readonly VITE_BUILD_COMPRESS: string;
|
||||
readonly VITE_SSO_SEVER_URL: string;
|
||||
readonly VITE_APP_VERSION: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user