Complete type defined. (#1200)
This commit is contained in:
parent
1367f34398
commit
e65f9cb17a
4 changed files with 27 additions and 23 deletions
|
|
@ -1,6 +1,12 @@
|
|||
import type { IOnCompleted, IOnData, IOnError, IOnMessageEnd } from './base'
|
||||
import { get, post, ssePost } from './base'
|
||||
|
||||
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 }: {
|
||||
onData: IOnData
|
||||
onCompleted: IOnCompleted
|
||||
|
|
@ -46,7 +52,7 @@ export const fetchConvesationMessages = (appId: string, conversation_id: string)
|
|||
}
|
||||
|
||||
export const generateRule = (body: Record<string, any>) => {
|
||||
return post('/rule-generate', {
|
||||
return post<AutomaticRes>('/rule-generate', {
|
||||
body,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue