Refactor AI handler classes

This commit is contained in:
Brian Pham
2023-12-10 00:25:25 +08:00
parent b6cabda586
commit 7e47baa9db
9 changed files with 71 additions and 23 deletions

View File

@ -7,11 +7,11 @@ from openai.error import APIError, RateLimitError, Timeout, TryAgain
from retry import retry
from pr_agent.config_loader import get_settings
from pr_agent.log import get_logger
from pr_agent.algo.base_ai_handler import BaseAiHandler
OPENAI_RETRIES = 5
class AiHandler:
class AiHandler(BaseAiHandler):
"""
This class handles interactions with the OpenAI API for chat completions.
It initializes the API key and other settings from a configuration file,