Merge pull request #771 from iorisa/feature/context

feat: replace CONTEXT with local context
This commit is contained in:
geekan 2024-01-18 19:17:32 +08:00 committed by GitHub
commit 16ec0ccc4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
68 changed files with 354 additions and 356 deletions

View file

@ -84,7 +84,7 @@ class FireworksLLM(OpenAILLM):
def _update_costs(self, usage: CompletionUsage):
if self.config.calc_usage and usage:
try:
# use FireworksCostManager not CONTEXT.cost_manager
# use FireworksCostManager not context.cost_manager
self.cost_manager.update_cost(usage.prompt_tokens, usage.completion_tokens, self.model)
except Exception as e:
logger.error(f"updating costs failed!, exp: {e}")