Skip to content

Commit dacdbe3

Browse files
committed
improvement(media-gen): retire vision block, add hosted key for fal ai for image/video gen
1 parent c381550 commit dacdbe3

33 files changed

Lines changed: 817 additions & 111 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ Get the execution timeline for an Azure DevOps build — every stage, job, and t
280280
|`warningCount` | number | Number of warnings |
281281
|`startTime` | string | ISO 8601 start timestamp |
282282
|`finishTime` | string | ISO 8601 finish timestamp |
283-
|`failedRecords` | array | Subset of records where result === "failed" — use logId to fetch logs |
283+
|`failedRecords` | array | Subset of records where result is failed, partiallySucceeded, or succeededWithIssues — use logId to fetch logs |
284284
|`id` | string | Record GUID |
285285
|`name` | string | Step name |
286286
|`type` | string | Stage \| Phase \| Job \| Task |
@@ -333,7 +333,8 @@ Execute a WIQL query to search for work items in Azure DevOps and return full fi
333333
| --------- | ---- | ----------- |
334334
| `content` | string | Human-readable summary of matching work items |
335335
| `metadata` | object | Work items metadata |
336-
|`count` | number | Number of work items returned |
336+
|`count` | number | Number of work items returned \(after hydration\) |
337+
|`totalMatched` | number | Total number of work items matched by the WIQL query before hydration |
337338
|`workItems` | array | Array of work item details |
338339
|`id` | number | Work item ID |
339340
|`title` | string | Work item title |
@@ -372,15 +373,15 @@ Fetch full details of a single work item by ID from Azure DevOps, including titl
372373

373374
### `azure_devops_get_work_items_batch`
374375

