feat: support assistant frontend (#2139)
Co-authored-by: StyleZhang <jasonapring2015@outlook.com>
This commit is contained in:
parent
e65a2a400d
commit
7bbe12b2bd
194 changed files with 8726 additions and 1586 deletions
|
|
@ -1,18 +1,19 @@
|
|||
import type { IOnCompleted, IOnData, IOnError, IOnMessageEnd, IOnMessageReplace } from './base'
|
||||
import { get, post, ssePost } from './base'
|
||||
import type { IOnCompleted, IOnData, IOnError, IOnFile, IOnMessageEnd, IOnMessageReplace, IOnThought } from './base'
|
||||
import type { ChatPromptConfig, CompletionPromptConfig } from '@/models/debug'
|
||||
import type { ModelModeType } from '@/types/app'
|
||||
import type { ModelParameterRule } from '@/app/components/header/account-setting/model-provider-page/declarations'
|
||||
|
||||
export type AutomaticRes = {
|
||||
prompt: string
|
||||
variables: string[]
|
||||
opening_statement: string
|
||||
}
|
||||
|
||||
export const sendChatMessage = async (appId: string, body: Record<string, any>, { onData, onCompleted, onError, getAbortController, onMessageEnd, onMessageReplace }: {
|
||||
export const sendChatMessage = async (appId: string, body: Record<string, any>, { onData, onCompleted, onThought, onFile, onError, getAbortController, onMessageEnd, onMessageReplace }: {
|
||||
onData: IOnData
|
||||
onCompleted: IOnCompleted
|
||||
onFile: IOnFile
|
||||
onThought: IOnThought
|
||||
onMessageEnd: IOnMessageEnd
|
||||
onMessageReplace: IOnMessageReplace
|
||||
onError: IOnError
|
||||
|
|
@ -23,7 +24,7 @@ export const sendChatMessage = async (appId: string, body: Record<string, any>,
|
|||
...body,
|
||||
response_mode: 'streaming',
|
||||
},
|
||||
}, { onData, onCompleted, onError, getAbortController, onMessageEnd, onMessageReplace })
|
||||
}, { onData, onCompleted, onThought, onFile, onError, getAbortController, onMessageEnd, onMessageReplace })
|
||||
}
|
||||
|
||||
export const stopChatMessageResponding = async (appId: string, taskId: string) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue