exposing a litellm.max budget

This commit is contained in:
Krrish Dholakia 2023-09-14 14:19:51 -07:00
parent 656b60f474
commit e3293ee264
8 changed files with 45 additions and 5 deletions

View file

@ -107,4 +107,11 @@ class OpenAIError(OpenAIError): # type: ignore
headers=original_exception.headers,
code=original_exception.code,
)
self.llm_provider = "openai"
self.llm_provider = "openai"
class BudgetExceededError(Exception):
def __init__(self, current_cost, max_budget):
self.current_cost = current_cost
self.max_budget = max_budget
message = f"Budget has been exceeded! Current cost: {current_cost}, Max budget: {max_budget}"
super().__init__(message)