New ChatGPT model

bc7ac12317350bdf2aa9ee2de63df3739b984658

Cohee <18619528+Cohee1207@users.noreply.github.com>

3 files changed, +8 -3Showing whitespace changes
public/index.html+2 -1
@@ -383,7 +383,7 @@
383383 Max Response Length (tokens)
384384 </div>
385385 <div class="wide100p">
386386 <input type="number" id="openai_max_tokens" name="openai_max_tokens" class="text_pole" min="501" max="800016384">
387387 </div>
388388 </div>
389389 <div class="range-block" data-source="openai,custom">
@@ -2573,6 +2573,7 @@
25732573 <option value="gpt-4o">gpt-4o</option>
25742574 <option value="gpt-4o-2024-08-06">gpt-4o-2024-08-06</option>
25752575 <option value="gpt-4o-2024-05-13">gpt-4o-2024-05-13</option>
2576+ <option value="chatgpt-4o-latest">chatgpt-4o-latest</option>
25762577 </optgroup>
25772578 <optgroup label="gpt-4o-mini">
25782579 <option value="gpt-4o-mini">gpt-4o-mini</option>
public/scripts/openai.js+2 -2
@@ -3921,7 +3921,7 @@ function getMaxContextOpenAI(value) {
39213921 if (oai_settings.max_context_unlocked) {
39223922 return unlocked_max;
39233923 }
39243924 else if (value.includes('chatgpt-4o-latest') || value.includes('gpt-4-turbo') || value.includes('gpt-4o') || value.includes('gpt-4-1106') || value.includes('gpt-4-0125') || value.includes('gpt-4-vision')) {
39253925 return max_128k;
39263926 }
39273927 else if (value.includes('gpt-3.5-turbo-1106')) {
@@ -4768,7 +4768,7 @@ export function isImageInliningSupported() {
47684768
47694769 switch (oai_settings.chat_completion_source) {
47704770 case chat_completion_sources.OPENAI:
47714771 return visionSupportedModels.some(model => oai_settings.openai_model.includes(model) && !oai_settings.openai_model.includes('chatgpt-4o-latest') && !oai_settings.openai_model.includes('gpt-4-turbo-preview'));
47724772 case chat_completion_sources.MAKERSUITE:
47734773 return visionSupportedModels.some(model => oai_settings.google_model.includes(model));
47744774 case chat_completion_sources.CLAUDE:
src/endpoints/tokenizers.js+4 -0
@@ -268,6 +268,10 @@ function getTokenizerModel(requestModel) {
268268 return 'gpt-4o';
269269 }
270270
271+ if (requestModel.includes('chatgpt-4o-latest')) {
272+ return 'gpt-4o';
273+ }
274+
271275 if (requestModel.includes('gpt-4-32k')) {
272276 return 'gpt-4-32k';
273277 }