package com.yutou.qqbot.http;

import com.yutou.okhttp.HttpLoggingInterceptor;
import com.yutou.okhttp.api.BaseApi;
import com.yutou.qqbot.utlis.ConfigTools;
import lombok.val;

import java.util.HashMap;

public class GPTApi extends BaseApi {

    public static void setLog(boolean log) {
        HttpLoggingInterceptor.setLog(log);
    }

    public static SiliconGPTApi getApi() {
        val api = new GPTApi();
        api.setURL("https://api.siliconflow.cn/v1/");
//        api.setURL("http://127.0.0.1:8080/");
        HashMap<String, String> header = new HashMap<>();
        header.put("Authorization", "Bearer sk-dcmhlbhyitcdnjbjfgflhwimahdmygfrcaopzjjcpgsfzmzo");
        header.put("Content-Type", "application/json");
        api.addHeader(header);
        return api.createApi(SiliconGPTApi.class);
    }
}
