feat: 新增枚举定义
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import type { ModelType } from '@/constants/enums';
|
||||
|
||||
/**
|
||||
* ChatRequest,描述:对话请求对象
|
||||
*/
|
||||
@@ -19,7 +21,7 @@ export interface SendDTO {
|
||||
*/
|
||||
kid?: string;
|
||||
messages: Message[];
|
||||
model: string;
|
||||
model: ModelType;
|
||||
/**
|
||||
* 提示词
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import type { EnumValue } from '@jsonlee_12138/enum';
|
||||
import Enum from '@jsonlee_12138/enum';
|
||||
|
||||
export const ModelEnum = Enum.create({
|
||||
GPT_4o_MINI: Enum.Item('gpt-4o-mini'),
|
||||
});
|
||||
export type ModelType = EnumValue<typeof ModelEnum>;
|
||||
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { createSession } from '@/api';
|
||||
import { send } from '@/api/chat';
|
||||
import { ModelEnum } from '@/constants/enums';
|
||||
import { useUserStore } from '@/store';
|
||||
import { useChatStore } from '@/store/modules/chat';
|
||||
import { BubbleList, Sender } from 'vue-element-plus-x';
|
||||
@@ -61,7 +62,7 @@ async function handleSend() {
|
||||
loading.value = true;
|
||||
const req = send({
|
||||
sessionId: chatId.value,
|
||||
model: 'gpt-4o-mini',
|
||||
model: ModelEnum.GPT_4o_MINI.value,
|
||||
messages: [
|
||||
{
|
||||
role: 'user',
|
||||
|
||||
Reference in New Issue
Block a user