Skip to content
Merged
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions apps/sim/tools/firecrawl/scrape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ export const scrapeTool: ToolConfig<ScrapeParams, ScrapeResponse> = {
pricing: {
type: 'custom',
getCost: (_params, output) => {
if (output.creditsUsed == null) {
const creditsUsedString = (output.metadata as { creditsUsed?: number })?.creditsUsed
Comment thread
TheodoreSpeaks marked this conversation as resolved.
Outdated
if (creditsUsedString == null) {
throw new Error('Firecrawl response missing creditsUsed field')
}

const creditsUsed = Number(output.creditsUsed)
Comment thread
TheodoreSpeaks marked this conversation as resolved.
const creditsUsed = Number(creditsUsedString)
Comment thread
TheodoreSpeaks marked this conversation as resolved.
Outdated
if (Number.isNaN(creditsUsed)) {
throw new Error('Firecrawl response returned a non-numeric creditsUsed field')
}
Expand Down
Loading