package com.njzscloud.supervisory.doubao.config;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 火山引擎豆包配置
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
@ConfigurationProperties(prefix = "doubao")
public class DouBaoProperties {
    
    /**
     * API Key，优先从环境变量 ARK_API_KEY 获取，如果环境变量不存在则使用配置值
     */
    private String apiKey;
    
    /**
     * 基础URL，默认为 https://ark.cn-beijing.volces.com/api/v3
     */
    private String baseUrl = "https://ark.cn-beijing.volces.com/api/v3";
    
    /**
     * 模型ID，默认为 doubao-seed-1-6-vision-250815
     */
    private String model = "doubao-seed-1-6-vision-250815";
    
    /**
     * 连接池大小，默认5
     */
    private Integer connectionPoolSize = 5;
    
    /**
     * 连接保持时间（秒），默认1
     */
    private Long connectionKeepAliveSeconds = 1L;
    
    /**
     * 获取API Key，优先从环境变量获取
     */
    public String getApiKey() {
        String envApiKey = System.getenv("ARK_API_KEY");
        return envApiKey != null ? envApiKey : apiKey;
    }
}

