122122 cursor : pointer;
123123 text-decoration : underline;
124124 }
125+ .select-group {
126+ display : flex;
127+ gap : 12px ;
128+ }
125129 </ style >
126130</ head >
127131< body >
128132 < h1 > Prompt GPT-4o audio</ h1 >
129133 < div class ="info ">
130- Enter a prompt below and execute against < code > gpt-4o-audio-preview </ code > to hear the results.
134+ Enter a prompt below and execute against the selected model to hear the results.
131135 </ div >
132136
133137 < div class ="input-group ">
@@ -137,14 +141,21 @@ <h1>Prompt GPT-4o audio</h1>
137141 < label for ="promptInput "> User Prompt:</ label >
138142 < textarea id ="promptInput " placeholder ="Enter your text here... " aria-label ="Input text "> </ textarea >
139143
140- < select id ="voiceSelect " aria-label ="Voice selection ">
141- < option value ="alloy "> Alloy</ option >
142- < option value ="echo "> Echo</ option >
143- < option value ="fable "> Fable</ option >
144- < option value ="onyx "> Onyx</ option >
145- < option value ="nova "> Nova</ option >
146- < option value ="shimmer "> Shimmer</ option >
147- </ select >
144+ < div class ="select-group ">
145+ < select id ="modelSelect " aria-label ="Model selection ">
146+ < option value ="gpt-4o-audio-preview-2024-12-17 "> GPT-4o Audio Preview (Dec 17, 2024)</ option >
147+ < option value ="gpt-4o-audio-preview-2024-10-01 "> GPT-4o Audio Preview (Oct 1, 2024)</ option >
148+ </ select >
149+
150+ < select id ="voiceSelect " aria-label ="Voice selection ">
151+ < option value ="alloy "> Alloy</ option >
152+ < option value ="echo "> Echo</ option >
153+ < option value ="fable "> Fable</ option >
154+ < option value ="onyx "> Onyx</ option >
155+ < option value ="nova "> Nova</ option >
156+ < option value ="shimmer "> Shimmer</ option >
157+ </ select >
158+ </ div >
148159 < button id ="submitBtn "> Generate Speech</ button >
149160 </ div >
150161
@@ -171,6 +182,7 @@ <h3>API Response:</h3>
171182 < script >
172183 const promptInput = document . getElementById ( 'promptInput' ) ;
173184 const systemPrompt = document . getElementById ( 'systemPrompt' ) ;
185+ const modelSelect = document . getElementById ( 'modelSelect' ) ;
174186 const voiceSelect = document . getElementById ( 'voiceSelect' ) ;
175187 const submitBtn = document . getElementById ( 'submitBtn' ) ;
176188 const errorDiv = document . getElementById ( 'error' ) ;
@@ -308,6 +320,7 @@ <h3>API Response:</h3>
308320 return ;
309321 }
310322
323+ const model = modelSelect . value ;
311324 const voice = voiceSelect . value ;
312325 submitBtn . textContent = 'Processing...' ;
313326 submitBtn . disabled = true ;
@@ -325,7 +338,7 @@ <h3>API Response:</h3>
325338 } ) ;
326339
327340 const payload = {
328- "model" : "gpt-4o-audio-preview" ,
341+ "model" : model ,
329342 "modalities" : [
330343 "text" ,
331344 "audio"
0 commit comments