Skip to content

Commit 54926d7

Browse files
committed
remove memory params from models that don't support it in provider requests
1 parent 7c73a08 commit 54926d7

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

apps/sim/blocks/blocks/agent.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
MODELS_WITH_REASONING_EFFORT,
1515
MODELS_WITH_THINKING,
1616
MODELS_WITH_VERBOSITY,
17+
MODELS_WITHOUT_MEMORY,
1718
providers,
1819
supportsTemperature,
1920
} from '@/providers/utils'
@@ -444,7 +445,7 @@ Return ONLY the JSON array.`,
444445
defaultValue: 'none',
445446
condition: {
446447
field: 'model',
447-
value: MODELS_WITH_DEEP_RESEARCH,
448+
value: MODELS_WITHOUT_MEMORY,
448449
not: true,
449450
},
450451
},
@@ -460,7 +461,7 @@ Return ONLY the JSON array.`,
460461
condition: {
461462
field: 'memoryType',
462463
value: ['conversation', 'sliding_window', 'sliding_window_tokens'],
463-
and: { field: 'model', value: MODELS_WITH_DEEP_RESEARCH, not: true },
464+
and: { field: 'model', value: MODELS_WITHOUT_MEMORY, not: true },
464465
},
465466
},
466467
{
@@ -471,7 +472,7 @@ Return ONLY the JSON array.`,
471472
condition: {
472473
field: 'memoryType',
473474
value: ['sliding_window'],
474-
and: { field: 'model', value: MODELS_WITH_DEEP_RESEARCH, not: true },
475+
and: { field: 'model', value: MODELS_WITHOUT_MEMORY, not: true },
475476
},
476477
},
477478
{
@@ -482,7 +483,7 @@ Return ONLY the JSON array.`,
482483
condition: {
483484
field: 'memoryType',
484485
value: ['sliding_window_tokens'],
485-
and: { field: 'model', value: MODELS_WITH_DEEP_RESEARCH, not: true },
486+
and: { field: 'model', value: MODELS_WITHOUT_MEMORY, not: true },
486487
},
487488
},
488489
{

apps/sim/providers/models.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ export interface ModelCapabilities {
4747
default?: string
4848
}
4949
deepResearch?: boolean
50+
/** Whether this model supports conversation memory. Defaults to true if omitted. */
51+
memory?: boolean
5052
}
5153

5254
export interface ModelDefinition {
@@ -938,6 +940,7 @@ export const PROVIDER_DEFINITIONS: Record<string, ProviderDefinition> = {
938940
},
939941
capabilities: {
940942
deepResearch: true,
943+
memory: false,
941944
},
942945
contextWindow: 1000000,
943946
},
@@ -1060,6 +1063,7 @@ export const PROVIDER_DEFINITIONS: Record<string, ProviderDefinition> = {
10601063
},
10611064
capabilities: {
10621065
deepResearch: true,
1066+
memory: false,
10631067
},
10641068
contextWindow: 1000000,
10651069
},
@@ -2520,6 +2524,22 @@ export function getModelsWithDeepResearch(): string[] {
25202524
return models
25212525
}
25222526

2527+
/**
2528+
* Get all models that explicitly disable memory support (memory: false).
2529+
* Models without this capability default to supporting memory.
2530+
*/
2531+
export function getModelsWithoutMemory(): string[] {
2532+
const models: string[] = []
2533+
for (const provider of Object.values(PROVIDER_DEFINITIONS)) {
2534+
for (const model of provider.models) {
2535+
if (model.capabilities.memory === false) {
2536+
models.push(model.id)
2537+
}
2538+
}
2539+
}
2540+
return models
2541+
}
2542+
25232543
/**
25242544
* Get the max output tokens for a specific model.
25252545
*

apps/sim/providers/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
getMaxTemperature as getMaxTempFromDefinitions,
1414
getModelPricing as getModelPricingFromDefinitions,
1515
getModelsWithDeepResearch,
16+
getModelsWithoutMemory,
1617
getModelsWithReasoningEffort,
1718
getModelsWithTemperatureSupport,
1819
getModelsWithTempRange01,
@@ -955,6 +956,7 @@ export const MODELS_WITH_REASONING_EFFORT = getModelsWithReasoningEffort()
955956
export const MODELS_WITH_VERBOSITY = getModelsWithVerbosity()
956957
export const MODELS_WITH_THINKING = getModelsWithThinking()
957958
export const MODELS_WITH_DEEP_RESEARCH = getModelsWithDeepResearch()
959+
export const MODELS_WITHOUT_MEMORY = getModelsWithoutMemory()
958960
export const PROVIDERS_WITH_TOOL_USAGE_CONTROL = getProvidersWithToolUsageControl()
959961

960962
export function supportsTemperature(model: string): boolean {

0 commit comments

Comments
 (0)