| foundry_usage | R Documentation |
Sum token columns returned by foundryR chat, Responses, extraction, and batch
helpers. Pass your own rates to compute spend; foundryR does not hardcode
Azure prices because they change over time.
foundry_usage(x, rates = NULL)
x |
Data frame with foundryR token columns. |
rates |
Optional named numeric vector with any of |
A one-row tibble with token totals and optional cost.
responses <- data.frame(
input_tokens = c(10, 20),
cached_input_tokens = c(0, 5),
output_tokens = c(3, 7)
)
foundry_usage(responses)
foundry_usage(
responses,
rates = c(input = 0.000001, cached_input = 0.0000001, output = 0.000004)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.