jpfearnworks's picture
Add knowledge domain router
03f1c64
raw
history blame
1.02 kB
from pydantic import BaseModel
from loguru import logger
class KnowledgeDomain(BaseModel):
"""
KnowledgeDomain Class
Design:
This class acts as a base for knowledge domain classes. It's not intended to be instantiated directly,
but should be extended by other classes that provide a specific implementation for the generate_response method.
This adheres to the Open/Closed Principle (OCP) and Liskov Substitution Principle (LSP) by providing a base
class that can be extended without modification.
Intended Implementation:
Classes that extend KnowledgeDomain should provide an implementation for the generate_response method.
The generate_response method should take a question string as input and return a response string. The
specifics of how the response is generated will depend on the requirements of the subclass.
"""
def generate_response(self, question: str) -> str:
logger.info("Generating response for question: {}", question)
pass