Skip to content

Commit 20ee07c

Browse files
improvement(blocks): depends on misalignments audit (#4409)
* fix(blocks): depends on misalignment * fix overclearing finds
1 parent 66bab93 commit 20ee07c

37 files changed

Lines changed: 314 additions & 54 deletions

apps/docs/content/docs/en/tools/stt.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Transcribe audio and video files to text using leading AI providers. Supports mu
120120
| --------- | ---- | -------- | ----------- |
121121
| `provider` | string | Yes | STT provider \(elevenlabs\) |
122122
| `apiKey` | string | Yes | ElevenLabs API key |
123-
| `model` | string | No | ElevenLabs model to use \(scribe_v1, scribe_v1_experimental\) |
123+
| `model` | string | No | ElevenLabs model to use \(scribe_v2\) |
124124
| `audioFile` | file | No | Audio or video file to transcribe \(e.g., MP3, WAV, M4A, WEBM\) |
125125
| `audioFileReference` | file | No | Reference to audio/video file from previous blocks |
126126
| `audioUrl` | string | No | URL to audio or video file |

apps/sim/app/api/tools/stt/route.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
import type { TranscriptSegment } from '@/tools/stt/types'
2121

2222
const logger = createLogger('SttProxyAPI')
23+
const ELEVENLABS_STT_MODEL = 'scribe_v2'
2324

2425
export const dynamic = 'force-dynamic'
2526
export const maxDuration = 300 // 5 minutes for large files
@@ -222,13 +223,7 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
222223
duration = result.duration
223224
confidence = result.confidence
224225
} else if (provider === 'elevenlabs') {
225-
const result = await transcribeWithElevenLabs(
226-
audioBuffer,
227-
apiKey,
228-
language,
229-
timestamps,
230-
model
231-
)
226+
const result = await transcribeWithElevenLabs(audioBuffer, apiKey, language, timestamps)
232227
transcript = result.transcript
233228
segments = result.segments
234229
detectedLanguage = result.language
@@ -470,8 +465,7 @@ async function transcribeWithElevenLabs(
470465
audioBuffer: Buffer,
471466
apiKey: string,
472467
language?: string,
473-
timestamps?: 'none' | 'sentence' | 'word',
474-
model?: string
468+
timestamps?: 'none' | 'sentence' | 'word'
475469
): Promise<{
476470
transcript: string
477471
segments?: TranscriptSegment[]
@@ -481,7 +475,7 @@ async function transcribeWithElevenLabs(
481475
const formData = new FormData()
482476
const blob = new Blob([new Uint8Array(audioBuffer)], { type: 'audio/mpeg' })
483477
formData.append('file', blob, 'audio.mp3')
484-
formData.append('model_id', model || 'scribe_v1')
478+
formData.append('model_id', ELEVENLABS_STT_MODEL)
485479

486480
if (language && language !== 'auto') {
487481
formData.append('language_code', language)

apps/sim/blocks/blocks/agent.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ Return ONLY the JSON array.`,
344344
value: ['conversation', 'sliding_window', 'sliding_window_tokens'],
345345
and: { field: 'model', value: MODELS_WITHOUT_MEMORY, not: true },
346346
},
347+
dependsOn: ['memoryType'],
347348
},
348349
{
349350
id: 'slidingWindowSize',
@@ -355,6 +356,7 @@ Return ONLY the JSON array.`,
355356
value: ['sliding_window'],
356357
and: { field: 'model', value: MODELS_WITHOUT_MEMORY, not: true },
357358
},
359+
dependsOn: ['memoryType'],
358360
},
359361
{
360362
id: 'slidingWindowTokens',
@@ -366,6 +368,7 @@ Return ONLY the JSON array.`,
366368
value: ['sliding_window_tokens'],
367369
and: { field: 'model', value: MODELS_WITHOUT_MEMORY, not: true },
368370
},
371+
dependsOn: ['memoryType'],
369372
},
370373
{
371374
id: 'temperature',

apps/sim/blocks/blocks/airtable.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export const AirtableBlock: BlockConfig<AirtableResponse> = {
7474
type: 'short-input',
7575
canonicalParamId: 'baseId',
7676
placeholder: 'Enter your base ID (e.g., appXXXXXXXXXXXXXX)',
77+
dependsOn: ['credential'],
7778
mode: 'advanced',
7879
condition: { field: 'operation', value: 'listBases', not: true },
7980
required: { field: 'operation', value: 'listBases', not: true },

apps/sim/blocks/blocks/asana.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export const AsanaBlock: BlockConfig<AsanaResponse> = {
7474
canonicalParamId: 'workspace',
7575
required: true,
7676
placeholder: 'Enter Asana workspace GID',
77+
dependsOn: ['credential'],
7778
mode: 'advanced',
7879
condition: {
7980
field: 'operation',
@@ -123,6 +124,7 @@ export const AsanaBlock: BlockConfig<AsanaResponse> = {
123124
type: 'short-input',
124125
canonicalParamId: 'getTasks_workspace',
125126
placeholder: 'Enter workspace GID',
127+
dependsOn: ['credential'],
126128
mode: 'advanced',
127129
condition: {
128130
field: 'operation',

apps/sim/blocks/blocks/elasticsearch.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export const ElasticsearchBlock: BlockConfig<ElasticsearchResponse> = {
6363
placeholder: 'https://localhost:9200',
6464
required: true,
6565
condition: { field: 'deploymentType', value: 'self_hosted' },
66+
dependsOn: ['deploymentType'],
6667
},
6768

6869
// Cloud ID
@@ -73,6 +74,7 @@ export const ElasticsearchBlock: BlockConfig<ElasticsearchResponse> = {
7374
placeholder: 'deployment-name:base64-encoded-data',
7475
required: true,
7576
condition: { field: 'deploymentType', value: 'cloud' },
77+
dependsOn: ['deploymentType'],
7678
},
7779

7880
// Authentication method
@@ -96,6 +98,7 @@ export const ElasticsearchBlock: BlockConfig<ElasticsearchResponse> = {
9698
password: true,
9799
required: true,
98100
condition: { field: 'authMethod', value: 'api_key' },
101+
dependsOn: ['authMethod'],
99102
},
100103

101104
// Username
@@ -106,6 +109,7 @@ export const ElasticsearchBlock: BlockConfig<ElasticsearchResponse> = {
106109
placeholder: 'Enter username',
107110
required: true,
108111
condition: { field: 'authMethod', value: 'basic_auth' },
112+
dependsOn: ['authMethod'],
109113
},
110114

111115
// Password
@@ -117,6 +121,7 @@ export const ElasticsearchBlock: BlockConfig<ElasticsearchResponse> = {
117121
password: true,
118122
required: true,
119123
condition: { field: 'authMethod', value: 'basic_auth' },
124+
dependsOn: ['authMethod'],
120125
},
121126

122127
// Index name - for most operations

apps/sim/blocks/blocks/gmail.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ Return ONLY the email body - no explanations, no extra text.`,
251251
type: 'short-input',
252252
canonicalParamId: 'folder',
253253
placeholder: 'Enter Gmail label name (e.g., INBOX, SENT, or custom label)',
254+
dependsOn: ['credential'],
254255
mode: 'advanced',
255256
condition: { field: 'operation', value: 'read_gmail' },
256257
},
@@ -333,6 +334,7 @@ Return ONLY the search query - no explanations, no extra text.`,
333334
type: 'short-input',
334335
canonicalParamId: 'addLabelIds',
335336
placeholder: 'Enter label ID (e.g., INBOX, Label_123)',
337+
dependsOn: ['credential'],
336338
mode: 'advanced',
337339
condition: { field: 'operation', value: 'move_gmail' },
338340
required: true,
@@ -359,6 +361,7 @@ Return ONLY the search query - no explanations, no extra text.`,
359361
type: 'short-input',
360362
canonicalParamId: 'removeLabelIds',
361363
placeholder: 'Enter label ID to remove (e.g., INBOX)',
364+
dependsOn: ['credential'],
362365
mode: 'advanced',
363366
condition: { field: 'operation', value: 'move_gmail' },
364367
required: false,
@@ -412,6 +415,7 @@ Return ONLY the search query - no explanations, no extra text.`,
412415
type: 'short-input',
413416
canonicalParamId: 'manageLabelId',
414417
placeholder: 'Enter label ID (e.g., INBOX, Label_123)',
418+
dependsOn: ['credential'],
415419
mode: 'advanced',
416420
condition: { field: 'operation', value: ['add_label_gmail', 'remove_label_gmail'] },
417421
required: true,

apps/sim/blocks/blocks/google_calendar.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export const GoogleCalendarBlock: BlockConfig<GoogleCalendarResponse> = {
8181
type: 'short-input',
8282
canonicalParamId: 'calendarId',
8383
placeholder: 'Enter calendar ID (e.g., primary or calendar@gmail.com)',
84+
dependsOn: ['credential'],
8485
mode: 'advanced',
8586
condition: { field: 'operation', value: 'list_calendars', not: true },
8687
},
@@ -347,6 +348,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
347348
type: 'short-input',
348349
canonicalParamId: 'destinationCalendarId',
349350
placeholder: 'destination@group.calendar.google.com',
351+
dependsOn: ['credential'],
350352
condition: { field: 'operation', value: 'move' },
351353
required: true,
352354
mode: 'advanced',

apps/sim/blocks/blocks/google_maps.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ export const GoogleMapsBlock: BlockConfig = {
411411
config: {
412412
tool: (params) => `google_maps_${params.operation}`,
413413
params: (params) => {
414-
const { operation, locationBias, ...rest } = params
414+
const { operation, locationBias, addressToValidate, ...rest } = params
415415

416416
let location: { lat: number; lng: number } | undefined
417417
if (locationBias && typeof locationBias === 'string' && locationBias.includes(',')) {
@@ -486,7 +486,7 @@ export const GoogleMapsBlock: BlockConfig = {
486486
}
487487
}
488488

489-
const address = params.addressToValidate || params.address
489+
const address = operation === 'validate_address' ? addressToValidate : params.address
490490

491491
// Parse boolean switches (can come as string or boolean from form)
492492
let interpolate: boolean | undefined

apps/sim/blocks/blocks/google_sheets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ export const GoogleSheetsV2Block: BlockConfig<GoogleSheetsV2Response> = {
401401
canonicalParamId: 'sheetName',
402402
placeholder: 'Name of the sheet/tab (e.g., Sheet1)',
403403
required: true,
404-
dependsOn: ['credential'],
404+
dependsOn: { all: ['credential'], any: ['spreadsheetId', 'manualSpreadsheetId'] },
405405
mode: 'advanced',
406406
condition: { field: 'operation', value: ['read', 'write', 'update', 'append', 'clear'] },
407407
},

0 commit comments

Comments
 (0)