Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/docs/content/docs/en/tools/stt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Transcribe audio and video files to text using leading AI providers. Supports mu
| --------- | ---- | -------- | ----------- |
| `provider` | string | Yes | STT provider \(elevenlabs\) |
| `apiKey` | string | Yes | ElevenLabs API key |
| `model` | string | No | ElevenLabs model to use \(scribe_v1, scribe_v1_experimental\) |
| `model` | string | No | ElevenLabs model to use \(scribe_v2\) |
| `audioFile` | file | No | Audio or video file to transcribe \(e.g., MP3, WAV, M4A, WEBM\) |
| `audioFileReference` | file | No | Reference to audio/video file from previous blocks |
| `audioUrl` | string | No | URL to audio or video file |
Expand Down
14 changes: 4 additions & 10 deletions apps/sim/app/api/tools/stt/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
import type { TranscriptSegment } from '@/tools/stt/types'

const logger = createLogger('SttProxyAPI')
const ELEVENLABS_STT_MODEL = 'scribe_v2'

export const dynamic = 'force-dynamic'
export const maxDuration = 300 // 5 minutes for large files
Expand Down Expand Up @@ -222,13 +223,7 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
duration = result.duration
confidence = result.confidence
} else if (provider === 'elevenlabs') {
const result = await transcribeWithElevenLabs(
audioBuffer,
apiKey,
language,
timestamps,
model
)
const result = await transcribeWithElevenLabs(audioBuffer, apiKey, language, timestamps)
transcript = result.transcript
segments = result.segments
detectedLanguage = result.language
Expand Down Expand Up @@ -470,8 +465,7 @@ async function transcribeWithElevenLabs(
audioBuffer: Buffer,
apiKey: string,
language?: string,
timestamps?: 'none' | 'sentence' | 'word',
model?: string
timestamps?: 'none' | 'sentence' | 'word'
): Promise<{
transcript: string
segments?: TranscriptSegment[]
Expand All @@ -481,7 +475,7 @@ async function transcribeWithElevenLabs(
const formData = new FormData()
const blob = new Blob([new Uint8Array(audioBuffer)], { type: 'audio/mpeg' })
formData.append('file', blob, 'audio.mp3')
formData.append('model_id', model || 'scribe_v1')
formData.append('model_id', ELEVENLABS_STT_MODEL)

if (language && language !== 'auto') {
formData.append('language_code', language)
Expand Down
3 changes: 3 additions & 0 deletions apps/sim/blocks/blocks/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ Return ONLY the JSON array.`,
value: ['conversation', 'sliding_window', 'sliding_window_tokens'],
and: { field: 'model', value: MODELS_WITHOUT_MEMORY, not: true },
},
dependsOn: ['memoryType'],
},
{
id: 'slidingWindowSize',
Expand All @@ -355,6 +356,7 @@ Return ONLY the JSON array.`,
value: ['sliding_window'],
and: { field: 'model', value: MODELS_WITHOUT_MEMORY, not: true },
},
dependsOn: ['memoryType'],
},
{
id: 'slidingWindowTokens',
Expand All @@ -366,6 +368,7 @@ Return ONLY the JSON array.`,
value: ['sliding_window_tokens'],
and: { field: 'model', value: MODELS_WITHOUT_MEMORY, not: true },
},
dependsOn: ['memoryType'],
},
{
id: 'temperature',
Expand Down
1 change: 1 addition & 0 deletions apps/sim/blocks/blocks/airtable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const AirtableBlock: BlockConfig<AirtableResponse> = {
type: 'short-input',
canonicalParamId: 'baseId',
placeholder: 'Enter your base ID (e.g., appXXXXXXXXXXXXXX)',
dependsOn: ['credential'],
mode: 'advanced',
condition: { field: 'operation', value: 'listBases', not: true },
required: { field: 'operation', value: 'listBases', not: true },
Expand Down
2 changes: 2 additions & 0 deletions apps/sim/blocks/blocks/asana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const AsanaBlock: BlockConfig<AsanaResponse> = {
canonicalParamId: 'workspace',
required: true,
placeholder: 'Enter Asana workspace GID',
dependsOn: ['credential'],
mode: 'advanced',
condition: {
field: 'operation',
Expand Down Expand Up @@ -123,6 +124,7 @@ export const AsanaBlock: BlockConfig<AsanaResponse> = {
type: 'short-input',
canonicalParamId: 'getTasks_workspace',
placeholder: 'Enter workspace GID',
dependsOn: ['credential'],
mode: 'advanced',
condition: {
field: 'operation',
Expand Down
5 changes: 5 additions & 0 deletions apps/sim/blocks/blocks/elasticsearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const ElasticsearchBlock: BlockConfig<ElasticsearchResponse> = {
placeholder: 'https://localhost:9200',
required: true,
condition: { field: 'deploymentType', value: 'self_hosted' },
dependsOn: ['deploymentType'],
},

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

// Authentication method
Expand All @@ -96,6 +98,7 @@ export const ElasticsearchBlock: BlockConfig<ElasticsearchResponse> = {
password: true,
required: true,
condition: { field: 'authMethod', value: 'api_key' },
dependsOn: ['authMethod'],
},

// Username
Expand All @@ -106,6 +109,7 @@ export const ElasticsearchBlock: BlockConfig<ElasticsearchResponse> = {
placeholder: 'Enter username',
required: true,
condition: { field: 'authMethod', value: 'basic_auth' },
dependsOn: ['authMethod'],
},

// Password
Expand All @@ -117,6 +121,7 @@ export const ElasticsearchBlock: BlockConfig<ElasticsearchResponse> = {
password: true,
required: true,
condition: { field: 'authMethod', value: 'basic_auth' },
dependsOn: ['authMethod'],
},

// Index name - for most operations
Expand Down
4 changes: 4 additions & 0 deletions apps/sim/blocks/blocks/gmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ Return ONLY the email body - no explanations, no extra text.`,
type: 'short-input',
canonicalParamId: 'folder',
placeholder: 'Enter Gmail label name (e.g., INBOX, SENT, or custom label)',
dependsOn: ['credential'],
mode: 'advanced',
condition: { field: 'operation', value: 'read_gmail' },
},
Expand Down Expand Up @@ -333,6 +334,7 @@ Return ONLY the search query - no explanations, no extra text.`,
type: 'short-input',
canonicalParamId: 'addLabelIds',
placeholder: 'Enter label ID (e.g., INBOX, Label_123)',
dependsOn: ['credential'],
mode: 'advanced',
condition: { field: 'operation', value: 'move_gmail' },
required: true,
Expand All @@ -359,6 +361,7 @@ Return ONLY the search query - no explanations, no extra text.`,
type: 'short-input',
canonicalParamId: 'removeLabelIds',
placeholder: 'Enter label ID to remove (e.g., INBOX)',
dependsOn: ['credential'],
mode: 'advanced',
condition: { field: 'operation', value: 'move_gmail' },
required: false,
Expand Down Expand Up @@ -412,6 +415,7 @@ Return ONLY the search query - no explanations, no extra text.`,
type: 'short-input',
canonicalParamId: 'manageLabelId',
placeholder: 'Enter label ID (e.g., INBOX, Label_123)',
dependsOn: ['credential'],
mode: 'advanced',
condition: { field: 'operation', value: ['add_label_gmail', 'remove_label_gmail'] },
required: true,
Expand Down
2 changes: 2 additions & 0 deletions apps/sim/blocks/blocks/google_calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const GoogleCalendarBlock: BlockConfig<GoogleCalendarResponse> = {
type: 'short-input',
canonicalParamId: 'calendarId',
placeholder: 'Enter calendar ID (e.g., primary or calendar@gmail.com)',
dependsOn: ['credential'],
mode: 'advanced',
condition: { field: 'operation', value: 'list_calendars', not: true },
},
Expand Down Expand Up @@ -347,6 +348,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
type: 'short-input',
canonicalParamId: 'destinationCalendarId',
placeholder: 'destination@group.calendar.google.com',
dependsOn: ['credential'],
condition: { field: 'operation', value: 'move' },
required: true,
mode: 'advanced',
Expand Down
4 changes: 2 additions & 2 deletions apps/sim/blocks/blocks/google_maps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ export const GoogleMapsBlock: BlockConfig = {
config: {
tool: (params) => `google_maps_${params.operation}`,
params: (params) => {
const { operation, locationBias, ...rest } = params
const { operation, locationBias, addressToValidate, ...rest } = params

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

const address = params.addressToValidate || params.address
const address = operation === 'validate_address' ? addressToValidate : params.address

// Parse boolean switches (can come as string or boolean from form)
let interpolate: boolean | undefined
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/blocks/blocks/google_sheets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ export const GoogleSheetsV2Block: BlockConfig<GoogleSheetsV2Response> = {
canonicalParamId: 'sheetName',
placeholder: 'Name of the sheet/tab (e.g., Sheet1)',
required: true,
dependsOn: ['credential'],
dependsOn: { all: ['credential'], any: ['spreadsheetId', 'manualSpreadsheetId'] },
mode: 'advanced',
condition: { field: 'operation', value: ['read', 'write', 'update', 'append', 'clear'] },
},
Expand Down
9 changes: 9 additions & 0 deletions apps/sim/blocks/blocks/guardrails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const GuardrailsBlock: BlockConfig<GuardrailsResponse> = {
field: 'validationType',
value: ['regex'],
},
dependsOn: ['validationType'],
wandConfig: {
enabled: true,
prompt: `Generate a regular expression pattern based on the user's description.
Expand Down Expand Up @@ -106,6 +107,7 @@ Return ONLY the regex pattern - no explanations, no quotes, no forward slashes,
field: 'validationType',
value: ['hallucination'],
},
dependsOn: ['validationType'],
},
{
id: 'model',
Expand All @@ -118,6 +120,7 @@ Return ONLY the regex pattern - no explanations, no quotes, no forward slashes,
field: 'validationType',
value: ['hallucination'],
},
dependsOn: ['validationType'],
},
{
id: 'threshold',
Expand All @@ -131,6 +134,7 @@ Return ONLY the regex pattern - no explanations, no quotes, no forward slashes,
field: 'validationType',
value: ['hallucination'],
},
dependsOn: ['validationType'],
},
{
id: 'topK',
Expand All @@ -145,6 +149,7 @@ Return ONLY the regex pattern - no explanations, no quotes, no forward slashes,
field: 'validationType',
value: ['hallucination'],
},
dependsOn: ['validationType'],
},
// Provider credential subblocks - only shown for hallucination validation
...getProviderCredentialSubBlocks().map((subBlock) => ({
Expand All @@ -158,6 +163,7 @@ Return ONLY the regex pattern - no explanations, no quotes, no forward slashes,
typeof subBlock.condition === 'function' ? subBlock.condition() : subBlock.condition,
}
: { field: 'validationType' as const, value: ['hallucination'] },
dependsOn: ['validationType'],
})),
{
id: 'piiEntityTypes',
Expand Down Expand Up @@ -227,6 +233,7 @@ Return ONLY the regex pattern - no explanations, no quotes, no forward slashes,
field: 'validationType',
value: ['pii'],
},
dependsOn: ['validationType'],
},
{
id: 'piiMode',
Expand All @@ -242,6 +249,7 @@ Return ONLY the regex pattern - no explanations, no quotes, no forward slashes,
field: 'validationType',
value: ['pii'],
},
dependsOn: ['validationType'],
},
{
id: 'piiLanguage',
Expand All @@ -259,6 +267,7 @@ Return ONLY the regex pattern - no explanations, no quotes, no forward slashes,
field: 'validationType',
value: ['pii'],
},
dependsOn: ['validationType'],
},
],
tools: {
Expand Down
1 change: 1 addition & 0 deletions apps/sim/blocks/blocks/huggingface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const HuggingFaceBlock: BlockConfig<HuggingFaceChatResponse> = {
placeholder:
'e.g., deepseek/deepseek-v3-0324, llama3.1-8b, meta-llama/Llama-3.2-3B-Instruct-Turbo',
description: 'The model must be available for the selected provider.',
dependsOn: ['provider'],
},
{
id: 'temperature',
Expand Down
16 changes: 11 additions & 5 deletions apps/sim/blocks/blocks/image_generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const ImageGeneratorBlock: BlockConfig<DalleResponse> = {
],
value: () => '1024x1024',
condition: { field: 'model', value: 'dall-e-3' },
dependsOn: ['model'],
},
{
id: 'size',
Expand All @@ -57,6 +58,7 @@ export const ImageGeneratorBlock: BlockConfig<DalleResponse> = {
],
value: () => 'auto',
condition: { field: 'model', value: 'gpt-image-1' },
dependsOn: ['model'],
},
{
id: 'quality',
Expand All @@ -68,6 +70,7 @@ export const ImageGeneratorBlock: BlockConfig<DalleResponse> = {
],
value: () => 'standard',
condition: { field: 'model', value: 'dall-e-3' },
dependsOn: ['model'],
},
{
id: 'style',
Expand All @@ -79,6 +82,7 @@ export const ImageGeneratorBlock: BlockConfig<DalleResponse> = {
],
value: () => 'vivid',
condition: { field: 'model', value: 'dall-e-3' },
dependsOn: ['model'],
},
{
id: 'background',
Expand All @@ -91,6 +95,7 @@ export const ImageGeneratorBlock: BlockConfig<DalleResponse> = {
],
value: () => 'auto',
condition: { field: 'model', value: 'gpt-image-1' },
dependsOn: ['model'],
},
{
id: 'apiKey',
Expand All @@ -114,22 +119,23 @@ export const ImageGeneratorBlock: BlockConfig<DalleResponse> = {
throw new Error('Prompt is required')
}

// Base parameters for all models
const model = params.model || 'dall-e-3'
const size = params.size || (model === 'gpt-image-1' ? 'auto' : '1024x1024')
const baseParams = {
prompt: params.prompt,
model: params.model || 'dall-e-3',
size: params.size || '1024x1024',
model,
size,
apiKey: params.apiKey,
}

if (params.model === 'dall-e-3') {
if (model === 'dall-e-3') {
return {
...baseParams,
quality: params.quality || 'standard',
style: params.style || 'vivid',
}
}
if (params.model === 'gpt-image-1') {
if (model === 'gpt-image-1') {
return {
...baseParams,
...(params.background && { background: params.background }),
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/blocks/blocks/jira.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export const JiraBlock: BlockConfig<JiraResponse> = {
type: 'short-input',
canonicalParamId: 'issueKey',
placeholder: 'Enter Jira issue key',
dependsOn: ['credential', 'domain'],
dependsOn: ['credential', 'domain', 'projectId'],
condition: {
field: 'operation',
value: [
Expand Down
2 changes: 2 additions & 0 deletions apps/sim/blocks/blocks/jira_service_management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export const JiraServiceManagementBlock: BlockConfig<JsmResponse> = {
type: 'short-input',
canonicalParamId: 'serviceDeskId',
placeholder: 'Enter service desk ID',
dependsOn: ['credential', 'domain'],
mode: 'advanced',
required: {
field: 'operation',
Expand Down Expand Up @@ -181,6 +182,7 @@ export const JiraServiceManagementBlock: BlockConfig<JsmResponse> = {
canonicalParamId: 'requestTypeId',
required: true,
placeholder: 'Enter request type ID',
dependsOn: ['credential', 'domain', 'serviceDeskId'],
mode: 'advanced',
condition: { field: 'operation', value: ['create_request', 'get_request_type_fields'] },
},
Expand Down
1 change: 1 addition & 0 deletions apps/sim/blocks/blocks/knowledge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ export const KnowledgeBlock: BlockConfig = {
type: 'short-input',
canonicalParamId: 'documentId',
placeholder: 'Enter document ID',
dependsOn: ['knowledgeBaseId'],
required: true,
mode: 'advanced',
condition: {
Expand Down
Loading
Loading