Stabilize Whisper transcription requests
This commit is contained in:
@@ -28,7 +28,7 @@ func TestWhisperUsesAudioTranscriptionsEndpoint(t *testing.T) {
|
||||
}))
|
||||
defer audioSrv.Close()
|
||||
|
||||
var gotPath, gotModel, gotResponseFormat, gotPrompt string
|
||||
var gotPath, gotModel, gotResponseFormat, gotPrompt, gotTemperature string
|
||||
providerSrv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
gotPath = r.URL.Path
|
||||
if err := r.ParseMultipartForm(16 << 20); err != nil {
|
||||
@@ -37,6 +37,7 @@ func TestWhisperUsesAudioTranscriptionsEndpoint(t *testing.T) {
|
||||
gotModel = r.FormValue("model")
|
||||
gotResponseFormat = r.FormValue("response_format")
|
||||
gotPrompt = r.FormValue("prompt")
|
||||
gotTemperature = r.FormValue("temperature")
|
||||
if _, _, err := r.FormFile("file"); err != nil {
|
||||
t.Fatalf("FormFile: %v", err)
|
||||
}
|
||||
@@ -70,6 +71,9 @@ func TestWhisperUsesAudioTranscriptionsEndpoint(t *testing.T) {
|
||||
if gotResponseFormat != "json" {
|
||||
t.Fatalf("response_format = %q, want json", gotResponseFormat)
|
||||
}
|
||||
if gotTemperature != "0" {
|
||||
t.Fatalf("temperature = %q, want 0", gotTemperature)
|
||||
}
|
||||
if gotPrompt != "" {
|
||||
t.Fatalf("prompt = %q, want empty", gotPrompt)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user