Skip to content
56 changes: 54 additions & 2 deletions apps/sim/blocks/blocks/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
getReasoningEffortValuesForModel,
getThinkingLevelsForModel,
getVerbosityValuesForModel,
MODELS_WITH_DEEP_RESEARCH,
MODELS_WITH_REASONING_EFFORT,
MODELS_WITH_THINKING,
MODELS_WITH_VERBOSITY,
Expand Down Expand Up @@ -412,12 +413,22 @@ Return ONLY the JSON array.`,
title: 'Tools',
type: 'tool-input',
defaultValue: [],
condition: {
field: 'model',
value: MODELS_WITH_DEEP_RESEARCH,
not: true,
},
},
{
id: 'skills',
title: 'Skills',
type: 'skill-input',
defaultValue: [],
condition: {
field: 'model',
value: MODELS_WITH_DEEP_RESEARCH,
not: true,
},
},
{
id: 'memoryType',
Expand All @@ -431,6 +442,11 @@ Return ONLY the JSON array.`,
{ label: 'Sliding window (tokens)', id: 'sliding_window_tokens' },
],
defaultValue: 'none',
condition: {
field: 'model',
value: MODELS_WITH_DEEP_RESEARCH,
not: true,
},
Comment thread
waleedlatif1 marked this conversation as resolved.
},
{
id: 'conversationId',
Expand Down Expand Up @@ -477,9 +493,13 @@ Return ONLY the JSON array.`,
condition: () => ({
field: 'model',
value: (() => {
const deepResearch = new Set(MODELS_WITH_DEEP_RESEARCH.map((m) => m.toLowerCase()))
const allModels = Object.keys(getBaseModelProviders())
return allModels.filter(
(model) => supportsTemperature(model) && getMaxTemperature(model) === 1
(model) =>
supportsTemperature(model) &&
getMaxTemperature(model) === 1 &&
!deepResearch.has(model.toLowerCase())
)
})(),
}),
Expand All @@ -495,9 +515,13 @@ Return ONLY the JSON array.`,
condition: () => ({
field: 'model',
value: (() => {
const deepResearch = new Set(MODELS_WITH_DEEP_RESEARCH.map((m) => m.toLowerCase()))
const allModels = Object.keys(getBaseModelProviders())
return allModels.filter(
(model) => supportsTemperature(model) && getMaxTemperature(model) === 2
(model) =>
supportsTemperature(model) &&
getMaxTemperature(model) === 2 &&
!deepResearch.has(model.toLowerCase())
)
})(),
}),
Expand All @@ -508,13 +532,23 @@ Return ONLY the JSON array.`,
type: 'short-input',
placeholder: 'Enter max tokens (e.g., 4096)...',
mode: 'advanced',
condition: {
field: 'model',
value: MODELS_WITH_DEEP_RESEARCH,
not: true,
},
},
{
id: 'responseFormat',
title: 'Response Format',
type: 'code',
placeholder: 'Enter JSON schema...',
language: 'json',
condition: {
field: 'model',
value: MODELS_WITH_DEEP_RESEARCH,
not: true,
},
wandConfig: {
enabled: true,
maintainHistory: true,
Expand Down Expand Up @@ -607,6 +641,16 @@ Example 3 (Array Input):
generationType: 'json-schema',
},
},
{
id: 'previousInteractionId',
title: 'Previous Interaction ID',
type: 'short-input',
placeholder: 'e.g., {{agent_1.interactionId}}',
condition: {
field: 'model',
value: MODELS_WITH_DEEP_RESEARCH,
},
},
],
tools: {
access: [
Expand Down Expand Up @@ -770,5 +814,13 @@ Example 3 (Array Input):
description: 'Provider timing information',
},
cost: { type: 'json', description: 'Cost of the API call' },
interactionId: {
type: 'string',
description: 'Interaction ID for multi-turn deep research follow-ups',
condition: {
field: 'model',
value: MODELS_WITH_DEEP_RESEARCH,
},
},
},
}
2 changes: 2 additions & 0 deletions apps/sim/executor/handlers/agent/agent-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,7 @@ export class AgentBlockHandler implements BlockHandler {
reasoningEffort: inputs.reasoningEffort,
verbosity: inputs.verbosity,
thinkingLevel: inputs.thinkingLevel,
previousInteractionId: inputs.previousInteractionId,
Comment thread
waleedlatif1 marked this conversation as resolved.
}
}

Expand Down Expand Up @@ -1269,6 +1270,7 @@ export class AgentBlockHandler implements BlockHandler {
content: result.content,
model: result.model,
...this.createResponseMetadata(result),
...(result.interactionId && { interactionId: result.interactionId }),
}
}

Expand Down
2 changes: 2 additions & 0 deletions apps/sim/executor/handlers/agent/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export interface AgentInputs {
conversationId?: string // Required for all non-none memory types
slidingWindowSize?: string // For message-based sliding window
slidingWindowTokens?: string // For token-based sliding window
// Deep research multi-turn
previousInteractionId?: string // Interactions API previous interaction reference
// LLM parameters
temperature?: string
maxTokens?: string
Expand Down
Loading