|
1 | 1 | import { createLogger } from '@sim/logger' |
2 | 2 | import { getMaxExecutionTimeout } from '@/lib/core/execution-limits' |
3 | | -import { PlatformEvents } from '@/lib/core/telemetry' |
4 | 3 | import type { BrowserUseRunTaskParams, BrowserUseRunTaskResponse } from '@/tools/browser_use/types' |
5 | 4 | import type { ToolConfig, ToolResponse } from '@/tools/types' |
6 | 5 |
|
@@ -257,62 +256,6 @@ export const runTaskTool: ToolConfig<BrowserUseRunTaskParams, BrowserUseRunTaskR |
257 | 256 | }, |
258 | 257 | }, |
259 | 258 |
|
260 | | - hosting: { |
261 | | - envKeyPrefix: 'BROWSER_USE_API_KEY', |
262 | | - apiKeyParam: 'apiKey', |
263 | | - byokProviderId: 'browser_use', |
264 | | - pricing: { |
265 | | - type: 'custom', |
266 | | - getCost: (params, output) => { |
267 | | - if (!Array.isArray(output.steps)) { |
268 | | - throw new Error('Browser Use response missing steps array, cannot determine cost') |
269 | | - } |
270 | | - const INIT_COST = 0.01 |
271 | | - const STEP_COSTS: Record<string, number> = { |
272 | | - 'browser-use-llm': 0.002, |
273 | | - 'browser-use-2.0': 0.006, |
274 | | - o3: 0.03, |
275 | | - 'o4-mini': 0.03, |
276 | | - 'gemini-3-pro-preview': 0.03, |
277 | | - 'gemini-3-flash-preview': 0.015, |
278 | | - 'gemini-flash-latest': 0.0075, |
279 | | - 'gemini-flash-lite-latest': 0.005, |
280 | | - 'gemini-2.5-flash': 0.0075, |
281 | | - 'gemini-2.5-pro': 0.03, |
282 | | - 'claude-sonnet-4-5-20250929': 0.05, |
283 | | - 'claude-opus-4-5-20251101': 0.05, |
284 | | - 'claude-3-7-sonnet-20250219': 0.05, |
285 | | - 'gpt-4o': 0.006, |
286 | | - 'gpt-4o-mini': 0.006, |
287 | | - 'gpt-4.1': 0.006, |
288 | | - 'gpt-4.1-mini': 0.006, |
289 | | - 'llama-4-maverick-17b-128e-instruct': 0.006, |
290 | | - } |
291 | | - const DEFAULT_STEP_COST = 0.006 |
292 | | - const model = (params.model as string) || 'browser-use-2.0' |
293 | | - const knownCost = STEP_COSTS[model] |
294 | | - if (!knownCost) { |
295 | | - logger.warn( |
296 | | - `Unknown Browser Use model "${model}", using default step cost $${DEFAULT_STEP_COST}` |
297 | | - ) |
298 | | - PlatformEvents.hostedKeyUnknownModelCost({ |
299 | | - toolId: 'browser_use_run_task', |
300 | | - modelName: model, |
301 | | - defaultCost: DEFAULT_STEP_COST, |
302 | | - }) |
303 | | - } |
304 | | - const stepCost = knownCost ?? DEFAULT_STEP_COST |
305 | | - const stepCount = output.steps.length |
306 | | - const total = INIT_COST + stepCount * stepCost |
307 | | - return { cost: total, metadata: { model, stepCount, stepCost, initCost: INIT_COST } } |
308 | | - }, |
309 | | - }, |
310 | | - rateLimit: { |
311 | | - mode: 'per_request', |
312 | | - requestsPerMinute: 100, |
313 | | - }, |
314 | | - }, |
315 | | - |
316 | 259 | request: { |
317 | 260 | url: 'https://api.browser-use.com/api/v2/tasks', |
318 | 261 | method: 'POST', |
|
0 commit comments