From d0c8db238c26c2c2687aad99fb830571d73060b7 Mon Sep 17 00:00:00 2001 From: Nicholas Albion Date: Wed, 4 Oct 2023 16:09:41 +1100 Subject: [PATCH] updated __init__.py --- pilot/helpers/exceptions/ApiKeyNotDefinedError.py | 9 ++++----- pilot/helpers/exceptions/__init__.py | 5 +++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pilot/helpers/exceptions/ApiKeyNotDefinedError.py b/pilot/helpers/exceptions/ApiKeyNotDefinedError.py index 1071a32..37741d4 100644 --- a/pilot/helpers/exceptions/ApiKeyNotDefinedError.py +++ b/pilot/helpers/exceptions/ApiKeyNotDefinedError.py @@ -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}") diff --git a/pilot/helpers/exceptions/__init__.py b/pilot/helpers/exceptions/__init__.py index 7bacb04..977859e 100644 --- a/pilot/helpers/exceptions/__init__.py +++ b/pilot/helpers/exceptions/__init__.py @@ -1,2 +1,3 @@ -from .AgentConvo import AgentConvo -from .Project import Project +from .ApiKeyNotDefinedError import ApiKeyNotDefinedError +from .TokenLimitError import TokenLimitError +from .TooDeepRecursionError import TooDeepRecursionError