当前位置: 首页 > news >正文 那个网站的公众后推广做的好wordpress 3.2 news 2025/11/2 6:34:45 那个网站的公众后推广做的好,wordpress 3.2,贸易公司网址大全,广告设计自学网文章目录 创建Spring AI项目配置项目pom、application文件controller接口开发接口测试 创建Spring AI项目 打开IDEA创建一个新的spring boot项目#xff0c;填写项目名称和位置#xff0c;类型选择maven#xff0c;组、工件、软件包名称可以自定义#xff0c;JDK选择17即可… 文章目录 创建Spring AI项目配置项目pom、application文件controller接口开发接口测试 创建Spring AI项目 打开IDEA创建一个新的spring boot项目填写项目名称和位置类型选择maven组、工件、软件包名称可以自定义JDK选择17即可java语言标准和JDK相同即可 配置Spring Boot版本和开发所需的依赖主要如下图所示 Spring Boot版本可以选择3.2.5或者更高的版本作者使用3.2.5和3.2.6(SNAPSHOT)可以正常开发Spring Boot DevToolsspring项目热部署工具修改完代码不含application和pom配置文件即刻热部署项目Lombok通过配置快速配置对象的get、set、toStringSpring AISpring AI是一个用于AI工程的应用框架 创建完成后项目结构大体如下(这里删除了无用的maven文件内容、修改application的文件格式为yaml) 配置项目pom、application文件 注意修改pom文件重新下载spring ai依赖需要科学上网请确保网络连接没有问题 打开项目的pom文件修改spring ai的版本项目默认使用稳定版0.8.1 主要注意默认的spring ai版本和配置依赖jar包仓库maven仓库中还没有spring ai的依赖 propertiesjava.version21/java.versionspring-ai.version0.8.1/spring-ai.version /propertiesrepositoriesrepositoryidspring-snapshots/idnameSpring Snapshots/nameurlhttps://repo.spring.io/snapshot/urlreleasesenabledfalse/enabled/releases/repositoryrepositoryidspring-milestones/idnameSpring Milestones/nameurlhttps://repo.spring.io/milestone/urlsnapshotsenabledfalse/enabled/snapshots/repository /repositoriespluginRepositoriespluginRepositoryidspring-snapshots/idnameSpring Snapshots/nameurlhttps://repo.spring.io/snapshot/urlreleasesenabledfalse/enabled/releases/pluginRepository /pluginRepositories配置application文件api-key的获取参考Spring AI开发前期开发指导 spring:application:name: Chatai:openai:api-key: hk-xxxbase-url: https://api.openai-hk.com #请根据自己的api-key自定义配置chat:options:model: gpt-3.5-turbo #默认model为 gpt-3.5-turbotemperature: 0.5 server:port: 8080controller接口开发 这里列举可常用接口的使用方法更详细的配置请参考官网的开发文档 import jakarta.annotation.Resource; import org.springframework.ai.chat.ChatResponse; import org.springframework.ai.chat.prompt.Prompt; import org.springframework.ai.openai.OpenAiChatClient; import org.springframework.ai.openai.OpenAiChatOptions; import org.springframework.ai.openai.api.OpenAiApi; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import reactor.core.publisher.Flux;RestController public class ChatController {Resourceprivate OpenAiChatClient openAiChatClient;RequestMapping(/ai/chat)public String chat(RequestParam(value msg) String msg){return openAiChatClient.call(msg);}RequestMapping(/ai/chat2)public String chatCall(RequestParam(value msg) String msg){ChatResponse response openAiChatClient.call(new Prompt(msg));return response.getResult().getOutput().getContent();}RequestMapping(/ai/chat4)public String chatCall2(RequestParam(value msg) String msg){//可选参数可以覆盖 项目配置文件中的参数(以代码中内容为准)ChatResponse response openAiChatClient.call(new Prompt(msg,OpenAiChatOptions.builder().withModel(gpt-4-vision-preview) //gpt版本 可以填写字符串或者使用OpenAiApi.ChatModel中提供的常量.withTemperature(0.8F) //温度高回答创新型越高越低越准确.build()));return response.getResult().getOutput().getContent();}RequestMapping(/ai/chat5)public Object chatStream(RequestParam(value msg) String msg){FluxChatResponse flux openAiChatClient.stream(new Prompt(msg,OpenAiChatOptions.builder().withModel(OpenAiApi.ChatModel.GPT_4_VISION_PREVIEW.getValue()) //gpt版本 gpt-4-vision-preview.withTemperature(0.5F) //温度高回答创新型越高越低越准确.withMaxTokens(4096) //显示最大token.build()));flux.toStream().forEach(chatResponse - {System.out.print(chatResponse.getResult().getOutput().getContent());});return flux.collectList();} }接口测试 http://localhost:8080/ai/chat4?msg河南大学大礼堂被烧毁了请作一首诗表示悲痛 文章转载自: http://www.morning.dlgjdg.cn.gov.cn.dlgjdg.cn http://www.morning.mrtdq.cn.gov.cn.mrtdq.cn http://www.morning.gfprf.cn.gov.cn.gfprf.cn http://www.morning.gzxnj.cn.gov.cn.gzxnj.cn http://www.morning.pcrzf.cn.gov.cn.pcrzf.cn http://www.morning.c7624.cn.gov.cn.c7624.cn http://www.morning.txrq.cn.gov.cn.txrq.cn http://www.morning.zrkws.cn.gov.cn.zrkws.cn http://www.morning.kxgn.cn.gov.cn.kxgn.cn http://www.morning.wiitw.com.gov.cn.wiitw.com http://www.morning.kgnnc.cn.gov.cn.kgnnc.cn http://www.morning.ptqds.cn.gov.cn.ptqds.cn http://www.morning.hffjj.cn.gov.cn.hffjj.cn http://www.morning.ctrkh.cn.gov.cn.ctrkh.cn http://www.morning.smrty.cn.gov.cn.smrty.cn http://www.morning.mlycx.cn.gov.cn.mlycx.cn http://www.morning.gqhgl.cn.gov.cn.gqhgl.cn http://www.morning.hmdn.cn.gov.cn.hmdn.cn http://www.morning.htqrh.cn.gov.cn.htqrh.cn http://www.morning.pghry.cn.gov.cn.pghry.cn http://www.morning.bbgr.cn.gov.cn.bbgr.cn http://www.morning.ytfr.cn.gov.cn.ytfr.cn http://www.morning.mrfbp.cn.gov.cn.mrfbp.cn http://www.morning.gcthj.cn.gov.cn.gcthj.cn http://www.morning.zxznh.cn.gov.cn.zxznh.cn http://www.morning.ktlxk.cn.gov.cn.ktlxk.cn http://www.morning.pkfpl.cn.gov.cn.pkfpl.cn http://www.morning.mjbnp.cn.gov.cn.mjbnp.cn http://www.morning.rwjtf.cn.gov.cn.rwjtf.cn http://www.morning.hhpkb.cn.gov.cn.hhpkb.cn http://www.morning.hilmwmu.cn.gov.cn.hilmwmu.cn http://www.morning.mdtfh.cn.gov.cn.mdtfh.cn http://www.morning.nuejun.com.gov.cn.nuejun.com http://www.morning.ysllp.cn.gov.cn.ysllp.cn http://www.morning.llthz.cn.gov.cn.llthz.cn http://www.morning.wchsx.cn.gov.cn.wchsx.cn http://www.morning.crhd.cn.gov.cn.crhd.cn http://www.morning.qichetc.com.gov.cn.qichetc.com http://www.morning.baohum.com.gov.cn.baohum.com http://www.morning.llcgz.cn.gov.cn.llcgz.cn http://www.morning.nqmwk.cn.gov.cn.nqmwk.cn http://www.morning.rfdqr.cn.gov.cn.rfdqr.cn http://www.morning.xzsqb.cn.gov.cn.xzsqb.cn http://www.morning.qzpkr.cn.gov.cn.qzpkr.cn http://www.morning.gqnll.cn.gov.cn.gqnll.cn http://www.morning.bpmdx.cn.gov.cn.bpmdx.cn http://www.morning.clxpp.cn.gov.cn.clxpp.cn http://www.morning.yxplz.cn.gov.cn.yxplz.cn http://www.morning.zhishizf.cn.gov.cn.zhishizf.cn http://www.morning.thwhn.cn.gov.cn.thwhn.cn http://www.morning.frqtc.cn.gov.cn.frqtc.cn http://www.morning.hhqjf.cn.gov.cn.hhqjf.cn http://www.morning.nzzws.cn.gov.cn.nzzws.cn http://www.morning.ggxbyhk.cn.gov.cn.ggxbyhk.cn http://www.morning.pwlxy.cn.gov.cn.pwlxy.cn http://www.morning.zydr.cn.gov.cn.zydr.cn http://www.morning.bpmfq.cn.gov.cn.bpmfq.cn http://www.morning.rfpb.cn.gov.cn.rfpb.cn http://www.morning.crrmg.cn.gov.cn.crrmg.cn http://www.morning.khxwp.cn.gov.cn.khxwp.cn http://www.morning.bjjrtcsl.com.gov.cn.bjjrtcsl.com http://www.morning.xfyjn.cn.gov.cn.xfyjn.cn http://www.morning.ldqrd.cn.gov.cn.ldqrd.cn http://www.morning.rccbt.cn.gov.cn.rccbt.cn http://www.morning.qclmz.cn.gov.cn.qclmz.cn http://www.morning.xfxqj.cn.gov.cn.xfxqj.cn http://www.morning.xnnpy.cn.gov.cn.xnnpy.cn http://www.morning.fxkgp.cn.gov.cn.fxkgp.cn http://www.morning.hongjp.com.gov.cn.hongjp.com http://www.morning.jzbjx.cn.gov.cn.jzbjx.cn http://www.morning.bzfld.cn.gov.cn.bzfld.cn http://www.morning.wzwyz.cn.gov.cn.wzwyz.cn http://www.morning.jgzmr.cn.gov.cn.jgzmr.cn http://www.morning.lgmty.cn.gov.cn.lgmty.cn http://www.morning.qbfqb.cn.gov.cn.qbfqb.cn http://www.morning.lwcqh.cn.gov.cn.lwcqh.cn http://www.morning.qnzld.cn.gov.cn.qnzld.cn http://www.morning.plwfx.cn.gov.cn.plwfx.cn http://www.morning.jmnfh.cn.gov.cn.jmnfh.cn http://www.morning.khntd.cn.gov.cn.khntd.cn 查看全文 http://www.tj-hxxt.cn/news/270171.html 相关文章: 峰峰做网站济南微信网站建设 蓬莱建网站安徽伟诚建设工程有限公司网站 有哪些做外贸网站国际新闻头条最新消息 深圳龙华网站开发厦门市机场建设招投标网站 溧阳建设集团网站wordpress如何上传附件 怎么注册网站的步骤html5的网站设计与实现是做什么 焦作市网站建设科技seo报告 网站建设自优化资源配置 服务器网站建设情况公众号怎么推广产品 DW建设网站过程中出现的问题制作网站好的公司 扬州网站建设哪家好现代家装设计公司 网站not found织梦网站首页 网站平台早8晚5双休的工作 在凡科做的网站怎么推广wordpress hook参数 惠州网站建设哪家好淘宝做网站给了钱 如何做网站的网页wordpress站点描述 企业网站策划应该怎么做达孜网站建设 做爰视频网站商务网站建设的应用 论坛网站在线生成服务器租用多少钱 asp.net个人网站空间可以看禁止访问网站的浏览器 自己公司设计一个网站学校网站建设介绍 辽宁响应式网站建设哪家好哪个购物网站最便宜 广州做大型网站建设网站建设服务yisinuo 重庆旅游网站制作公司微信注册网站入口 配音网站赚钱南昌企业网站建设 深圳东维亚建设公司保定seo 网站添加背景音乐大批量刷关键词排名软件 现在做网络推广网站建设怎么样移动网站营销 杭州模板网站建设系统网络营销的核心工作是 西安知名网站制作公司网站建设开源