Update AI handler instantiation in server files

This commit is contained in:
Brian Pham
2023-12-13 08:16:02 +08:00
parent ca1ccd7b91
commit 8fb4a42ef1
16 changed files with 63 additions and 37 deletions

View File

@ -14,15 +14,15 @@ class BaseAiHandler(ABC):
def deployment_id(self):
pass
@abstractmethod
"""
This method should be implemented to return a chat completion from the AI model.
params:
model: the name of the model to use for the chat completion
system: the system message string to use for the chat completion
user: the user message string to use for the chat completion
temperature: the temperature to use for the chat completion
"""
@abstractmethod
async def chat_completion(self, model: str, system: str, user: str, temperature: float = 0.2):
"""
This method should be implemented to return a chat completion from the AI model.
Args:
model (str): the name of the model to use for the chat completion
system (str): the system message string to use for the chat completion
user (str): the user message string to use for the chat completion
temperature (float): the temperature to use for the chat completion
"""
pass