375-
Fetch full details for multiple work items by ID from Azure DevOps in a single call. Pass comma-separated IDs (e.g.
376+
Fetch full details for multiple work items by ID from Azure DevOps. Pass comma-separated IDs (e.g.
376377

377378
#### Input
378379

379380
| Parameter | Type | Required | Description |
380381
| --------- | ---- | -------- | ----------- |
381382
| `organization` | string | Yes | Azure DevOps organization name |
382383
| `project` | string | Yes | Azure DevOps project name |
383-
| `ids` | string | Yes | Comma-separated work item IDs to fetch \(e.g. "123,456,789"\). Maximum 200 IDs. |
384+
| `ids` | string | Yes | Comma-separated work item IDs to fetch \(e.g. "123,456,789"\). Lists longer than 200 IDs are chunked automatically. |
384385

385386
#### Output
386387

@@ -389,6 +390,7 @@ Fetch full details for multiple work items by ID from Azure DevOps in a single c
389390
| `content` | string | Human-readable summary of the fetched work items |
390391
| `metadata` | object | Work items metadata |
391392
|`count` | number | Number of work items returned |
393+
|`totalRequested` | number | Total number of IDs requested \(across all chunks\) |
392394
|`workItems` | array | Array of work item details |
393395
|`id` | number | Work item ID |
394396
|`title` | string | Work item title |

apps/docs/content/docs/en/tools/meta.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@
195195
"upstash",
196196
"vercel",
197197
"video_generator",
198-
"vision",
199198
"wealthbox",
200199
"webflow",
201200
"whatsapp",

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

Lines changed: 0 additions & 60 deletions
This file was deleted.

apps/docs/content/docs/en/triggers/azure_devops.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Trigger workflow when an Azure DevOps build fails, is canceled, or partially suc
3131
| `branch` | string | Source branch name \(refs/heads/ prefix stripped\) |
3232
| `commitSha` | string | Source commit SHA |
3333
| `triggeredBy` | string | Display name of the person who triggered the build |
34-
| `triggeredByEmail` | string | Email/unique name of the person who triggered the build |
34+
| `triggeredByEmail` | string | Email/unique name of the person who triggered the build, or null if not set |
3535
| `startTime` | string | Build start time \(ISO 8601\) |
3636
| `finishTime` | string | Build finish time \(ISO 8601\) |
3737
| `buildUrl` | string | API URL for the build resource |
@@ -72,12 +72,12 @@ Trigger workflow when a work item is created in Azure DevOps
7272
| `workItemType` | string | Work item type for Basic process \(e.g. Issue, Task, Epic\) |
7373
| `title` | string | Work item title |
7474
| `state` | string | Work item state for Basic process \(e.g. To Do, Doing, Done\) |
75-
| `createdBy` | string | Display name of the creator |
76-
| `assignedTo` | string | Assignee display name, or empty string if unassigned |
75+
| `createdBy` | string | Display name of the creator, or null if not set |
76+
| `assignedTo` | string | Assignee display name, or null if unassigned |
7777
| `priority` | number | Priority \(1–4\), or 0 if not set |
7878
| `areaPath` | string | Area path |
7979
| `iterationPath` | string | Iteration path |
80-
| `description` | string | Work item description \(HTML\), or empty string if not set |
80+
| `description` | string | Work item description \(HTML\), or null if not set |
8181
| `projectName` | string | Azure DevOps project name |
8282
| `workItemUrl` | string | API URL for the work item resource |
8383

apps/sim/app/(landing)/integrations/data/icon-mapping.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ import {
5757
EvernoteIcon,
5858
ExaAIIcon,
5959
ExtendIcon,
60-
EyeIcon,
6160
FathomIcon,
6261
FindymailIcon,
6362
FirecrawlIcon,
@@ -405,7 +404,6 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
405404
upstash: UpstashIcon,
406405
vercel: VercelIcon,
407406
video_generator_v3: VideoIcon,
408-
vision_v2: EyeIcon,
409407
wealthbox: WealthboxIcon,
410408
webflow: WebflowIcon,
411409
whatsapp: WhatsAppIcon,

apps/sim/app/(landing)/integrations/data/integrations.json

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1938,7 +1938,7 @@
19381938
},
19391939
{
19401940
"name": "Get Work Items Batch",
1941-
"description": "Fetch full details for multiple work items by ID from Azure DevOps in a single call. Pass comma-separated IDs (e.g. "
1941+
"description": "Fetch full details for multiple work items by ID from Azure DevOps. Pass comma-separated IDs (e.g. "
19421942
},
19431943
{
19441944
"name": "Create Work Item",
@@ -4156,10 +4156,6 @@
41564156
"name": "Fetch",
41574157
"description": "Fetch and parse a file from a URL with optional custom headers."
41584158
},
4159-
{
4160-
"name": "Get",
4161-
"description": "Get a workspace file object from a selected file or canonical workspace file ID."
4162-
},
41634159
{
41644160
"name": "Write",
41654161
"description": "Create a new workspace file. If a file with the same name already exists, a numeric suffix is added (e.g., "
@@ -4169,7 +4165,7 @@
41694165
"description": "Append content to an existing workspace file. The file must already exist. Content is added to the end of the file."
41704166
}
41714167
],
4172-
"operationCount": 5,
4168+
"operationCount": 4,
41734169
"triggers": [],
41744170
"triggerCount": 0,
41754171
"authType": "none",
@@ -14253,24 +14249,6 @@
1425314249
"integrationTypes": ["ai", "design"],
1425414250
"tags": ["video-generation", "llm"]
1425514251
},
14256-
{
14257-
"type": "vision_v2",
14258-
"slug": "vision",
14259-
"name": "Vision",
14260-
"description": "Analyze images with vision models",
14261-
"longDescription": "Integrate Vision into the workflow. Can analyze images with vision models.",
14262-
"bgColor": "#4D5FFF",
14263-
"iconName": "EyeIcon",
14264-
"docsUrl": "https://docs.sim.ai/tools/vision",
14265-
"operations": [],
14266-
"operationCount": 0,
14267-
"triggers": [],
14268-
"triggerCount": 0,
14269-
"authType": "api-key",
14270-
"category": "tools",
14271-
"integrationTypes": ["ai", "documents"],
14272-
"tags": ["llm", "document-processing", "ocr"]
14273-
},
1427414252
{
1427514253
"type": "wealthbox",
1427614254
"slug": "wealthbox",

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
import { generateRequestId } from '@/lib/core/utils/request'
2424
import { getBaseUrl } from '@/lib/core/utils/urls'
2525
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
26+
import { type FalAICostMetadata, getFalAICostMetadata } from '@/lib/tools/falai-pricing'
2627

2728
const logger = createLogger('ImageProxyAPI')
2829

@@ -42,6 +43,7 @@ interface GeneratedImageResult {
4243
revisedPrompt?: string
4344
seed?: number
4445
jobId?: string
46+
falaiCost?: FalAICostMetadata
4547
}
4648

4749
interface StoredImageResponse {
@@ -61,6 +63,8 @@ interface StoredImageResponse {
6163
jobId?: string
6264
contentType: string
6365
}
66+
__falaiCostDollars?: number
67+
__falaiBilling?: FalAICostMetadata
6468
}
6569

6670
export const POST = withRouteHandler(async (request: NextRequest) => {
@@ -869,6 +873,13 @@ async function generateWithFalAI(
869873
revisedPrompt: getStringProperty(resultData, 'revised_prompt'),
870874
seed: getNumberProperty(resultData, 'seed'),
871875
jobId: falRequestId,
876+
falaiCost: body.useHostedCostTracking
877+
? await getFalAICostMetadata({
878+
apiKey,
879+
endpointId: modelConfig.endpoint,
880+
requestId: falRequestId,
881+
})
882+
: undefined,
872883
}
873884
}
874885

@@ -926,6 +937,8 @@ async function storeGeneratedImage(
926937
jobId: imageResult.jobId,
927938
contentType: imageResult.contentType,
928939
},
940+
__falaiCostDollars: imageResult.falaiCost?.costDollars,
941+
__falaiBilling: imageResult.falaiCost,
929942
}
930943
}
931944

