package org.studiorailgun.conversation.evaluators.transfer;

import org.studiorailgun.conversation.evaluators.goal.GoalData;
import org.studiorailgun.conversation.tracking.Conversation;
import org.studiorailgun.conversation.tracking.Quote;

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

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

}
