mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
exposing a litellm.max budget
This commit is contained in:
parent
970822c79a
commit
73a084c19c
8 changed files with 45 additions and 5 deletions
|
@ -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)
|
Loading…
Add table
Add a link
Reference in a new issue