package dev.sonpx.loyalty.agent.service;

import dev.sonpx.loyalty.agent.core.orchestrator.AgentOrchestrator;
import dev.sonpx.loyalty.agent.core.memory.ConversationKeyResolver;
import dev.sonpx.loyalty.agent.domain.ChatRequest;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class LoyaltyAgentService {

    private final AgentOrchestrator agentOrchestrator;
    private final ConversationKeyResolver conversationKeyResolver;

    public void chat(ChatRequest request, String connectionSessionId) {
        String conversationKey = conversationKeyResolver.resolve(request, connectionSessionId);
        agentOrchestrator.process(request, connectionSessionId, conversationKey);
    }
}
