feat: add Claude Fable 5.1 and GPT-6 Astra (#6015)
This commit is contained in:
@@ -3066,6 +3066,9 @@
|
||||
<div>
|
||||
<h4 data-i18n="OpenAI Model">OpenAI Model</h4>
|
||||
<select id="model_openai_select">
|
||||
<optgroup label="GPT-6">
|
||||
<option value="gpt-6-astra">gpt-6-astra</option>
|
||||
</optgroup>
|
||||
<optgroup label="GPT-5.6">
|
||||
<option value="gpt-5.6">gpt-5.6</option>
|
||||
<option value="gpt-5.6-sol">gpt-5.6-sol</option>
|
||||
@@ -3183,6 +3186,7 @@
|
||||
<h4 data-i18n="Claude Model">Claude Model</h4>
|
||||
<select id="model_claude_select">
|
||||
<optgroup label="Versions">
|
||||
<option value="claude-fable-5-1">claude-fable-5-1</option>
|
||||
<option value="claude-fable-5">claude-fable-5</option>
|
||||
<option value="claude-opus-5">claude-opus-5</option>
|
||||
<option value="claude-sonnet-5">claude-sonnet-5</option>
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
<option data-type="cohere" value="c4ai-aya-vision-8b">c4ai-aya-vision-8b</option>
|
||||
<option data-type="cohere" value="c4ai-aya-vision-32b">c4ai-aya-vision-32b</option>
|
||||
<option data-type="cohere" value="command-a-vision-07-2025">command-a-vision-07-2025</option>
|
||||
<option data-type="openai" value="gpt-6-astra">gpt-6-astra</option>
|
||||
<option data-type="openai" value="gpt-5.6">gpt-5.6</option>
|
||||
<option data-type="openai" value="gpt-5.6-sol">gpt-5.6-sol</option>
|
||||
<option data-type="openai" value="gpt-5.6-terra">gpt-5.6-terra</option>
|
||||
@@ -96,6 +97,7 @@
|
||||
<option data-type="openai" value="o3-2025-04-16">o3-2025-04-16</option>
|
||||
<option data-type="openai" value="o4-mini">o4-mini</option>
|
||||
<option data-type="openai" value="o4-mini-2025-04-16">o4-mini-2025-04-16</option>
|
||||
<option data-type="anthropic" value="claude-fable-5-1">claude-fable-5-1</option>
|
||||
<option data-type="anthropic" value="claude-fable-5">claude-fable-5</option>
|
||||
<option data-type="anthropic" value="claude-opus-5">claude-opus-5</option>
|
||||
<option data-type="anthropic" value="claude-sonnet-5">claude-sonnet-5</option>
|
||||
|
||||
@@ -2631,6 +2631,10 @@ function getReasoningEffort(settings = null, model = null) {
|
||||
|
||||
return reasoning_effort_types.low;
|
||||
case reasoning_effort_types.max:
|
||||
if ([chat_completion_sources.OPENAI, chat_completion_sources.AZURE_OPENAI].includes(settings.chat_completion_source)
|
||||
&& /^gpt-6-astra/.test(model)) {
|
||||
return reasoning_effort_types.max;
|
||||
}
|
||||
if ([chat_completion_sources.OPENAI, chat_completion_sources.AZURE_OPENAI].includes(settings.chat_completion_source)
|
||||
&& /^gpt-5\.6/.test(model)) {
|
||||
// GPT-5.6 reserves "max" effort for the Responses API.
|
||||
@@ -3090,6 +3094,15 @@ export async function createGenerationParameters(settings, model, type, messages
|
||||
}
|
||||
}
|
||||
|
||||
if (gptSources.includes(settings.chat_completion_source) && /gpt-6-astra/.test(model)) {
|
||||
generate_data.max_completion_tokens = generate_data.max_tokens;
|
||||
delete generate_data.max_tokens;
|
||||
delete generate_data.temperature;
|
||||
delete generate_data.top_p;
|
||||
delete generate_data.logprobs;
|
||||
delete generate_data.top_logprobs;
|
||||
}
|
||||
|
||||
// Claude Fable / Claude 5 models removed sampling parameters and reject them with HTTP 400,
|
||||
// including via OpenAI-compatible proxies. Unanchored to also match prefixed ids
|
||||
// like 'anthropic/claude-fable-5' or 'anthropic/claude-opus-5'.
|
||||
@@ -5079,6 +5092,7 @@ function getMaxContextOpenAI(value) {
|
||||
|
||||
/** @type {[RegExp, number][]} */
|
||||
const contextMap = [
|
||||
[/^gpt-6-astra/, max_1050k],
|
||||
[/^gpt-5\.6/, max_1050k],
|
||||
[/^gpt-5\.[45]/, max_1mil],
|
||||
[/^gpt-5/, max_400k],
|
||||
@@ -6227,6 +6241,7 @@ export function isImageInliningSupported() {
|
||||
'gpt-4.1',
|
||||
'gpt-4.5-preview',
|
||||
'gpt-4o',
|
||||
'gpt-6-astra',
|
||||
'gpt-5',
|
||||
'o1',
|
||||
'o3',
|
||||
|
||||
@@ -639,7 +639,7 @@ export function getTokenizerModel() {
|
||||
}
|
||||
|
||||
if (oai_settings.chat_completion_source == chat_completion_sources.ELECTRONHUB && oai_settings.electronhub_model) {
|
||||
if (oai_settings.electronhub_model.includes('gpt-4o') || oai_settings.electronhub_model.includes('gpt-5')) {
|
||||
if (oai_settings.electronhub_model.includes('gpt-4o') || oai_settings.electronhub_model.includes('gpt-5') || oai_settings.electronhub_model.includes('gpt-6-astra')) {
|
||||
return gpt4oTokenizer;
|
||||
} else if (oai_settings.electronhub_model.includes('gpt-4.1') || oai_settings.electronhub_model.includes('gpt-4.5')) {
|
||||
return gpt4oTokenizer;
|
||||
|
||||
@@ -619,6 +619,12 @@ export class ToolManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
// GPT-6 Astra supports tool calling only through the Responses API.
|
||||
if ([chat_completion_sources.OPENAI, chat_completion_sources.AZURE_OPENAI].includes(settings.chat_completion_source)
|
||||
&& /^gpt-6-astra/.test(model)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Post-processing will forcefully remove past tool calls from the prompt, making them useless
|
||||
const { NONE, MERGE_TOOLS, SEMI_TOOLS, STRICT_TOOLS } = custom_prompt_post_processing_types;
|
||||
const allowedPromptPostProcessing = [NONE, MERGE_TOOLS, SEMI_TOOLS, STRICT_TOOLS];
|
||||
|
||||
+2
-1
@@ -456,7 +456,7 @@ export const AZURE_OPENAI_KEYS = [
|
||||
'reasoning_effort',
|
||||
];
|
||||
|
||||
export const OPENAI_VERBOSITY_MODELS = /^gpt-5/;
|
||||
export const OPENAI_VERBOSITY_MODELS = /^(?:gpt-5|gpt-6-astra)/;
|
||||
|
||||
export const OPENAI_REASONING_EFFORT_MODELS = [
|
||||
'o1',
|
||||
@@ -491,6 +491,7 @@ export const OPENAI_REASONING_EFFORT_MODELS = [
|
||||
'gpt-5.6-sol',
|
||||
'gpt-5.6-terra',
|
||||
'gpt-5.6-luna',
|
||||
'gpt-6-astra',
|
||||
];
|
||||
|
||||
export const OPENAI_REASONING_EFFORT_MAP = {
|
||||
|
||||
@@ -250,6 +250,7 @@ async function sendClaudeRequest(request, response) {
|
||||
const convertedPrompt = convertClaudeMessages(request.body.messages, request.body.assistant_prefill, useSystemPrompt, useTools, getPromptNames(request));
|
||||
// Unanchored to also match prefixed ids passed through proxies, e.g. 'anthropic/claude-fable-5'
|
||||
const isFableModel = /claude-fable/.test(request.body.model);
|
||||
const isFable51Model = /claude-fable-5-1/.test(request.body.model);
|
||||
const isClaude5Model = /claude-(opus-5|sonnet-5)/.test(request.body.model);
|
||||
const useThinking = /^claude-(3-7|opus-4|sonnet-4|haiku-4-5|opus-4-5|opus-4-6|sonnet-4-6|opus-4-7)/.test(request.body.model) || isFableModel || isClaude5Model;
|
||||
const useWebSearch = (/^claude-(3-5|3-7|opus-4|sonnet-4|haiku-4-5|opus-4-5|opus-4-6|sonnet-4-6|opus-4-7)/.test(request.body.model) || isFableModel || isClaude5Model) && Boolean(request.body.enable_web_search);
|
||||
@@ -298,15 +299,24 @@ async function sendClaudeRequest(request, response) {
|
||||
}
|
||||
}
|
||||
|
||||
// Structured output is a forced tool
|
||||
// Fable 5.1 rejects forced tools, but supports native JSON outputs.
|
||||
if (request.body.json_schema) {
|
||||
const jsonTool = {
|
||||
name: request.body.json_schema.name,
|
||||
description: request.body.json_schema.description || 'Well-formed JSON object',
|
||||
input_schema: request.body.json_schema.value,
|
||||
};
|
||||
requestBody.tools = [...(requestBody.tools || []), jsonTool];
|
||||
requestBody.tool_choice = { type: 'tool', name: request.body.json_schema.name };
|
||||
if (isFable51Model) {
|
||||
requestBody.output_config = {
|
||||
format: {
|
||||
type: 'json_schema',
|
||||
schema: request.body.json_schema.value,
|
||||
},
|
||||
};
|
||||
} else {
|
||||
const jsonTool = {
|
||||
name: request.body.json_schema.name,
|
||||
description: request.body.json_schema.description || 'Well-formed JSON object',
|
||||
input_schema: request.body.json_schema.value,
|
||||
};
|
||||
requestBody.tools = [...(requestBody.tools || []), jsonTool];
|
||||
requestBody.tool_choice = { type: 'tool', name: request.body.json_schema.name };
|
||||
}
|
||||
}
|
||||
|
||||
if (useWebSearch) {
|
||||
|
||||
@@ -442,7 +442,7 @@ export function getTokenizerModel(requestModel) {
|
||||
return 'o1';
|
||||
}
|
||||
|
||||
if (requestModel.includes('gpt-5') || requestModel.includes('o3') || requestModel.includes('o4-mini')) {
|
||||
if (requestModel.includes('gpt-5') || requestModel.includes('gpt-6-astra') || requestModel.includes('o3') || requestModel.includes('o4-mini')) {
|
||||
return 'o1';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user