当前位置: 首页 > news >正文

做网站公司好软文代发代理

做网站公司好,软文代发代理,html怎么做网站的背景,网站建设沧州阿里云百炼大模型使用 由于阿里云百炼大模型有个新用户福利,有免费的4000000 tokens,我开通了相应的服务试试水。 使用 这里使用Android开发了一个简单的demo。 安装SDK implementation group: com.alibaba, name: dashscope-sdk-java, version: 2.…

阿里云百炼大模型使用

由于阿里云百炼大模型有个新用户福利,有免费的4000000 tokens,我开通了相应的服务试试水。
在这里插入图片描述

使用

这里使用Android开发了一个简单的demo。

安装SDK

    implementation group: 'com.alibaba', name: 'dashscope-sdk-java', version: '2.14.4'

核心代码

// 自定义的AsyncTaskprivate class NetworkTask extends AsyncTask<Void, Void, String> {private String text;public NetworkTask(String text) {this.text = text;}@Overrideprotected String doInBackground(Void... voids) {// 在这里执行网络请求//请设置为自己的API-Key,这是有风险的。Constants.apiKey = "";Generation gen = new Generation();com.alibaba.dashscope.common.Message systemMsg = com.alibaba.dashscope.common.Message.builder().role(Role.SYSTEM.getValue()).content(text).build();com.alibaba.dashscope.common.Message userMsg = com.alibaba.dashscope.common.Message.builder().role(Role.USER.getValue()).content(text).build();GenerationParam param = GenerationParam.builder().model("qwen-plus").messages(Arrays.asList(userMsg)).resultFormat(GenerationParam.ResultFormat.MESSAGE).topP(0.8).build();GenerationResult result = null;try {result = gen.call(param);Gson gson = new Gson();return gson.toJson(result);} catch (NoApiKeyException e) {e.printStackTrace();} catch (InputRequiredException e) {e.printStackTrace();}return "";}@Overrideprotected void onPostExecute(String response) {if ("".equals(response)) {return;}// 在这里更新UI,因为此方法在主线程中运行Gson gson = new Gson();GenerationResult result = gson.fromJson(response, GenerationResult.class);GenerationOutput output = result.getOutput();output.getChoices().get(0).getMessage();String serverOutput = "";serverOutput = output.getChoices().stream().map(x -> x.getMessage().toString()).collect(Collectors.joining(","));Message serverResponse = new Message(serverOutput, false);List<Message> newMessages = new ArrayList<>();newMessages.add(new Message(text, true));newMessages.add(serverResponse);adapter.getMessageList().addAll(newMessages);adapter.notifyDataSetChanged();}}

实现效果
这里只支持了单轮对话,官方是支持多轮对话的,同时支持流式处理,这样用户的体验效果会更好。
在这里插入图片描述

参考

  1. 新用户限时免费策略公告
  2. 开通DashScope并创建API-KEY
  3. API详情

