Abstract AiHandler to BaseAiHandler

This commit is contained in:
Brian Pham
2023-12-09 16:39:25 +00:00
parent 8d075b76ae
commit f2abe5c73e
8 changed files with 69 additions and 21 deletions

View File

@ -7,10 +7,11 @@ from litellm import acompletion
from openai.error import APIError, RateLimitError, Timeout, TryAgain
from retry import retry
from pr_agent.config_loader import get_settings
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,