fix: 对话格式兼容改造
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { ChatMessageVo, GetChatListParams, SendDTO } from './types';
|
||||
import { get, post } from '@/utils/request';
|
||||
|
||||
// 发送消息
|
||||
// 发送消息(旧接口)
|
||||
export function send(data: SendDTO) {
|
||||
const url = data.sessionId !== 'not_login'
|
||||
? `/ai-chat/send/?sessionId=${data.sessionId}`
|
||||
@@ -9,6 +9,12 @@ export function send(data: SendDTO) {
|
||||
return post(url, data);
|
||||
}
|
||||
|
||||
// 统一发送消息接口,支持4种API类型
|
||||
export function unifiedSend(data: any, apiType: string, modelId: string, sessionId: string) {
|
||||
const url = `/ai-chat/unified/send?apiType=${apiType}&modelId=${modelId}&sessionId=${sessionId}`;
|
||||
return post(url, data);
|
||||
}
|
||||
|
||||
// 新增对应会话聊天记录
|
||||
export function addChat(data: ChatMessageVo) {
|
||||
return post('/system/message', data).json();
|
||||
|
||||
@@ -14,6 +14,7 @@ export interface GetSessionListVO {
|
||||
modelId?: string;
|
||||
isFree?: boolean; // 是否为免费模型
|
||||
isPremiumPackage?: boolean; // 是否为尊享套餐模型
|
||||
modelApiType?: string; // API 格式类型: Completions | Messages | Responses | GenerateContent
|
||||
}
|
||||
|
||||
// 模型类型枚举
|
||||
|
||||
Reference in New Issue
Block a user