Unverified Commit 3a0a9e2d authored by takatost's avatar takatost Committed by GitHub

fix: embedding get price definition missing (#922)

parent 0a0d6345
......@@ -379,7 +379,7 @@ class IndexingRunner:
return {
"total_segments": total_segments,
"tokens": tokens,
"total_price": '{:f}'.format(embedding_model.get_token_price(tokens)),
"total_price": '{:f}'.format(embedding_model.calc_tokens_price(tokens)),
"currency": embedding_model.get_currency(),
"preview": preview_texts
}
......
......@@ -50,7 +50,7 @@ class BaseEmbedding(BaseProviderModel):
logger.debug(f"model: {self.name} price_config: {self._price_config}")
return self._price_config
def calc_tokens_price(self, tokens:int) -> decimal.Decimal:
def calc_tokens_price(self, tokens: int) -> decimal.Decimal:
"""
calc tokens total price.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment