当前位置: 首页> 房产> 建材 > 成版年蝴蝶视频app免费_现在东莞疫情最新情况_应用商店aso_seo运营做什么

成版年蝴蝶视频app免费_现在东莞疫情最新情况_应用商店aso_seo运营做什么

时间:2025/8/4 10:24:57来源:https://blog.csdn.net/qq_38599266/article/details/144140903 浏览次数:0次
成版年蝴蝶视频app免费_现在东莞疫情最新情况_应用商店aso_seo运营做什么

1.先到阿里云平台开头阿里云白炼账号,创建apiKey

2. 引入maven依赖

<dependency><groupId>com.alibaba</groupId><artifactId>dashscope-sdk-java</artifactId><version>2.8.3</version></dependency><!-- https://mvnrepository.com/artifact/io.projectreactor/reactor-core --><dependency><groupId>io.projectreactor</groupId><artifactId>reactor-core</artifactId><version>3.6.0</version></dependency>

3.调用通义api

  String content ;// 构建消息对象try{Message message = Message.builder().role(Role.USER.getValue()).content(question.toString()).build();// 构建通义千问参数对象GenerationParam param = GenerationParam.builder().model(Generation.Models.QWEN_PLUS).messages(Collections.singletonList(message)).resultFormat(GenerationParam.ResultFormat.MESSAGE).topP(0.8).apiKey(apiKey)//正式
//                    .apiKey("sk-86fadc62eeaf4e3a9a24b55925b9a80d")//正式
//                .apiKey("sk-6f335e7853a64e3e9b8384e338d22e50")//测试.build();GenerationResult result = new Generation().call(param);// 获取生成的内容content = result.getOutput().getChoices().get(0).getMessage().getContent();// 设置响应内容类型response.setContentType("application/json");response.setCharacterEncoding("UTF-8");// 构建成功响应Map<String, Object> successMap = new HashMap<>();successMap.put("data", content);response.getWriter().write(objectMapper.writeValueAsString(successMap));} catch (Exception e) {throw new ServiceException(GlobalErrorCodeConstants.NOT_FOUND.getCode(), "调用AI接口异常:"+e.getMessage());}return content;

pipost测试接口返回:

关键字:成版年蝴蝶视频app免费_现在东莞疫情最新情况_应用商店aso_seo运营做什么

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: