Skip to content

Commit 1c584d1

Browse files
committed
refactor: replace providerOptions by a dictionary
1 parent 77f0827 commit 1c584d1

File tree

3 files changed

+7
-71
lines changed

3 files changed

+7
-71
lines changed

Vonage.Test/Voice/Data/TestTalk-request.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,8 @@
99
"style": 0,
1010
"provider": "ElevenLabs",
1111
"providerOptions": {
12-
"voice_id": "NFG5qt843uXKj4pFvR7C",
13-
"model_id": "eleven_multilingual_v2",
14-
"voice_settings": {
15-
"stability": 1.5,
16-
"use_speaker_boost": true,
17-
"similarity_boost": 2.4,
18-
"style": 1.4,
19-
"speed": 2.5
20-
}
12+
"test": "value",
13+
"foo": "bar"
2114
}
2215
}
2316
]

Vonage.Test/Voice/NccoTests.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -208,18 +208,10 @@ public void TestTalk() =>
208208
Language = "en-US",
209209
Style = 0,
210210
Provider = TalkAction.TalkProvider.ElevenLabs,
211-
ProviderOptions = new TalkProviderOptions
211+
ProviderOptions = new Dictionary<string, string>
212212
{
213-
VoiceId = "NFG5qt843uXKj4pFvR7C",
214-
ModelId = "eleven_multilingual_v2",
215-
Settings = new TalkProviderSettings
216-
{
217-
Speed = (decimal) 2.5,
218-
SimilarityBoost = (decimal) 2.4,
219-
UseSpeakerBoost = true,
220-
Stability = (decimal) 1.5,
221-
Style = (decimal) 1.4,
222-
},
213+
{"test", "value"},
214+
{"foo", "bar"},
223215
},
224216
});
225217

Vonage/Voice/Nccos/TalkAction.cs

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#region
2+
using System.Collections.Generic;
23
using System.Runtime.Serialization;
34
using Newtonsoft.Json;
45
using Newtonsoft.Json.Converters;
@@ -99,55 +100,5 @@ public enum TalkProvider
99100
/// <summary>
100101
/// </summary>
101102
[JsonProperty("providerOptions", Order = 10)]
102-
public TalkProviderOptions? ProviderOptions { get; set; }
103-
}
104-
105-
/// <summary>
106-
/// </summary>
107-
public struct TalkProviderOptions
108-
{
109-
/// <summary>
110-
/// </summary>
111-
[JsonProperty("voice_id", Order = 0)]
112-
public string VoiceId { get; set; }
113-
114-
/// <summary>
115-
/// </summary>
116-
[JsonProperty("model_id", Order = 1)]
117-
public string ModelId { get; set; }
118-
119-
/// <summary>
120-
/// </summary>
121-
[JsonProperty("voice_settings", Order = 1)]
122-
public TalkProviderSettings Settings { get; set; }
123-
}
124-
125-
/// <summary>
126-
/// </summary>
127-
public struct TalkProviderSettings
128-
{
129-
/// <summary>
130-
/// </summary>
131-
[JsonProperty("stability", Order = 0)]
132-
public decimal Stability { get; set; }
133-
134-
/// <summary>
135-
/// </summary>
136-
[JsonProperty("use_speaker_boost", Order = 1)]
137-
public bool UseSpeakerBoost { get; set; }
138-
139-
/// <summary>
140-
/// </summary>
141-
[JsonProperty("similarity_boost", Order = 2)]
142-
public decimal SimilarityBoost { get; set; }
143-
144-
/// <summary>
145-
/// </summary>
146-
[JsonProperty("style", Order = 3)]
147-
public decimal Style { get; set; }
148-
149-
/// <summary>
150-
/// </summary>
151-
[JsonProperty("speed", Order = 4)]
152-
public decimal Speed { get; set; }
103+
public Dictionary<string, string> ProviderOptions { get; set; }
153104
}

0 commit comments

Comments
 (0)