package org.studiorailgun.conversation;

import java.util.Scanner;

import org.studiorailgun.Globals;
import org.studiorailgun.conversation.command.CommandParser;
import org.studiorailgun.conversation.tracking.Quote;

public class AgentLoop {
    
    /**
     * The size of the context available
     */
    static final int CONTEXT_SIZE = 32 * 1024;

    /**
     * Controls whether the main parser loop is running
     */
    public static boolean running = true;

    /**
     * The main method
     */
    public static void main(){
        Globals.init("web.json");

        try (Scanner scan = new Scanner(System.in)) {
            String prompt = "";

            System.out.println("Agent is ready..");

            //actual main loop
            while(running){

                //handle player statement
                prompt = scan.nextLine();
                if(CommandParser.parseCommands(prompt)){
                    continue;
                }
                Quote response = ConvAI.simFrame(prompt);
                System.out.println(response.getRaw());
            }
        }
    }

}
