package com.guwan.util;

import cn.hutool.json.JSONObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

@FeignClient(name = "voiceService", url = "http://127.0.0.1:8532")
public interface VoiceServiceClient {

    @PostMapping(value = "/v1/audio/transcriptions", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    JSONObject voiceToText(@RequestPart("file") MultipartFile file,
                           @RequestPart("model") String model);
}
