package cn.nianxx.thhotel.integrations.ai.superagent.service.impl;

import java.time.Duration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * SuperAgent Open API 配置。API Key 只能来自环境变量或部署 Secret。
 */
@Component
@ConfigurationProperties(prefix = "superagent.open-api")
public class SuperAgentOpenApiProperties {

    /** 是否启用真实 SuperAgent Open API 调用。 */
    private boolean enabled = false;
    /** SuperAgent / DeerFlow Open API 基础地址。 */
    private String baseUrl = "";
    /** SuperAgent Open API Key。 */
    private String apiKey = "";
    /** Debug EML 创建 session 时使用的 external_subject_id。 */
    private String externalSubjectId = "th-hotel-debug-eml-upload";
    /** 建立连接超时。 */
    private Duration connectTimeout = Duration.ofSeconds(15);
    /** SSE 读取超时。 */
    private Duration readTimeout = Duration.ofSeconds(180);

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public String getBaseUrl() {
        return baseUrl;
    }

    public void setBaseUrl(String baseUrl) {
        this.baseUrl = baseUrl;
    }

    public String getApiKey() {
        return apiKey;
    }

    public void setApiKey(String apiKey) {
        this.apiKey = apiKey;
    }

    public String getExternalSubjectId() {
        return externalSubjectId;
    }

    public void setExternalSubjectId(String externalSubjectId) {
        this.externalSubjectId = externalSubjectId;
    }

    public Duration getConnectTimeout() {
        return connectTimeout;
    }

    public void setConnectTimeout(Duration connectTimeout) {
        this.connectTimeout = connectTimeout;
    }

    public Duration getReadTimeout() {
        return readTimeout;
    }

    public void setReadTimeout(Duration readTimeout) {
        this.readTimeout = readTimeout;
    }
}
