package com.kt.ai.client;

import com.kt.ai.client.config.FeignClientConfig;
import com.kt.ai.client.dto.ClaudeRequest;
import com.kt.ai.client.dto.ClaudeResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * Claude API Feign Client
 * API Docs: https://docs.anthropic.com/claude/reference/messages_post
 *
 * @author AI Service Team
 * @since 1.0.0
 */
@FeignClient(
        name = "claudeApiClient",
        url = "${ai.claude.api-url}",
        configuration = FeignClientConfig.class
)
public interface ClaudeApiClient {

    /**
     * Claude Messages API 호출
     *
     * @param apiKey Claude API Key
     * @param anthropicVersion API Version (2023-06-01)
     * @param request Claude 요청
     * @return Claude 응답
     */
    @PostMapping(consumes = "application/json", produces = "application/json")
    ClaudeResponse sendMessage(
            @RequestHeader("x-api-key") String apiKey,
            @RequestHeader("anthropic-version") String anthropicVersion,
            @RequestBody ClaudeRequest request
    );
}