@@ -958,5 +971,7 @@ async function storeGeneratedImage(
958971
jobId: imageResult.jobId,
959972
contentType: imageResult.contentType,
960973
},
974+
__falaiCostDollars: imageResult.falaiCost?.costDollars,
975+
__falaiBilling: imageResult.falaiCost,
961976
}
962977
}

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

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { getValidationErrorMessage, parseRequest, validationErrorResponse } from
88
import { checkInternalAuth } from '@/lib/auth/hybrid'
99
import { getMaxExecutionTimeout } from '@/lib/core/execution-limits'
1010
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
11+
import { type FalAICostMetadata, getFalAICostMetadata } from '@/lib/tools/falai-pricing'
1112
import { downloadFileFromStorage } from '@/lib/uploads/utils/file-utils.server'
1213
import { assertToolFileAccess } from '@/app/api/files/authorization'
1314
import type { UserFile } from '@/executor/types'
@@ -102,6 +103,7 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
102103
let height: number | undefined
103104
let jobId: string | undefined
104105
let actualDuration: number | undefined
106+
let falaiCost: FalAICostMetadata | undefined
105107

106108
if (body.visualReference) {
107109
const denied = await assertToolFileAccess(
@@ -200,6 +202,7 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
200202
resolution,
201203
body.promptOptimizer,
202204
body.generateAudio,
205+
body.useHostedCostTracking === true,
203206
requestId,
204207
logger
205208
)
@@ -208,6 +211,7 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
208211
height = result.height
209212
jobId = result.jobId
210213
actualDuration = result.duration
214+
falaiCost = result.falaiCost
211215
} else {
212216
return NextResponse.json({ error: `Unknown provider: ${provider}` }, { status: 400 })
213217
}
@@ -262,6 +266,8 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
262266
provider,
263267
model: model || 'default',
264268
jobId,
269+
__falaiCostDollars: falaiCost?.costDollars,
270+
__falaiBilling: falaiCost,
265271
})
266272
}
267273

@@ -294,6 +300,8 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
294300
provider,
295301
model: model || 'default',
296302
jobId,
303+
__falaiCostDollars: falaiCost?.costDollars,
304+
__falaiBilling: falaiCost,
297305
})
298306
} catch (error) {
299307
logger.error(`[${requestId}] Video proxy error:`, error)
@@ -1082,9 +1090,17 @@ async function generateWithFalAI(
10821090
resolution: string | undefined,
10831091
promptOptimizer: boolean | undefined,
10841092
generateAudio: boolean | undefined,
1093+
useHostedCostTracking: boolean,
10851094
requestId: string,
10861095
logger: ReturnType<typeof createLogger>
1087-
): Promise<{ buffer: Buffer; width: number; height: number; jobId: string; duration: number }> {
1096+
): Promise<{
1097+
buffer: Buffer
1098+
width: number
1099+
height: number
1100+
jobId: string
1101+
duration: number
1102+
falaiCost?: FalAICostMetadata
1103+
}> {
10881104
logger.info(`[${requestId}] Starting Fal.ai generation with model: ${model}`)
10891105

10901106
const modelConfig = FALAI_MODEL_CONFIGS[model]
@@ -1229,6 +1245,13 @@ async function generateWithFalAI(
12291245
height,
12301246
jobId: requestIdFal,
12311247
duration: getNumberProperty(videoOutput, 'duration') || duration || 5,
1248+
falaiCost: useHostedCostTracking
1249+
? await getFalAICostMetadata({
1250+
apiKey,
1251+
endpointId: modelConfig.endpoint,
1252+
requestId: requestIdFal,
1253+
})
1254+
: undefined,
12321255
}
12331256
}
12341257

apps/sim/app/workspace/[workspaceId]/settings/components/byok/byok.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
FireworksIcon,
2424
GeminiIcon,
2525
GoogleIcon,
26+
ImageIcon,
2627
JinaAIIcon,
2728
LinkupIcon,
2829
MistralIcon,
@@ -85,6 +86,13 @@ const PROVIDERS: {
8586
description: 'LLM calls',
8687
placeholder: 'Enter your Fireworks API key',
8788
},
89+
{
90+
id: 'falai',
91+
name: 'Fal.ai',
92+
icon: ImageIcon,
93+
description: 'Image and video generation',
94+
placeholder: 'Enter your Fal.ai API key',
95+
},
8896
{
8997
id: 'firecrawl',
9098
name: 'Firecrawl',

0 commit comments

Comments
 (0)