()
| 11 | |
| 12 | public class YuanyuUsage{ |
| 13 | public static void usage() |
| 14 | throws NoApiKeyException, ApiException, InputRequiredException { |
| 15 | Generation gen = new Generation(); |
| 16 | String prompt="翻译成英文:春天来了,花朵都开了。"; |
| 17 | GenerationParam param = GenerationParam |
| 18 | .builder() |
| 19 | .model("chatyuan-large-v2") |
| 20 | .prompt(prompt) |
| 21 | .build(); |
| 22 | GenerationResult result = gen.call(param); |
| 23 | System.out.println(JsonUtils.toJson(result)); |
| 24 | } |
| 25 | public static void main(String[] args){ |
| 26 | try { |
| 27 | usage(); |