MCPcopy
hub / github.com/langroid/langroid / reset_usage_cost

Method reset_usage_cost

langroid/language_models/base.py:718–725  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

716 return (0.0, 0.0, 0.0)
717
718 def reset_usage_cost(self) -> None:
719 for mdl in [self.config.chat_model, self.config.completion_model]:
720 if mdl is None:
721 return
722 if mdl not in self.usage_cost_dict:
723 self.usage_cost_dict[mdl] = LLMTokenUsage()
724 counter = self.usage_cost_dict[mdl]
725 counter.reset()
726
727 def update_usage_cost(
728 self, chat: bool, prompts: int, completions: int, cost: float

Callers 6

test_agent_token_usageFunction · 0.80
test_token_usage_toolFunction · 0.80
test_task_costFunction · 0.80
test_task_batch_turnsFunction · 0.80

Calls 2

LLMTokenUsageClass · 0.85
resetMethod · 0.80

Tested by 6

test_agent_token_usageFunction · 0.64
test_token_usage_toolFunction · 0.64
test_task_costFunction · 0.64
test_task_batch_turnsFunction · 0.64