| 4324 | 4329 | $('#temp_openai').attr('max', oai_max_temp).val(oai_settings.temp_openai).trigger('input'); |
| 4325 | 4330 | } |
| 4326 | 4331 | |
| 4332 | + if (oai_settings.chat_completion_source === chat_completion_sources.COHERE) { |
| 4333 | + oai_settings.pres_pen_openai = Math.min(Math.max(0, oai_settings.pres_pen_openai), 1); |
| 4334 | + $('#pres_pen_openai').attr('max', 1).attr('min', 0).val(oai_settings.pres_pen_openai).trigger('input'); |
| 4335 | + oai_settings.freq_pen_openai = Math.min(Math.max(0, oai_settings.freq_pen_openai), 1); |
| 4336 | + $('#freq_pen_openai').attr('max', 1).attr('min', 0).val(oai_settings.freq_pen_openai).trigger('input'); |
| 4337 | + } else { |
| 4338 | + $('#pres_pen_openai').attr('max', 2).attr('min', 0).val(oai_settings.pres_pen_openai).trigger('input'); |
| 4339 | + $('#freq_pen_openai').attr('max', 2).attr('min', 0).val(oai_settings.freq_pen_openai).trigger('input'); |
| 4340 | + } |
| 4341 | + |
| 4327 | 4342 | $('#openai_max_context_counter').attr('max', Number($('#openai_max_context').attr('max'))); |
| 4328 | 4343 | |
| 4329 | 4344 | saveSettingsDebounced(); |