Skip to content

Commit 2cccfdd

Browse files
author
Theodore Li
committed
Address feedback
1 parent 8829ac3 commit 2cccfdd

File tree

11 files changed

+17
-22
lines changed

11 files changed

+17
-22
lines changed

apps/sim/app/api/workspaces/[id]/byok-keys/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ const VALID_PROVIDERS = [
1919
'google',
2020
'mistral',
2121
'exa',
22+
'browser_use',
23+
'serper',
24+
'firecrawl',
2225
'huggingface',
2326
'linkup',
2427
'perplexity',

apps/sim/blocks/blocks/linkup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
120120
placeholder: 'Enter your Linkup API key',
121121
password: true,
122122
required: true,
123+
hideWhenHosted: true,
123124
},
124125
],
125126

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export const FLASH_TURBO_MODELS = new Set([
2+
'eleven_turbo_v2',
3+
'eleven_turbo_v2_5',
4+
'eleven_flash_v2_5',
5+
])

apps/sim/tools/elevenlabs/tts.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
import { FLASH_TURBO_MODELS } from '@/tools/elevenlabs/constants'
12
import type { ElevenLabsTtsParams, ElevenLabsTtsResponse } from '@/tools/elevenlabs/types'
23
import type { ToolConfig } from '@/tools/types'
34

4-
const FLASH_TURBO_MODELS = new Set(['eleven_turbo_v2', 'eleven_turbo_v2_5', 'eleven_flash_v2_5'])
5-
65
export const elevenLabsTtsTool: ToolConfig<ElevenLabsTtsParams, ElevenLabsTtsResponse> = {
76
id: 'elevenlabs_tts',
87
name: 'ElevenLabs TTS',

apps/sim/tools/firecrawl/map.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import { createLogger } from '@sim/logger'
21
import type { MapParams, MapResponse } from '@/tools/firecrawl/types'
32
import type { ToolConfig } from '@/tools/types'
43

5-
const logger = createLogger('FirecrawlMapTool')
6-
74
export const mapTool: ToolConfig<MapParams, MapResponse> = {
85
id: 'firecrawl_map',
96
name: 'Firecrawl Map',

apps/sim/tools/firecrawl/scrape.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
import { createLogger } from '@sim/logger'
21
import type { ScrapeParams, ScrapeResponse } from '@/tools/firecrawl/types'
32
import { PAGE_METADATA_OUTPUT_PROPERTIES } from '@/tools/firecrawl/types'
43
import { safeAssign } from '@/tools/safe-assign'
54
import type { ToolConfig } from '@/tools/types'
65

7-
const logger = createLogger('FirecrawlScrapeTool')
8-
96
export const scrapeTool: ToolConfig<ScrapeParams, ScrapeResponse> = {
107
id: 'firecrawl_scrape',
118
name: 'Firecrawl Website Scraper',

apps/sim/tools/firecrawl/search.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import { createLogger } from '@sim/logger'
21
import type { SearchParams, SearchResponse } from '@/tools/firecrawl/types'
32
import { SEARCH_RESULT_OUTPUT_PROPERTIES } from '@/tools/firecrawl/types'
43
import type { ToolConfig } from '@/tools/types'
54

6-
const logger = createLogger('FirecrawlSearchTool')
7-
85
export const searchTool: ToolConfig<SearchParams, SearchResponse> = {
96
id: 'firecrawl_search',
107
name: 'Firecrawl Search',

apps/sim/tools/jina/read_url.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import { createLogger } from '@sim/logger'
21
import type { ReadUrlParams, ReadUrlResponse } from '@/tools/jina/types'
32
import type { ToolConfig } from '@/tools/types'
43

5-
const logger = createLogger('JinaReaderTool')
6-
74
export const readUrlTool: ToolConfig<ReadUrlParams, ReadUrlResponse> = {
85
id: 'jina_read_url',
96
name: 'Jina Reader',
@@ -169,6 +166,9 @@ export const readUrlTool: ToolConfig<ReadUrlParams, ReadUrlResponse> = {
169166
pricing: {
170167
type: 'custom',
171168
getCost: (_params, output) => {
169+
if (output.tokensUsed == null) {
170+
throw new Error('Jina read_url response missing tokensUsed field')
171+
}
172172
// Jina bills per output token — $0.20 per 1M tokens
173173
// Source: https://cloud.jina.ai/pricing (token-based billing)
174174
const tokens = output.tokensUsed as number

apps/sim/tools/jina/search.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import { createLogger } from '@sim/logger'
21
import type { SearchParams, SearchResponse } from '@/tools/jina/types'
32
import { JINA_SEARCH_RESULT_OUTPUT_PROPERTIES } from '@/tools/jina/types'
43
import type { ToolConfig } from '@/tools/types'
54

6-
const logger = createLogger('JinaSearchTool')
7-
85
export const searchTool: ToolConfig<SearchParams, SearchResponse> = {
96
id: 'jina_search',
107
name: 'Jina Search',
@@ -157,6 +154,9 @@ export const searchTool: ToolConfig<SearchParams, SearchResponse> = {
157154
pricing: {
158155
type: 'custom',
159156
getCost: (_params, output) => {
157+
if (output.tokensUsed == null) {
158+
throw new Error('Jina search response missing tokensUsed field')
159+
}
160160
// Jina bills per output token — $0.20 per 1M tokens
161161
// Search costs a fixed minimum of 10,000 tokens per request
162162
// Source: https://cloud.jina.ai/pricing (token-based billing)

apps/sim/tools/serper/search.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import { createLogger } from '@sim/logger'
21
import type { SearchParams, SearchResponse, SearchResult } from '@/tools/serper/types'
32
import { SERPER_SEARCH_RESULT_OUTPUT_PROPERTIES } from '@/tools/serper/types'
43
import type { ToolConfig } from '@/tools/types'
54

6-
const logger = createLogger('SerperTool')
7-
85
export const searchTool: ToolConfig<SearchParams, SearchResponse> = {
96
id: 'serper_search',
107
name: 'Web Search',

0 commit comments

Comments
 (0)