feat(models): added claude sonnet 4 and opus 4

This commit is contained in:
Waleed Latif
2025-05-22 10:06:45 -07:00
parent 328d361a70
commit 5664890065
6 changed files with 41 additions and 9 deletions

View File

@@ -140,8 +140,10 @@ export const AgentBlock: BlockConfig<AgentResponse> = {
'o4-mini',
'gpt-4.1',
// Claude models
'claude-3-5-sonnet-20240620',
'claude-sonnet-4-20250514',
'claude-opus-4-20250514',
'claude-3-7-sonnet-20250219',
'claude-3-5-sonnet-20240620',
],
not: true, // Show for all models EXCEPT those listed
}
@@ -237,10 +239,11 @@ export const AgentBlock: BlockConfig<AgentResponse> = {
context: { type: 'string', required: false },
model: { type: 'string', required: true },
apiKey: { type: 'string', required: true },
messages: {
type: 'json',
messages: {
type: 'json',
required: false,
description: 'Array of message objects with role and content fields for advanced chat history control.'
description:
'Array of message objects with role and content fields for advanced chat history control.',
},
responseFormat: {
type: 'json',

View File

@@ -36,8 +36,13 @@ export const anthropicProvider: ProviderConfig = {
name: 'Anthropic',
description: "Anthropic's Claude models",
version: '1.0.0',
models: ['claude-3-5-sonnet-20240620', 'claude-3-7-sonnet-20250219'],
defaultModel: 'claude-3-7-sonnet-20250219',
models: [
'claude-sonnet-4-20250514',
'claude-opus-4-20250514',
'claude-3-7-sonnet-20250219',
'claude-3-5-sonnet-20240620',
],
defaultModel: 'claude-sonnet-4-20250514',
executeRequest: async (
request: ProviderRequest

View File

@@ -28,6 +28,9 @@ describe('supportsTemperature', () => {
const supportedModels = [
'gpt-4o',
'gemini-2.5-flash-preview-04-17',
'claude-sonnet-4-20250514',
'claude-opus-4-20250514',
'claude-3-7-sonnet-20250219',
'claude-3-5-sonnet-20240620',
`grok-3-latest`,
`grok-3-fast-latest`,
@@ -58,8 +61,10 @@ describe('getMaxTemperature', () => {
it('should return 1 for models with temperature range 0-1', () => {
const models = [
'claude-3-5-sonnet-20240620',
'claude-sonnet-4-20250514',
'claude-opus-4-20250514',
'claude-3-7-sonnet-20250219',
'claude-3-5-sonnet-20240620',
'grok-3-latest',
'grok-3-fast-latest',
]

View File

@@ -17,8 +17,10 @@ export const MODELS_TEMP_RANGE_0_2 = [
// Models that support temperature with range 0-1
export const MODELS_TEMP_RANGE_0_1 = [
// Anthropic models
'claude-3-5-sonnet-20240620',
'claude-sonnet-4-20250514',
'claude-opus-4-20250514',
'claude-3-7-sonnet-20250219',
'claude-3-5-sonnet-20240620',
// xAI models
'grok-3-latest',
'grok-3-fast-latest',

View File

@@ -52,6 +52,18 @@ const modelPricing: ModelPricingMap = {
output: 15.0,
updatedAt: '2025-03-21',
},
'claude-sonnet-4-20250514': {
input: 3.0,
cachedInput: 1.5,
output: 15.0,
updatedAt: '2025-05-22',
},
'claude-opus-4-20250514': {
input: 15.0,
cachedInput: 7.5,
output: 75.0,
updatedAt: '2025-05-22',
},
// Google Models
'gemini-2.5-pro-exp-03-25': {

View File

@@ -34,7 +34,12 @@ export const providers: Record<
},
anthropic: {
...anthropicProvider,
models: ['claude-3-5-sonnet-20240620', 'claude-3-7-sonnet-20250219'],
models: [
'claude-sonnet-4-20250514',
'claude-opus-4-20250514',
'claude-3-7-sonnet-20250219',
'claude-3-5-sonnet-20240620',
],
computerUseModels: ['claude-3-5-sonnet-20240620', 'claude-3-7-sonnet-20250219'],
modelPatterns: [/^claude/],
},