【代码评审】写作:生成部分

This commit is contained in:
YunaiV
2024-07-10 12:49:54 +08:00
parent e53786e8bd
commit ece1533436
7 changed files with 47 additions and 45 deletions

View File

@ -2,9 +2,10 @@ import { fetchEventSource } from '@microsoft/fetch-event-source'
import { getAccessToken } from '@/utils/auth'
import { config } from '@/config/axios/config'
import { AiWriteTypeEnum } from '@/views/ai/utils/constants'
export interface WriteVO {
type: 1 | 2 // 1:撰写 2:回复
type: AiWriteTypeEnum.WRITING | AiWriteTypeEnum.REPLY // 1:撰写 2:回复
prompt: string // 写作内容提示 1。撰写 2回复
originalContent: string // 原文
length: number // 长度
@ -13,6 +14,7 @@ export interface WriteVO {
language: number // 语言
}
// TODO @hhero搞成 WriteApi类似 ConversationApi 一样。这样更有类的概念,后续引入某个 Api然后调用它的方法就可以了。
export const writeStream = ({
data,
onClose,