Skip to content

Commit 4b073a6

Browse files
author
Theodore Li
committed
Fix cost default issues
1 parent 05eccf1 commit 4b073a6

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

apps/sim/tools/firecrawl/extract.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ export const extractTool: ToolConfig<ExtractParams, ExtractResponse> = {
150150
jobId: data.id,
151151
success: false,
152152
data: {},
153-
creditsUsed: 0,
154153
},
155154
}
156155
},
@@ -186,7 +185,7 @@ export const extractTool: ToolConfig<ExtractParams, ExtractResponse> = {
186185
jobId,
187186
success: true,
188187
data: extractData.data || {},
189-
creditsUsed: extractData.creditsUsed || 0,
188+
creditsUsed: extractData.creditsUsed,
190189
}
191190
return result
192191
}

apps/sim/tools/firecrawl/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ export interface ExtractResponse extends ToolResponse {
511511
jobId: string
512512
success: boolean
513513
data: Record<string, any>
514-
creditsUsed: number
514+
creditsUsed?: number
515515
}
516516
}
517517

apps/sim/tools/huggingface/chat.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -162,17 +162,7 @@ export const chatTool: ToolConfig<HuggingFaceChatParams, HuggingFaceChatResponse
162162
output: {
163163
content: data.choices?.[0]?.message?.content || '',
164164
model: data.model || 'unknown',
165-
usage: data.usage
166-
? {
167-
prompt_tokens: data.usage.prompt_tokens || 0,
168-
completion_tokens: data.usage.completion_tokens || 0,
169-
total_tokens: data.usage.total_tokens || 0,
170-
}
171-
: {
172-
prompt_tokens: 0,
173-
completion_tokens: 0,
174-
total_tokens: 0,
175-
},
165+
usage: data.usage ?? undefined,
176166
},
177167
}
178168
},

0 commit comments

Comments
 (0)