Skip to content

Commit

Permalink
Update VoiceSettings model with newly added fields
Browse files Browse the repository at this point in the history
  • Loading branch information
haguro committed Jan 14, 2024
1 parent 2074cda commit 6ba0eae
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion elevenlabs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ func TestEditVoiceSettings(t *testing.T) {
})
defer server.Close()
client := elevenlabs.NewMockClient(context.Background(), server.URL, mockAPIKey, mockTimeout)
err := client.EditVoiceSettings("TestVoiceID", elevenlabs.VoiceSettings{Stability: 0.2, SimilarityBoost: 0.7})
err := client.EditVoiceSettings("TestVoiceID", elevenlabs.VoiceSettings{Stability: 0.2, SimilarityBoost: 0.7, Style: 0.3, SpeakerBoost: false})
if err != nil {
t.Errorf("Expected no errors, got error: %q", err)
}
Expand Down
2 changes: 2 additions & 0 deletions models.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ type Voice struct {
type VoiceSettings struct {
SimilarityBoost float32 `json:"similarity_boost"`
Stability float32 `json:"stability"`
Style float32 `json:"style,omitempty"`
SpeakerBoost bool `json:"use_speaker_boost,omitempty"`
}

type VoiceSharing struct {
Expand Down
12 changes: 9 additions & 3 deletions request_bodies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,16 @@ var testRespBodies = map[string][]byte{

"TestGetDefaultVoiceSettings": []byte(`{
"stability": 0.1,
"similarity_boost": 0.2
"similarity_boost": 0.2,
"style": 0,
"use_speaker_boost": true
}`),

"TestGetVoiceSettings": []byte(`{
"stability": 0.7,
"similarity_boost": 0.9
"similarity_boost": 0.9,
"style": 0.1,
"use_speaker_boost": false
}`),

"TestGetVoice": []byte(`{
Expand Down Expand Up @@ -173,7 +177,9 @@ var testRespBodies = map[string][]byte{
],
"settings": {
"stability": 0.3,
"similarity_boost": 0.7
"similarity_boost": 0.7,
"style": 0.4,
"use_speaker_boost": false
},
"sharing": {
"status": "string",
Expand Down

0 comments on commit 6ba0eae

Please sign in to comment.