mirror of
https://github.com/simstudioai/sim.git
synced 2026-08-31 01:11:53 +08:00
improvement(models): update default to claude-sonnet-4-6 and reorganize OpenAI models (#3898)
* improvement(models): update default to claude-sonnet-4-6 and reorganize OpenAI models * fix(tests): update stale claude-sonnet-4-5 references to claude-sonnet-4-6 * fix(combobox): rename misleading claudeSonnet45 variable to defaultModelOption
This commit is contained in:
+8
-6
@@ -21,7 +21,7 @@ import { useWorkflowStore } from '@/stores/workflows/workflow/store'
|
||||
/**
|
||||
* Constants for ComboBox component behavior
|
||||
*/
|
||||
const DEFAULT_MODEL = 'claude-sonnet-4-5'
|
||||
const DEFAULT_MODEL = 'claude-sonnet-4-6'
|
||||
const ZOOM_FACTOR_BASE = 0.96
|
||||
const MIN_ZOOM = 0.1
|
||||
const MAX_ZOOM = 1
|
||||
@@ -234,7 +234,7 @@ export const ComboBox = memo(function ComboBox({
|
||||
|
||||
/**
|
||||
* Determines the default option value to use.
|
||||
* Priority: explicit defaultValue > claude-sonnet-4-5 for model field > first option
|
||||
* Priority: explicit defaultValue > claude-sonnet-4-6 for model field > first option
|
||||
*/
|
||||
const defaultOptionValue = useMemo(() => {
|
||||
if (defaultValue !== undefined) {
|
||||
@@ -246,11 +246,13 @@ export const ComboBox = memo(function ComboBox({
|
||||
// Default not available (e.g. provider disabled) — fall through to other fallbacks
|
||||
}
|
||||
|
||||
// For model field, default to claude-sonnet-4-5 if available
|
||||
// For model field, default to claude-sonnet-4-6 if available
|
||||
if (subBlockId === 'model') {
|
||||
const claudeSonnet45 = evaluatedOptions.find((opt) => getOptionValue(opt) === DEFAULT_MODEL)
|
||||
if (claudeSonnet45) {
|
||||
return getOptionValue(claudeSonnet45)
|
||||
const defaultModelOption = evaluatedOptions.find(
|
||||
(opt) => getOptionValue(opt) === DEFAULT_MODEL
|
||||
)
|
||||
if (defaultModelOption) {
|
||||
return getOptionValue(defaultModelOption)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -337,7 +337,7 @@ describe.concurrent('Blocks Module', () => {
|
||||
expect(modelSubBlock).toBeDefined()
|
||||
expect(modelSubBlock?.type).toBe('combobox')
|
||||
expect(modelSubBlock?.required).toBe(true)
|
||||
expect(modelSubBlock?.defaultValue).toBe('claude-sonnet-4-5')
|
||||
expect(modelSubBlock?.defaultValue).toBe('claude-sonnet-4-6')
|
||||
})
|
||||
|
||||
it('should have LLM tool access', () => {
|
||||
|
||||
@@ -130,7 +130,7 @@ Return ONLY the JSON array.`,
|
||||
type: 'combobox',
|
||||
placeholder: 'Type or select a model...',
|
||||
required: true,
|
||||
defaultValue: 'claude-sonnet-4-5',
|
||||
defaultValue: 'claude-sonnet-4-6',
|
||||
options: getModelOptions,
|
||||
},
|
||||
{
|
||||
@@ -458,7 +458,7 @@ Return ONLY the JSON array.`,
|
||||
],
|
||||
config: {
|
||||
tool: (params: Record<string, any>) => {
|
||||
const model = params.model || 'claude-sonnet-4-5'
|
||||
const model = params.model || 'claude-sonnet-4-6'
|
||||
if (!model) {
|
||||
throw new Error('No model selected')
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ export const EvaluatorBlock: BlockConfig<EvaluatorResponse> = {
|
||||
type: 'combobox',
|
||||
placeholder: 'Type or select a model...',
|
||||
required: true,
|
||||
defaultValue: 'claude-sonnet-4-5',
|
||||
defaultValue: 'claude-sonnet-4-6',
|
||||
options: getModelOptions,
|
||||
},
|
||||
...getProviderCredentialSubBlocks(),
|
||||
|
||||
@@ -171,7 +171,7 @@ export const RouterBlock: BlockConfig<RouterResponse> = {
|
||||
type: 'combobox',
|
||||
placeholder: 'Type or select a model...',
|
||||
required: true,
|
||||
defaultValue: 'claude-sonnet-4-5',
|
||||
defaultValue: 'claude-sonnet-4-6',
|
||||
options: getModelOptions,
|
||||
},
|
||||
...getProviderCredentialSubBlocks(),
|
||||
@@ -298,7 +298,7 @@ export const RouterV2Block: BlockConfig<RouterV2Response> = {
|
||||
type: 'combobox',
|
||||
placeholder: 'Type or select a model...',
|
||||
required: true,
|
||||
defaultValue: 'claude-sonnet-4-5',
|
||||
defaultValue: 'claude-sonnet-4-6',
|
||||
options: getModelOptions,
|
||||
},
|
||||
...getProviderCredentialSubBlocks(),
|
||||
|
||||
@@ -190,7 +190,7 @@ export const HTTP = {
|
||||
} as const
|
||||
|
||||
export const AGENT = {
|
||||
DEFAULT_MODEL: 'claude-sonnet-4-5',
|
||||
DEFAULT_MODEL: 'claude-sonnet-4-6',
|
||||
get DEFAULT_FUNCTION_TIMEOUT() {
|
||||
return getMaxExecutionTimeout()
|
||||
},
|
||||
@@ -225,13 +225,13 @@ export const MEMORY = {
|
||||
} as const
|
||||
|
||||
export const ROUTER = {
|
||||
DEFAULT_MODEL: 'claude-sonnet-4-5',
|
||||
DEFAULT_MODEL: 'claude-sonnet-4-6',
|
||||
DEFAULT_TEMPERATURE: 0,
|
||||
INFERENCE_TEMPERATURE: 0.1,
|
||||
} as const
|
||||
|
||||
export const EVALUATOR = {
|
||||
DEFAULT_MODEL: 'claude-sonnet-4-5',
|
||||
DEFAULT_MODEL: 'claude-sonnet-4-6',
|
||||
DEFAULT_TEMPERATURE: 0.1,
|
||||
RESPONSE_SCHEMA_NAME: 'evaluation_response',
|
||||
JSON_INDENT: 2,
|
||||
|
||||
@@ -463,7 +463,7 @@ describe('EvaluatorBlockHandler', () => {
|
||||
json: () =>
|
||||
Promise.resolve({
|
||||
content: JSON.stringify({ score: 7 }),
|
||||
model: 'claude-sonnet-4-5',
|
||||
model: 'claude-sonnet-4-6',
|
||||
tokens: {},
|
||||
cost: 0,
|
||||
timing: {},
|
||||
@@ -476,6 +476,6 @@ describe('EvaluatorBlockHandler', () => {
|
||||
const fetchCallArgs = mockFetch.mock.calls[0]
|
||||
const requestBody = JSON.parse(fetchCallArgs[1].body)
|
||||
|
||||
expect(requestBody.model).toBe('claude-sonnet-4-5')
|
||||
expect(requestBody.model).toBe('claude-sonnet-4-6')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -220,12 +220,12 @@ describe('RouterBlockHandler', () => {
|
||||
|
||||
await handler.execute(mockContext, mockBlock, inputs)
|
||||
|
||||
expect(mockGetProviderFromModel).toHaveBeenCalledWith('claude-sonnet-4-5')
|
||||
expect(mockGetProviderFromModel).toHaveBeenCalledWith('claude-sonnet-4-6')
|
||||
|
||||
const fetchCallArgs = mockFetch.mock.calls[0]
|
||||
const requestBody = JSON.parse(fetchCallArgs[1].body)
|
||||
expect(requestBody).toMatchObject({
|
||||
model: 'claude-sonnet-4-5',
|
||||
model: 'claude-sonnet-4-6',
|
||||
temperature: 0.1,
|
||||
})
|
||||
})
|
||||
|
||||
+114
-107
@@ -117,25 +117,71 @@ export const PROVIDER_DEFINITIONS: Record<string, ProviderDefinition> = {
|
||||
id: 'openai',
|
||||
name: 'OpenAI',
|
||||
description: "OpenAI's models",
|
||||
defaultModel: 'gpt-4o',
|
||||
defaultModel: 'gpt-4.1',
|
||||
modelPatterns: [/^gpt/, /^o\d/, /^text-embedding/],
|
||||
icon: OpenAIIcon,
|
||||
capabilities: {
|
||||
toolUsageControl: true,
|
||||
},
|
||||
models: [
|
||||
// GPT-4.1 family
|
||||
{
|
||||
id: 'gpt-4o',
|
||||
id: 'gpt-4.1',
|
||||
pricing: {
|
||||
input: 2.5,
|
||||
cachedInput: 1.25,
|
||||
output: 10.0,
|
||||
input: 2.0,
|
||||
cachedInput: 0.5,
|
||||
output: 8.0,
|
||||
updatedAt: '2026-04-01',
|
||||
},
|
||||
capabilities: {
|
||||
temperature: { min: 0, max: 2 },
|
||||
maxOutputTokens: 32768,
|
||||
},
|
||||
contextWindow: 128000,
|
||||
contextWindow: 1047576,
|
||||
},
|
||||
{
|
||||
id: 'gpt-4.1-mini',
|
||||
pricing: {
|
||||
input: 0.4,
|
||||
cachedInput: 0.1,
|
||||
output: 1.6,
|
||||
updatedAt: '2026-04-01',
|
||||
},
|
||||
capabilities: {
|
||||
temperature: { min: 0, max: 2 },
|
||||
maxOutputTokens: 32768,
|
||||
},
|
||||
contextWindow: 1047576,
|
||||
},
|
||||
{
|
||||
id: 'gpt-4.1-nano',
|
||||
pricing: {
|
||||
input: 0.1,
|
||||
cachedInput: 0.025,
|
||||
output: 0.4,
|
||||
updatedAt: '2026-04-01',
|
||||
},
|
||||
capabilities: {
|
||||
temperature: { min: 0, max: 2 },
|
||||
maxOutputTokens: 32768,
|
||||
},
|
||||
contextWindow: 1047576,
|
||||
},
|
||||
// GPT-5.4 family
|
||||
{
|
||||
id: 'gpt-5.4-pro',
|
||||
pricing: {
|
||||
input: 30.0,
|
||||
output: 180.0,
|
||||
updatedAt: '2026-04-01',
|
||||
},
|
||||
capabilities: {
|
||||
reasoningEffort: {
|
||||
values: ['medium', 'high', 'xhigh'],
|
||||
},
|
||||
maxOutputTokens: 128000,
|
||||
},
|
||||
contextWindow: 1050000,
|
||||
},
|
||||
{
|
||||
id: 'gpt-5.4',
|
||||
@@ -156,51 +202,6 @@ export const PROVIDER_DEFINITIONS: Record<string, ProviderDefinition> = {
|
||||
},
|
||||
contextWindow: 1050000,
|
||||
},
|
||||
{
|
||||
id: 'gpt-5.4-pro',
|
||||
pricing: {
|
||||
input: 30.0,
|
||||
output: 180.0,
|
||||
updatedAt: '2026-04-01',
|
||||
},
|
||||
capabilities: {
|
||||
reasoningEffort: {
|
||||
values: ['medium', 'high', 'xhigh'],
|
||||
},
|
||||
maxOutputTokens: 128000,
|
||||
},
|
||||
contextWindow: 1050000,
|
||||
},
|
||||
{
|
||||
id: 'gpt-5.2-pro',
|
||||
pricing: {
|
||||
input: 21.0,
|
||||
output: 168.0,
|
||||
updatedAt: '2026-04-01',
|
||||
},
|
||||
capabilities: {
|
||||
reasoningEffort: {
|
||||
values: ['medium', 'high', 'xhigh'],
|
||||
},
|
||||
maxOutputTokens: 128000,
|
||||
},
|
||||
contextWindow: 400000,
|
||||
},
|
||||
{
|
||||
id: 'gpt-5-pro',
|
||||
pricing: {
|
||||
input: 15.0,
|
||||
output: 120.0,
|
||||
updatedAt: '2026-04-01',
|
||||
},
|
||||
capabilities: {
|
||||
reasoningEffort: {
|
||||
values: ['high'],
|
||||
},
|
||||
maxOutputTokens: 272000,
|
||||
},
|
||||
contextWindow: 400000,
|
||||
},
|
||||
{
|
||||
id: 'gpt-5.4-mini',
|
||||
pricing: {
|
||||
@@ -239,6 +240,22 @@ export const PROVIDER_DEFINITIONS: Record<string, ProviderDefinition> = {
|
||||
},
|
||||
contextWindow: 400000,
|
||||
},
|
||||
// GPT-5.2 family
|
||||
{
|
||||
id: 'gpt-5.2-pro',
|
||||
pricing: {
|
||||
input: 21.0,
|
||||
output: 168.0,
|
||||
updatedAt: '2026-04-01',
|
||||
},
|
||||
capabilities: {
|
||||
reasoningEffort: {
|
||||
values: ['medium', 'high', 'xhigh'],
|
||||
},
|
||||
maxOutputTokens: 128000,
|
||||
},
|
||||
contextWindow: 400000,
|
||||
},
|
||||
{
|
||||
id: 'gpt-5.2',
|
||||
pricing: {
|
||||
@@ -257,6 +274,7 @@ export const PROVIDER_DEFINITIONS: Record<string, ProviderDefinition> = {
|
||||
},
|
||||
contextWindow: 400000,
|
||||
},
|
||||
// GPT-5.1 family
|
||||
{
|
||||
id: 'gpt-5.1',
|
||||
pricing: {
|
||||
@@ -275,6 +293,22 @@ export const PROVIDER_DEFINITIONS: Record<string, ProviderDefinition> = {
|
||||
},
|
||||
contextWindow: 400000,
|
||||
},
|
||||
// GPT-5 family
|
||||
{
|
||||
id: 'gpt-5-pro',
|
||||
pricing: {
|
||||
input: 15.0,
|
||||
output: 120.0,
|
||||
updatedAt: '2026-04-01',
|
||||
},
|
||||
capabilities: {
|
||||
reasoningEffort: {
|
||||
values: ['high'],
|
||||
},
|
||||
maxOutputTokens: 272000,
|
||||
},
|
||||
contextWindow: 400000,
|
||||
},
|
||||
{
|
||||
id: 'gpt-5',
|
||||
pricing: {
|
||||
@@ -342,18 +376,32 @@ export const PROVIDER_DEFINITIONS: Record<string, ProviderDefinition> = {
|
||||
},
|
||||
contextWindow: 128000,
|
||||
},
|
||||
// o-series reasoning models
|
||||
{
|
||||
id: 'o1',
|
||||
id: 'o4-mini',
|
||||
pricing: {
|
||||
input: 15.0,
|
||||
cachedInput: 7.5,
|
||||
output: 60,
|
||||
input: 1.1,
|
||||
cachedInput: 0.275,
|
||||
output: 4.4,
|
||||
updatedAt: '2026-04-01',
|
||||
},
|
||||
capabilities: {
|
||||
reasoningEffort: {
|
||||
values: ['low', 'medium', 'high'],
|
||||
},
|
||||
maxOutputTokens: 100000,
|
||||
},
|
||||
contextWindow: 200000,
|
||||
},
|
||||
{
|
||||
id: 'o3-pro',
|
||||
pricing: {
|
||||
input: 20.0,
|
||||
output: 80.0,
|
||||
updatedAt: '2026-04-01',
|
||||
},
|
||||
capabilities: {
|
||||
maxOutputTokens: 100000,
|
||||
},
|
||||
contextWindow: 200000,
|
||||
},
|
||||
@@ -390,74 +438,33 @@ export const PROVIDER_DEFINITIONS: Record<string, ProviderDefinition> = {
|
||||
contextWindow: 200000,
|
||||
},
|
||||
{
|
||||
id: 'o3-pro',
|
||||
id: 'o1',
|
||||
pricing: {
|
||||
input: 20.0,
|
||||
output: 80.0,
|
||||
updatedAt: '2026-04-01',
|
||||
},
|
||||
capabilities: {
|
||||
maxOutputTokens: 100000,
|
||||
},
|
||||
contextWindow: 200000,
|
||||
},
|
||||
{
|
||||
id: 'o4-mini',
|
||||
pricing: {
|
||||
input: 1.1,
|
||||
cachedInput: 0.275,
|
||||
output: 4.4,
|
||||
input: 15.0,
|
||||
cachedInput: 7.5,
|
||||
output: 60,
|
||||
updatedAt: '2026-04-01',
|
||||
},
|
||||
capabilities: {
|
||||
reasoningEffort: {
|
||||
values: ['low', 'medium', 'high'],
|
||||
},
|
||||
maxOutputTokens: 100000,
|
||||
},
|
||||
contextWindow: 200000,
|
||||
},
|
||||
// Legacy
|
||||
{
|
||||
id: 'gpt-4.1',
|
||||
id: 'gpt-4o',
|
||||
pricing: {
|
||||
input: 2.0,
|
||||
cachedInput: 0.5,
|
||||
output: 8.0,
|
||||
input: 2.5,
|
||||
cachedInput: 1.25,
|
||||
output: 10.0,
|
||||
updatedAt: '2026-04-01',
|
||||
},
|
||||
capabilities: {
|
||||
temperature: { min: 0, max: 2 },
|
||||
maxOutputTokens: 32768,
|
||||
},
|
||||
contextWindow: 1047576,
|
||||
},
|
||||
{
|
||||
id: 'gpt-4.1-nano',
|
||||
pricing: {
|
||||
input: 0.1,
|
||||
cachedInput: 0.025,
|
||||
output: 0.4,
|
||||
updatedAt: '2026-04-01',
|
||||
},
|
||||
capabilities: {
|
||||
temperature: { min: 0, max: 2 },
|
||||
maxOutputTokens: 32768,
|
||||
},
|
||||
contextWindow: 1047576,
|
||||
},
|
||||
{
|
||||
id: 'gpt-4.1-mini',
|
||||
pricing: {
|
||||
input: 0.4,
|
||||
cachedInput: 0.1,
|
||||
output: 1.6,
|
||||
updatedAt: '2026-04-01',
|
||||
},
|
||||
capabilities: {
|
||||
temperature: { min: 0, max: 2 },
|
||||
maxOutputTokens: 32768,
|
||||
},
|
||||
contextWindow: 1047576,
|
||||
contextWindow: 128000,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -465,7 +472,7 @@ export const PROVIDER_DEFINITIONS: Record<string, ProviderDefinition> = {
|
||||
id: 'anthropic',
|
||||
name: 'Anthropic',
|
||||
description: "Anthropic's Claude models",
|
||||
defaultModel: 'claude-sonnet-4-5',
|
||||
defaultModel: 'claude-sonnet-4-6',
|
||||
modelPatterns: [/^claude/],
|
||||
icon: AnthropicIcon,
|
||||
capabilities: {
|
||||
|
||||
Reference in New Issue
Block a user