package dev.sonpx.loyalty.agent.core.memory;

import org.springframework.ai.chat.client.advisor.MessageChatMemoryAdvisor;
import org.springframework.ai.chat.memory.ChatMemory;
import org.springframework.stereotype.Service;

@Service
public class AgentMemoryManagerImpl implements AgentMemoryManager {

    private final ChatMemory chatMemory;

    public AgentMemoryManagerImpl(ChatMemory chatMemory) {
        this.chatMemory = chatMemory;
    }

    @Override
    public MessageChatMemoryAdvisor getAdvisor() {
        return MessageChatMemoryAdvisor.builder(chatMemory).build();
    }

    @Override
    public ChatMemory getChatMemory() {
        return chatMemory;
    }
}
