test(api): ✅ 测试接口,梳理逻辑
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
import type { ChatMessageVo, GetChatListParams, SendDTO } from './types';
|
||||
import { get, post } from '@/utils/request';
|
||||
|
||||
// 发送消息
|
||||
export const send = (data: SendDTO) => post<null>('/chat/send', data).stream();
|
||||
|
||||
// 新增对应会话聊天记录
|
||||
export function addChat(data: ChatMessageVo) {
|
||||
return post('/system/message', data);
|
||||
}
|
||||
|
||||
// 获取当前会话的聊天记录
|
||||
export function getChatList(params: GetChatListParams) {
|
||||
return get<ChatMessageVo[]>('/system/message/list', params);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import type { ModelType } from '@/constants/enums';
|
||||
|
||||
/**
|
||||
* ChatRequest,描述:对话请求对象
|
||||
*/
|
||||
@@ -21,7 +19,8 @@ export interface SendDTO {
|
||||
*/
|
||||
kid?: string;
|
||||
messages: Message[];
|
||||
model: ModelType;
|
||||
// model: ModelType;
|
||||
model?: string;
|
||||
/**
|
||||
* 提示词
|
||||
*/
|
||||
@@ -161,7 +160,7 @@ export interface GetChatListParams {
|
||||
/**
|
||||
* 会话id
|
||||
*/
|
||||
sessionId?: number;
|
||||
sessionId?: string;
|
||||
/**
|
||||
* 累计 Tokens
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user