@@ -20,9 +20,11 @@ const (
20
20
type AudioResponseFormat string
21
21
22
22
const (
23
- AudioResponseFormatJSON AudioResponseFormat = "json"
24
- AudioResponseFormatSRT AudioResponseFormat = "srt"
25
- AudioResponseFormatVTT AudioResponseFormat = "vtt"
23
+ AudioResponseFormatJSON AudioResponseFormat = "json"
24
+ AudioResponseFormatText AudioResponseFormat = "text"
25
+ AudioResponseFormatSRT AudioResponseFormat = "srt"
26
+ AudioResponseFormatVerboseJSON AudioResponseFormat = "verbose_json"
27
+ AudioResponseFormatVTT AudioResponseFormat = "vtt"
26
28
)
27
29
28
30
// AudioRequest represents a request structure for audio API.
@@ -44,6 +46,22 @@ type AudioRequest struct {
44
46
45
47
// AudioResponse represents a response structure for audio API.
46
48
type AudioResponse struct {
49
+ Task string `json:"task"`
50
+ Language string `json:"language"`
51
+ Duration float64 `json:"duration"`
52
+ Segments []struct {
53
+ ID int `json:"id"`
54
+ Seek int `json:"seek"`
55
+ Start float64 `json:"start"`
56
+ End float64 `json:"end"`
57
+ Text string `json:"text"`
58
+ Tokens []int `json:"tokens"`
59
+ Temperature float64 `json:"temperature"`
60
+ AvgLogprob float64 `json:"avg_logprob"`
61
+ CompressionRatio float64 `json:"compression_ratio"`
62
+ NoSpeechProb float64 `json:"no_speech_prob"`
63
+ Transient bool `json:"transient"`
64
+ } `json:"segments"`
47
65
Text string `json:"text"`
48
66
}
49
67
@@ -96,7 +114,7 @@ func (c *Client) callAudioAPI(
96
114
97
115
// HasJSONResponse returns true if the response format is JSON.
98
116
func (r AudioRequest ) HasJSONResponse () bool {
99
- return r .Format == "" || r .Format == AudioResponseFormatJSON
117
+ return r .Format == "" || r .Format == AudioResponseFormatJSON || r . Format == AudioResponseFormatVerboseJSON
100
118
}
101
119
102
120
// audioMultipartForm creates a form with audio file contents and the name of the model to use for
0 commit comments