Skip to content

Commit

Permalink
updated __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nalbion committed Oct 4, 2023
1 parent c1e47ce commit d0c8db2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 4 additions & 5 deletions pilot/helpers/exceptions/ApiKeyNotDefinedError.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
class TokenLimitError(Exception):
def __init__(self, tokens_in_messages, max_tokens):
self.tokens_in_messages = tokens_in_messages
self.max_tokens = max_tokens
super().__init__(f"Token limit error happened with {tokens_in_messages}/{max_tokens} tokens in messages!")
class ApiKeyNotDefinedError(Exception):
def __init__(self, env_key: str):
self.env_key = env_key
super().__init__(f"API Key has not been configured: {env_key}")
5 changes: 3 additions & 2 deletions pilot/helpers/exceptions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from .AgentConvo import AgentConvo
from .Project import Project
from .ApiKeyNotDefinedError import ApiKeyNotDefinedError
from .TokenLimitError import TokenLimitError
from .TooDeepRecursionError import TooDeepRecursionError

0 comments on commit d0c8db2

Please sign in to comment.