package com.xueyi.nlt.api.nlt.feign;


import com.alibaba.fastjson2.JSONObject;
import com.xueyi.nlt.api.nlt.domain.vo.WenxinErnieBotResponse;
import com.xueyi.nlt.api.nlt.feign.factory.RemoteLandingLlmFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(url = "${notification.wenxin-llm.url}",name = "wenxin-llm", fallbackFactory = RemoteLandingLlmFallbackFactory.class)
public interface RemoteWenxinLlmService {

    @GetMapping("/oauth/2.0/token")
    void getToken(@RequestParam(value = "grant_type",defaultValue = "client_credentials") String grantType,
                  @RequestParam("client_id") String clientId,
                  @RequestParam("client_secret") String clientSecret);


    @PostMapping("/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/eb-instant")
    WenxinErnieBotResponse ebInstant(@RequestParam("access-token") String accessToken, @RequestBody JSONObject message);

}
