MCPcopy Create free account
hub / github.com/dashscope/dashscope-sdk-java / usage

Method usage

samples/YuanyuUsage.java:13–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12public 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();

Callers 1

mainMethod · 0.95

Calls 4

callMethod · 0.95
toJsonMethod · 0.95
builderMethod · 0.80
buildMethod · 0.65

Tested by

no test coverage detected