Skip to content

Commit 2354a05

Browse files
committed
fix(blocks): depends on misalignment
1 parent 1a76a22 commit 2354a05

38 files changed

Lines changed: 317 additions & 51 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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ Return ONLY the JSON array.`,
329329
value: MODELS_WITHOUT_MEMORY,
330330
not: true,
331331
},
332+
dependsOn: ['model'],
332333
},
333334
{
334335
id: 'conversationId',
@@ -344,6 +345,7 @@ Return ONLY the JSON array.`,
344345
value: ['conversation', 'sliding_window', 'sliding_window_tokens'],
345346
and: { field: 'model', value: MODELS_WITHOUT_MEMORY, not: true },
346347
},
348+
dependsOn: ['model', 'memoryType'],
347349
},
348350
{
349351
id: 'slidingWindowSize',
@@ -355,6 +357,7 @@ Return ONLY the JSON array.`,
355357
value: ['sliding_window'],
356358
and: { field: 'model', value: MODELS_WITHOUT_MEMORY, not: true },
357359
},
360+
dependsOn: ['model', 'memoryType'],
358361
},
359362
{
360363
id: 'slidingWindowTokens',
@@ -366,6 +369,7 @@ Return ONLY the JSON array.`,
366369
value: ['sliding_window_tokens'],
367370
and: { field: 'model', value: MODELS_WITHOUT_MEMORY, not: true },
368371
},
372+
dependsOn: ['model', 'memoryType'],
369373
},
370374
{
371375
id: 'temperature',
@@ -422,6 +426,7 @@ Return ONLY the JSON array.`,
422426
value: MODELS_WITH_DEEP_RESEARCH,
423427
not: true,
424428
},
429+
dependsOn: ['model'],
425430
},
426431
{
427432
id: 'responseFormat',
@@ -445,6 +450,7 @@ Return ONLY the JSON array.`,
445450
field: 'model',
446451
value: MODELS_WITH_DEEP_RESEARCH,
447452
},
453+
dependsOn: ['model'],
448454
},
449455
],
450456
tools: {

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/discord.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ export const DiscordBlock: BlockConfig<DiscordResponse> = {
197197
'discord_create_webhook',
198198
],
199199
},
200+
dependsOn: ['operation'],
200201
},
201202
// Name (optional for updates)
202203
{
@@ -208,6 +209,7 @@ export const DiscordBlock: BlockConfig<DiscordResponse> = {
208209
field: 'operation',
209210
value: ['discord_update_channel', 'discord_update_role'],
210211
},
212+
dependsOn: ['operation'],
211213
},
212214
// Role ID
213215
{

apps/sim/blocks/blocks/elasticsearch.ts

Lines changed: 11 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
@@ -158,6 +163,7 @@ export const ElasticsearchBlock: BlockConfig<ElasticsearchResponse> = {
158163
'elasticsearch_delete_document',
159164
],
160165
},
166+
dependsOn: ['operation'],
161167
},
162168

163169
// Optional Document ID - for index document
@@ -167,6 +173,7 @@ export const ElasticsearchBlock: BlockConfig<ElasticsearchResponse> = {
167173
type: 'short-input',
168174
placeholder: 'Leave empty for auto-generated ID',
169175
condition: { field: 'operation', value: 'elasticsearch_index_document' },
176+
dependsOn: ['operation'],
170177
},
171178

172179
// Document body - for index
@@ -177,6 +184,7 @@ export const ElasticsearchBlock: BlockConfig<ElasticsearchResponse> = {
177184
placeholder: '{ "field": "value", "another_field": 123 }',
178185
required: true,
179186
condition: { field: 'operation', value: 'elasticsearch_index_document' },
187+
dependsOn: ['operation'],
180188
wandConfig: {
181189
enabled: true,
182190
prompt: `Generate an Elasticsearch document JSON object based on the user's description.
@@ -197,6 +205,7 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`,
197205
placeholder: '{ "field_to_update": "new_value" }',
198206
required: true,
199207
condition: { field: 'operation', value: 'elasticsearch_update_document' },
208+
dependsOn: ['operation'],
200209
wandConfig: {
201210
enabled: true,
202211
prompt: `Generate an Elasticsearch partial document JSON for updating based on the user's description.
@@ -215,6 +224,7 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`,
215224
type: 'code',
216225
placeholder: '{ "match": { "field": "search term" } }',
217226
condition: { field: 'operation', value: 'elasticsearch_search' },
227+
dependsOn: ['operation'],
218228
wandConfig: {
219229
enabled: true,
220230
prompt: `Generate an Elasticsearch query DSL JSON based on the user's description.
@@ -237,6 +247,7 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`,
237247
type: 'code',
238248
placeholder: '{ "match": { "field": "value" } }',
239249
condition: { field: 'operation', value: 'elasticsearch_count' },
250+
dependsOn: ['operation'],
240251
wandConfig: {
241252
enabled: true,
242253
prompt: `Generate an Elasticsearch query DSL JSON for counting documents based on the user's description.

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

0 commit comments

Comments
 (0)