mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-20 01:59:22 +08:00
feat(llmExtract): add token tracking to all calls
This commit is contained in:
parent
438ea19f16
commit
6d2347b5f8
@ -295,6 +295,10 @@ export async function generateCompletions({
|
|||||||
result.usage?.promptTokens ?? 0,
|
result.usage?.promptTokens ?? 0,
|
||||||
result.usage?.completionTokens ?? 0,
|
result.usage?.completionTokens ?? 0,
|
||||||
),
|
),
|
||||||
|
tokens: {
|
||||||
|
input: result.usage?.promptTokens ?? 0,
|
||||||
|
output: result.usage?.completionTokens ?? 0,
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
extract = result.text;
|
extract = result.text;
|
||||||
@ -347,6 +351,10 @@ export async function generateCompletions({
|
|||||||
result.usage?.promptTokens ?? 0,
|
result.usage?.promptTokens ?? 0,
|
||||||
result.usage?.completionTokens ?? 0,
|
result.usage?.completionTokens ?? 0,
|
||||||
),
|
),
|
||||||
|
tokens: {
|
||||||
|
input: result.usage?.promptTokens ?? 0,
|
||||||
|
output: result.usage?.completionTokens ?? 0,
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user