from .chains.ielts import IELTS_Chain from .chains.toefl import TOEFL_Chain from .chains.general import General_Chain class EssayEvaluation: """ A class that provides methods for evaluating essays based on different evaluation types. """ @staticmethod def evaluate(type, essay_topic, essay_text): """ Evaluates an essay based on the specified type. Args: type (str): The type of evaluation to perform. Possible values are "IELTS", "TOEFL", or "General". essay_topic (str): The topic of the essay. essay_text (str): The text of the essay. Returns: str: The evaluation result. Raises: None """ if type == "IELTS": result = EssayEvaluation.evaluate_ielts(essay_topic, essay_text) elif type == "TOEFL": result = EssayEvaluation.evaluate_toefl(essay_topic, essay_text) elif type == "General": result = EssayEvaluation.evaluate_general(essay_topic, essay_text) else: result = "Invalid type selected." return result @staticmethod def evaluate_ielts(essay_topic, essay_text): """ Evaluates an essay for IELTS. Args: essay_topic (str): The topic of the essay. essay_text (str): The text of the essay. Returns: str: The evaluation result. Raises: None """ return IELTS_Chain().invoke(essay_topic, essay_text) @staticmethod def evaluate_toefl(essay_topic, essay_text): """ Evaluates an essay for TOEFL. Args: essay_topic (str): The topic of the essay. essay_text (str): The text of the essay. Returns: str: The evaluation result. Raises: None """ return TOEFL_Chain().invoke(essay_topic, essay_text) @staticmethod def evaluate_general(essay_topic, essay_text): """ Evaluates an essay using a general evaluation method. Args: essay_topic (str): The topic of the essay. essay_text (str): The text of the essay. Returns: str: The evaluation result. Raises: None """ return General_Chain().invoke(essay_topic, essay_text)