package net.voltexstudios.npcConversations.session;

import com.launchableinc.openai.completion.chat.ChatMessage;
import lombok.Getter;
import net.voltexstudios.npcConversations.npc.NPC;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.List;

@Getter
public class ConverstionSession {

    private final List<ChatMessage> messages;
    private final NPC npc;
    private final Player player;

    public ConverstionSession(@NotNull NPC npc, @NotNull Player player) {
        this.npc = npc;
        this.player = player;
        messages = new ArrayList<>();

        messages.add(new ChatMessage("user", "Create a new persona for yourself. Once set, you can't change it anymore. " +
                "Stick to that persona at all times and react to me as if you were that persona." +
                "Also describe your background story. Who are you? What are you doing here? If you get asked a question that does not fit your persona, say that you can't answer that question." +
                "Also keep the conversation on a friendly level and don't be to serious."
        ));
        messages.add(new ChatMessage("assistant", npc.getBackgroundStory()));
    }
}
