diff --git a/clients/gpt_client.py b/clients/gpt_client.py index 8bb49e5..eb43d95 100644 --- a/clients/gpt_client.py +++ b/clients/gpt_client.py @@ -14,7 +14,7 @@ class Models(str, Enum): class GPTClient(AIClient): - def __init__(self, api_key: str, model: str = Models.GPT4.value): + def __init__(self, api_key: str, model: str = Models.GPT3.value): openai.api_key = api_key self._system_instructions = None self._user_prompt = None @@ -46,6 +46,13 @@ def user_prompt(self, value): self._user_prompt = value def query(self, transcript: str) -> str: + if self._system_instructions is None: + logger.error("self._system_instructions is None. Aborting the query.") + raise RuntimeError("self._system_instructions is None, cannot proceed with query.") + if self._user_prompt is None: + logger.error("self._user_prompt is None. Aborting the query.") + raise RuntimeError("self._user_prompt is None, cannot proceed with query.") + max_retries = 6 # Number of retries retry_delay = 10 # Delay between retries in seconds diff --git a/main.py b/main.py index d3ee432..c9719a2 100644 --- a/main.py +++ b/main.py @@ -34,7 +34,7 @@ def main(idea: str, config: Path = None, verbose: int = 1): configure_logging(verbose) load_dotenv() client = get_ai_client( - AIClientType.ChatGPT, AIClientConfig(api_key=os.getenv("openai.api_key")) + AIClientType.ChatGPT, AIClientConfig(model="gpt-3.5-turbo", api_key=os.getenv("openai.api_key")) ) if config: sme_dict = parse_yaml_config(config)