更新
This commit is contained in:
@@ -42,6 +42,11 @@ export interface PrivateChatMessage {
|
||||
create_time: string | number
|
||||
}
|
||||
|
||||
export interface PrivateChatVoiceToTextResult {
|
||||
text: string
|
||||
duration_ms: number
|
||||
}
|
||||
|
||||
export function getChatSessions(data?: { page_no?: number; page_size?: number }) {
|
||||
return request.get<{
|
||||
lists: PrivateChatSession[]
|
||||
@@ -76,3 +81,15 @@ export function sendChatMessage(data: {
|
||||
}) {
|
||||
return request.post<PrivateChatMessage>({ url: '/chat/send', data })
|
||||
}
|
||||
|
||||
export function voiceToText(filePath: string, token?: string) {
|
||||
return request.uploadFile({
|
||||
url: '/chat/voiceToText',
|
||||
filePath,
|
||||
name: 'file',
|
||||
header: {
|
||||
token
|
||||
},
|
||||
fileType: 'audio'
|
||||
}) as Promise<PrivateChatVoiceToTextResult>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user