File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -219,9 +219,16 @@ <h2>Preset prices (all per million tokens)</h2>
219219 for ( const [ key , preset ] of Object . entries ( presets ) ) {
220220 const presetItem = document . createElement ( 'div' ) ;
221221 presetItem . className = 'preset-item' ;
222+
223+ let prices ;
224+ if ( preset . getPrice ) {
225+ prices = preset . getPrice ( ) ;
226+ } else {
227+ prices = { input : preset . input , output : preset . output } ;
228+ }
222229 presetItem . innerHTML = `
223230 <button class="preset-btn" onclick="setPreset('${ key } ')">${ preset . name } </button>
224- <span class="preset-info">Input: ${ formatPrice ( preset . input ) } / Output: ${ formatPrice ( preset . output ) } </span>
231+ <span class="preset-info">Input: ${ formatPrice ( prices . input ) } / Output: ${ formatPrice ( prices . output ) } </span>
225232 ` ;
226233 presetList . appendChild ( presetItem ) ;
227234 }
You can’t perform that action at this time.
0 commit comments