Skip to content

Commit

Permalink
tried to get stepan changes working
Browse files Browse the repository at this point in the history
  • Loading branch information
laurence.hook committed Oct 23, 2023
1 parent d6071bf commit f726c26
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion clients/gpt_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f726c26

Please sign in to comment.