mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-10 02:23:43 +08:00
fix: audio transcription only charge for the length of audio duration
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
package openai
|
||||
|
||||
import "github.com/songquanpeng/one-api/relay/model"
|
||||
import (
|
||||
"mime/multipart"
|
||||
|
||||
"github.com/songquanpeng/one-api/relay/model"
|
||||
)
|
||||
|
||||
type TextContent struct {
|
||||
Type string `json:"type,omitempty"`
|
||||
@@ -71,6 +75,24 @@ type TextToSpeechRequest struct {
|
||||
ResponseFormat string `json:"response_format"`
|
||||
}
|
||||
|
||||
type AudioTranscriptionRequest struct {
|
||||
File *multipart.FileHeader `form:"file" binding:"required"`
|
||||
Model string `form:"model" binding:"required"`
|
||||
Language string `form:"language"`
|
||||
Prompt string `form:"prompt"`
|
||||
ReponseFormat string `form:"response_format" binding:"oneof=json text srt verbose_json vtt"`
|
||||
Temperature float64 `form:"temperature"`
|
||||
TimestampGranularity []string `form:"timestamp_granularity"`
|
||||
}
|
||||
|
||||
type AudioTranslationRequest struct {
|
||||
File *multipart.FileHeader `form:"file" binding:"required"`
|
||||
Model string `form:"model" binding:"required"`
|
||||
Prompt string `form:"prompt"`
|
||||
ResponseFormat string `form:"response_format" binding:"oneof=json text srt verbose_json vtt"`
|
||||
Temperature float64 `form:"temperature"`
|
||||
}
|
||||
|
||||
type UsageOrResponseText struct {
|
||||
*model.Usage
|
||||
ResponseText string
|
||||
|
||||
Reference in New Issue
Block a user