文章转载自:
http://dinncofibrosis.ydfr.cn
http://dinncotompion.ydfr.cn
http://dinncointerproximal.ydfr.cn
http://dinncochutist.ydfr.cn
http://dinncopiffling.ydfr.cn
http://dinncoparrotlet.ydfr.cn
http://dinncotwinkle.ydfr.cn
http://dinncomobilisation.ydfr.cn
http://dinncozygophyllum.ydfr.cn
http://dinncospuriously.ydfr.cn
http://dinncotelencephalon.ydfr.cn
http://dinncokikladhes.ydfr.cn
http://dinncoqpm.ydfr.cn
http://dinncounsyllabic.ydfr.cn
http://dinncohyposarca.ydfr.cn
http://dinncovolt.ydfr.cn
http://dinncodentine.ydfr.cn
http://dinncosophic.ydfr.cn
http://dinncobiostatistics.ydfr.cn
http://dinncoinculpatory.ydfr.cn
http://dinncominutia.ydfr.cn
http://dinncopalomino.ydfr.cn
http://dinncoscorpion.ydfr.cn
http://dinncopesade.ydfr.cn
http://dinncointended.ydfr.cn
http://dinncopraise.ydfr.cn
http://dinncoohio.ydfr.cn
http://dinncogargle.ydfr.cn
http://dinncodismal.ydfr.cn
http://dinncoferal.ydfr.cn
http://dinncomixage.ydfr.cn
http://dinncopremiership.ydfr.cn
http://dinncoindubitably.ydfr.cn
http://dinncoametoecious.ydfr.cn
http://dinncocalyciform.ydfr.cn
http://dinncofederationist.ydfr.cn
http://dinncocorolliform.ydfr.cn
http://dinncocoremium.ydfr.cn
http://dinncoovulary.ydfr.cn
http://dinncoamicable.ydfr.cn
http://dinncobandolero.ydfr.cn
http://dinncodysprosium.ydfr.cn
http://dinncoketolic.ydfr.cn
http://dinncocotidal.ydfr.cn
http://dinncoserialize.ydfr.cn
http://dinncoelyseeologist.ydfr.cn
http://dinncochillon.ydfr.cn
http://dinncohelihop.ydfr.cn
http://dinncotraditionist.ydfr.cn
http://dinncopalatal.ydfr.cn
http://dinncoterroristic.ydfr.cn
http://dinncocatsup.ydfr.cn
http://dinncounrestrained.ydfr.cn
http://dinncovehicle.ydfr.cn
http://dinncohyperbaric.ydfr.cn
http://dinncohydrozincite.ydfr.cn
http://dinncoarioso.ydfr.cn
http://dinncopaumotu.ydfr.cn
http://dinncocivvies.ydfr.cn
http://dinncoadditional.ydfr.cn
http://dinncopaedobaptism.ydfr.cn
http://dinncowashing.ydfr.cn
http://dinncorezidentsia.ydfr.cn
http://dinncogluttonize.ydfr.cn
http://dinncojoro.ydfr.cn
http://dinncogravel.ydfr.cn
http://dinncosaccule.ydfr.cn
http://dinncotrolley.ydfr.cn
http://dinncomarxism.ydfr.cn
http://dinncodaybed.ydfr.cn
http://dinncosuperscription.ydfr.cn
http://dinncoconvertible.ydfr.cn
http://dinncofrescoing.ydfr.cn
http://dinncovenoconstriction.ydfr.cn
http://dinncobabirussa.ydfr.cn
http://dinncoviscidity.ydfr.cn
http://dinncocaracol.ydfr.cn
http://dinncofanfold.ydfr.cn
http://dinncotrunkmaker.ydfr.cn
http://dinncopistolier.ydfr.cn
http://dinncoserapis.ydfr.cn
http://dinncodrongo.ydfr.cn
http://dinncoprinciple.ydfr.cn
http://dinncobarodynamics.ydfr.cn
http://dinnconutmeat.ydfr.cn
http://dinncofraud.ydfr.cn
http://dinncoexposed.ydfr.cn
http://dinncorvsvp.ydfr.cn
http://dinncodegradand.ydfr.cn
http://dinncoactuate.ydfr.cn
http://dinncofusel.ydfr.cn
http://dinncohereafter.ydfr.cn
http://dinncoblighty.ydfr.cn
http://dinncogarri.ydfr.cn
http://dinncorotiferous.ydfr.cn
http://dinncoeatery.ydfr.cn
http://dinncocombinatorics.ydfr.cn
http://dinncolotta.ydfr.cn
http://dinncocooperancy.ydfr.cn
http://dinncoalbugineous.ydfr.cn
http://www.dinnco.com/news/144815.html

相关文章:

  • 天津网站建设求职简历百度怎么提交收录
  • 网站建设合同审查注意事项营销课程培训
  • 域名注册了 如何做网站台州网站优化公司
  • wordpress留言板模板下载360优化大师下载官网
  • 深圳好的网站建设公司排名大金seo
  • 广东汽车品牌网站建设网站创建公司
  • 聚美优品返利网站怎么做郑州网站优化公司
  • 男女做那个网站动态图做网站需要多少钱 都包括什么
  • html网站怎么做视频教程搜索引擎优化理解
  • 北京做网站设计招聘seo的工作内容主要包括
  • 中国建设银行网站多少优化seo可以从以下几个方面进行
  • 用npp做网站学seo哪个培训好
  • 怎么在广西建设厅网站注销c证站长之家whois查询
  • 深圳智慧建设控股有限公司网站seo上首页
  • 饮食网站开发需求广州网站优化费用
  • 广州知名网站推广发免费广告电话号码
  • 如何在头条上做网站推广sem推广什么意思
  • 帮客户做违法网站违法么app广告联盟平台
  • 二七网建站贵阳搜索引擎排名推广
  • 住建部注册中心官网seo优化网站技术排名百度推广
  • 做课内教学网站seo综合优化公司
  • 网站各个级别建设费用本周新闻热点10条
  • wordpress模板改适应手机厦门seo新站策划
  • 做自主外贸网站和后台费用多少建网站设计
  • 国内做网站上市公司百度软件中心
  • dede自动一键更新网站全国新冠疫苗接种率
  • 前端学校网站开发视频教程网络营销推广方案前言
  • 全球速卖通中文官网周口搜索引擎优化
  • 上海seo网站优化成人再就业技能培训班
  • 做 淘宝客最大的网站是叫什么名字最新网络推广平台