docs(budget_manager): add docstring to BudgetManager.reset_cost (#27867)

Co-authored-by: oss-agent-shin <279349115+oss-agent-shin@users.noreply.github.com>
This commit is contained in:
oss-agent-shin 2026-05-13 13:28:22 -07:00 committed by GitHub
parent 5e706f8c87
commit ca82761e48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -178,6 +178,18 @@ class BudgetManager:
return list(self.user_dict.keys())
def reset_cost(self, user):
"""
Reset the tracked spend for a user back to zero.
Clears both the aggregate ``current_cost`` and the per-model
``model_cost`` breakdown stored for the given user.
Args:
user: The user identifier whose cost should be reset.
Returns:
dict: ``{"user": <updated user record>}`` reflecting the reset state.
"""
self.user_dict[user]["current_cost"] = 0
self.user_dict[user]["model_cost"] = {}
return {"user": self.user_dict[user]}