package org.studiorailgun.ai.conversation.evaluators.transfer;

import org.studiorailgun.ai.conversation.evaluators.goal.GoalData;
import org.studiorailgun.ai.conversation.tracking.Conversation;
import org.studiorailgun.ai.conversation.tracking.Sentence;

/**
 * Evaluation for transfer quotes
 */
public class TransferSynthesis {
    

    /**
     * Synthesizes an information transfer quote
     * @param conversation The conversation
     * @return The quote
     */
    public static Sentence synthesize(Conversation conversation){
        Sentence response = null;
        GoalData goalData = conversation.getGoalData();
        switch(goalData.getGoal()){
            case ANSWER: {
                Sentence questionToAnswer = goalData.getQueryData().getRecentQueries().remove(0);
                response = AnswerSynthesis.evaluate(conversation, questionToAnswer.getParent(), questionToAnswer);
            } break;
            case OPENER:
            case GREET: {
                throw new Error("Unsupported goal type for information transfer! " + goalData.getGoal());
            }
        }
        return response;
    }

}
