This commit is contained in:
hajimi
2026-06-11 16:22:12 +08:00
parent 96efa1d905
commit 21aa11bf17
368 changed files with 2741 additions and 554 deletions
+17
View File
@@ -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>
}