TokenPrices
constructor(currency: String, perInputToken: Double = 0.0, perOutputToken: Double = 0.0, perCall: Double = 0.0, inputTokensKey: String = DEFAULT_INPUT_TOKENS_KEY, outputTokensKey: String = DEFAULT_OUTPUT_TOKENS_KEY)
Parameters
currency
the unit the three prices are in. Free-form and never interpreted: it is carried through to Savings so a total is never read without one. Two scopes may use different ones, and the cache will not add them together.
perInputToken
price of one prompt token.
perOutputToken
price of one completion token.
perCall
a flat charge per request, for providers that levy one. Counted on every hit whether or not the entry carries token counts, since it did not depend on them.
inputTokensKey
metadata key holding the prompt token count of the call that was cached.
outputTokensKey
metadata key holding its completion token count.