package com.qmth.boot.core.ai.config;

import com.qmth.boot.core.retrofit.interfaces.CustomizeRetrofitConfiguration;
import com.qmth.boot.core.retrofit.interfaces.SignatureProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.time.Duration;

public class LlmApiConfiguration implements CustomizeRetrofitConfiguration {

    private static final Logger log = LoggerFactory.getLogger(LlmApiConfiguration.class);

    private LlmProperties llmProperties;

    public LlmApiConfiguration(LlmProperties llmProperties) {
        this.llmProperties = llmProperties;
        log.info("LLM api configuration inited, server=" + llmProperties.getServer());
    }

    public String getBaseUrl() {
        return llmProperties.getServer();
    }

    public SignatureProvider getSignature() {
        return null;
    }

    @Override
    public Duration getReadTimeout() {
        return Duration.ofSeconds(60);
    }
}
