@@ -29,42 +29,85 @@ public SessionConfiguration(
2929 int ? maxResponseOutputTokens ,
3030 int ? expiresAfter )
3131 : this (
32- model : model ,
33- modalities : modalities ,
34- voice : voice ,
35- instructions : instructions ,
36- inputAudioFormat : inputAudioFormat ,
37- outputAudioFormat : outputAudioFormat ,
32+ model ,
33+ prompt : null ,
34+ instructions ,
35+ modalities ,
36+ voice ,
37+ speed : null ,
38+ inputAudioFormat ,
39+ outputAudioFormat ,
40+ inputAudioNoiseSettings : null ,
3841 inputAudioTranscriptionSettings : new ( transcriptionModel ) ,
39- turnDetectionSettings : turnDetectionSettings ,
40- tools : tools ,
41- toolChoice : toolChoice ,
42- temperature : temperature ,
43- maxResponseOutputTokens : maxResponseOutputTokens ,
44- expiresAfter : expiresAfter )
42+ turnDetectionSettings ,
43+ tools ,
44+ toolChoice ,
45+ temperature ,
46+ maxResponseOutputTokens ,
47+ expiresAfter )
4548 {
4649 }
4750
51+ [ Obsolete ( "Use new ctor overload" ) ]
4852 public SessionConfiguration (
4953 Model model ,
54+ Modality modalities ,
55+ Voice voice ,
56+ string instructions ,
57+ RealtimeAudioFormat inputAudioFormat ,
58+ RealtimeAudioFormat outputAudioFormat ,
59+ InputAudioTranscriptionSettings inputAudioTranscriptionSettings ,
60+ IVoiceActivityDetectionSettings turnDetectionSettings ,
61+ IEnumerable < Tool > tools ,
62+ string toolChoice ,
63+ float ? temperature ,
64+ int ? maxResponseOutputTokens ,
65+ int ? expiresAfter ,
66+ NoiseReductionSettings inputAudioNoiseSettings ,
67+ float ? speed ,
68+ Prompt prompt )
69+ : this (
70+ model ,
71+ prompt ,
72+ instructions ,
73+ modalities ,
74+ voice ,
75+ speed ,
76+ inputAudioFormat ,
77+ outputAudioFormat ,
78+ inputAudioNoiseSettings ,
79+ inputAudioTranscriptionSettings ,
80+ turnDetectionSettings ,
81+ tools ,
82+ toolChoice ,
83+ temperature ,
84+ maxResponseOutputTokens ,
85+ expiresAfter )
86+ {
87+ }
88+
89+ public SessionConfiguration (
90+ Model model = null ,
91+ Prompt prompt = null ,
92+ string instructions = null ,
5093 Modality modalities = Modality . Text | Modality . Audio ,
5194 Voice voice = null ,
52- string instructions = null ,
95+ float ? speed = null ,
5396 RealtimeAudioFormat inputAudioFormat = RealtimeAudioFormat . PCM16 ,
5497 RealtimeAudioFormat outputAudioFormat = RealtimeAudioFormat . PCM16 ,
98+ NoiseReductionSettings inputAudioNoiseSettings = null ,
5599 InputAudioTranscriptionSettings inputAudioTranscriptionSettings = null ,
56100 IVoiceActivityDetectionSettings turnDetectionSettings = null ,
57101 IEnumerable < Tool > tools = null ,
58102 string toolChoice = null ,
59103 float ? temperature = null ,
60104 int ? maxResponseOutputTokens = null ,
61- int ? expiresAfter = null ,
62- NoiseReductionSettings inputAudioNoiseSettings = null ,
63- float ? speed = null ,
64- Prompt prompt = null )
105+ int ? expiresAfter = null )
65106 {
66107 ClientSecret = new ClientSecret ( expiresAfter ) ;
67- Model = string . IsNullOrWhiteSpace ( model ? . Id ) ? Models . Model . GPT4oRealtime : model ;
108+ Model = string . IsNullOrWhiteSpace ( model ? . Id ) && prompt == null
109+ ? Models . Model . GPT4oRealtime
110+ : model ;
68111 Modalities = modalities ;
69112 Voice = string . IsNullOrWhiteSpace ( voice ? . Id ) ? OpenAI . Voice . Alloy : voice ;
70113 Instructions = string . IsNullOrWhiteSpace ( instructions )
@@ -153,6 +196,7 @@ internal SessionConfiguration(
153196 /// </summary>
154197 [ JsonInclude ]
155198 [ JsonPropertyName ( "model" ) ]
199+ [ JsonIgnore ( Condition = JsonIgnoreCondition . WhenWritingDefault ) ]
156200 public string Model { get ; private set ; }
157201
158202 /// <summary>
0 commit comments