package org.dromara.talk.config;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.service.ConfigService;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RequiredArgsConstructor
public class DifyConfig {

    private final ConfigService configService;

    public String getApiKey() {
        try {
            return configService.getConfigValue("dify.apiKey");
        } catch (Exception e) {
            log.warn("从配置表读取 dify.apiKey 失败", e);
        }
        return "";
    }

    public String getApiUrl() {
        try {
            return configService.getConfigValue("dify.apiUrl");
        } catch (Exception e) {
            log.warn("从配置表读取 dify.apiUrl 失败", e);
        }
        return "";
    }
}
