Add gpt-4.5-preview

ea643cce6e2f00e8886d3940499481f5a10f1492

Wolfsblvt <wolfsblvt@gmail.com>

4 files changed, +12 -1Ignore whitespace
public/index.html+4 -0
@@ -2867,6 +2867,10 @@
2867 <option value="o3-mini">o3-mini</option>2867 <option value="o3-mini">o3-mini</option>
2868 <option value="o3-mini-2025-01-31">o3-mini-2025-01-31</option>2868 <option value="o3-mini-2025-01-31">o3-mini-2025-01-31</option>
2869 </optgroup>2869 </optgroup>
2870 <optgroup label="GPT-4.5">
2871 <option value="gpt-4.5-preview">gpt-4.5-preview</option>
2872 <option value="gpt-4.5-preview-2025-02-27">gpt-4.5-preview-2025-02-27</option>
2873 </optgroup>
2870 <optgroup label="GPT-4 Turbo and GPT-4">2874 <optgroup label="GPT-4 Turbo and GPT-4">
2871 <option value="gpt-4-turbo">gpt-4-turbo</option>2875 <option value="gpt-4-turbo">gpt-4-turbo</option>
2872 <option value="gpt-4-turbo-2024-04-09">gpt-4-turbo-2024-04-09</option>2876 <option value="gpt-4-turbo-2024-04-09">gpt-4-turbo-2024-04-09</option>
public/scripts/openai.js+3 -1
@@ -1945,7 +1945,7 @@ async function sendOpenAIRequest(type, messages, signal) {
1945 }1945 }
19461946
1947 // Remove logit bias, logprobs and stop strings if it's not supported by the model1947 // Remove logit bias, logprobs and stop strings if it's not supported by the model
1948 if (isOAI && oai_settings.openai_model.includes('vision') || isOpenRouter && oai_settings.openrouter_model.includes('vision')) {1948 if (isOAI && oai_settings.openai_model.includes('vision') || isOpenRouter && oai_settings.openrouter_model.includes('vision') || isOAI && oai_settings.openai_model.includes('gpt-4.5-preview')) {
1949 delete generate_data.logit_bias;1949 delete generate_data.logit_bias;
1950 delete generate_data.stop;1950 delete generate_data.stop;
1951 delete generate_data.logprobs;1951 delete generate_data.logprobs;
@@ -4997,6 +4997,8 @@ export function isImageInliningSupported() {
4997 'gpt-4-turbo',4997 'gpt-4-turbo',
4998 'gpt-4o',4998 'gpt-4o',
4999 'gpt-4o-mini',4999 'gpt-4o-mini',
5000 'gpt-4.5-preview',
5001 'gpt-4.5-preview-2025-02-27',
5000 'o1',5002 'o1',
5001 'o1-2024-12-17',5003 'o1-2024-12-17',
5002 'chatgpt-4o-latest',5004 'chatgpt-4o-latest',
public/scripts/reasoning.js+1 -0
@@ -108,6 +108,7 @@ export function isHiddenReasoningModel() {
108108
109 /** @type {{ name: string; func: MatchingFunc; }[]} */109 /** @type {{ name: string; func: MatchingFunc; }[]} */
110 const hiddenReasoningModels = [110 const hiddenReasoningModels = [
111 { name: 'gpt-4.5', func: FUNCS.startsWith },
111 { name: 'o1', func: FUNCS.startsWith },112 { name: 'o1', func: FUNCS.startsWith },
112 { name: 'o3', func: FUNCS.startsWith },113 { name: 'o3', func: FUNCS.startsWith },
113 { name: 'gemini-2.0-flash-thinking-exp', func: FUNCS.startsWith },114 { name: 'gemini-2.0-flash-thinking-exp', func: FUNCS.startsWith },
src/endpoints/tokenizers.js+4 -0
@@ -410,6 +410,10 @@ export function getTokenizerModel(requestModel) {
410 return 'gpt-4o';410 return 'gpt-4o';
411 }411 }
412412
413 if (requestModel.includes('gpt-4.5-preview')) {
414 return 'gpt-4o';
415 }
416
413 if (requestModel.includes('gpt-4-32k')) {417 if (requestModel.includes('gpt-4-32k')) {
414 return 'gpt-4-32k';418 return 'gpt-4-32k';
415 }419 }