部分效果圖展示如下:
![da6667f0-e307-11ed-ab56-dac502259ad0.png](https://file1.elecfans.com//web2/M00/9A/05/wKgZomTnkz2ATDECAAJy1oVXJFU852.png)
服務(wù)卡片
AIGC 服務(wù)
DEMO 說明
本 Demo 案例只是使用了 HarmonyOS 元服務(wù)卡片連接合規(guī)外網(wǎng)的能力進(jìn)行 AIGC 元服務(wù)卡片概念演示,還不足以成為一個(gè)正式上架運(yùn)營的元服務(wù)與萬能卡片。
我們認(rèn)為基于 AIGC 能力類型的 HarmonyOS 元服務(wù)萬能卡片應(yīng)該通過 API 方式調(diào)用合規(guī)訓(xùn)練后的各具特色的模型與角色來服務(wù)用戶,通過萬能卡片、智能語音、手勢動(dòng)作等更加自然友好的方式來和用戶交互。
我們既對互聯(lián)網(wǎng)、移動(dòng)互聯(lián)網(wǎng)的多種應(yīng)用形式進(jìn)行了 HarmonyOS 原子化服務(wù)卡片的嘗試,也會(huì)基于 AIGC 對 HarmonyOS 元服務(wù)與萬能卡片進(jìn)行探索。
特別期待的是盤古大模型對 HarmonyOS 元服務(wù)、應(yīng)用的全面開放與支持。
部分代碼
①widget代碼
index.hml:index.css:
.container{
flex-direction:column;
justify-content:flex-end;
align-items:center;
width:100%;
height:100%;
background-repeat:no-repeat;
background-image:url('/common/ai.jpg');
background-size:cover;
}
.btn{
font-size:16px;
font-weight:bold;
text-color:#fffff869;
}
index.json:
{
"data":{
"title":"AI服務(wù)"
},
"actions":{
"routerEvent":{
"action":"router",
"bundleName":"com.example.aidemo.hmservice",
"abilityName":"com.example.aidemo.MainAbility",
"params":{
"message":"adddetail"
}
}
}
}
②page 代碼
index.hml:
<div>
<websrc="{{path}}"onpagestart="pageStart"onpagefinish="pageFinish"on:error="pageError">web>
div>
index.css:
.container{
flex-direction:column;
justify-content:center;
align-items:center;
width:100%;
height:100%;
}
index.js:
exportdefault{
data:{
path:"https://yiyan.baidu.com/invitationCode"
},
reloadWeb(){
this.$element('web').reload()
},
pageStart:function(e){
console.info('webpageStart:'+e.url)
},
pageFinish:function(e){
console.info('webpageFinish:'+e.url)
},
pageError:function(e){
console.info('webpageErrorurl:'+e.url)
console.info('webpageErrorerrorCode:'+e.errorCode)
console.info('webpageErrordescription:'+e.description)
}
}
完整代碼地址如下:
https://gitee.com/jltfcloudcn/jump_to/tree/master/AiDemo
關(guān)注我們
審核編輯 :李倩
-
智能語音
+關(guān)注
關(guān)注
10文章
789瀏覽量
48920 -
HarmonyOS
+關(guān)注
關(guān)注
79文章
1983瀏覽量
30630 -
文心一言
+關(guān)注
關(guān)注
0文章
125瀏覽量
1335 -
AIGC
+關(guān)注
關(guān)注
1文章
367瀏覽量
1618
原文標(biāo)題:HarmonyOS服務(wù)卡片跑AIGC
文章出處:【微信號:gh_834c4b3d87fe,微信公眾號:OpenHarmony技術(shù)社區(qū)】歡迎添加關(guān)注!文章轉(zhuǎn)載請注明出處。
發(fā)布評論請先 登錄
相關(guān)推薦
HarmonyOS原子化服務(wù)卡片應(yīng)用場景探索公開課部分問題回答
#HarmonyOS征文#HarmonyOS原子化服務(wù)-美食卡片嘗試
一文看懂HarmonyOS服務(wù)卡片運(yùn)行原理和開發(fā)方法
HarmonyOS服務(wù)卡片動(dòng)手實(shí)驗(yàn)室資料
HarmonyOS卡片開發(fā)--服務(wù)卡片概述
HarmonyOS服務(wù)卡片開發(fā)-API接口簡析
HarmonyOS之服務(wù)卡片(Java)開發(fā)步驟
HarmonyOS原子化服務(wù)案例分享-蛟龍服務(wù)
用HarmonyOS元服務(wù)萬能卡片訓(xùn)練一下文心一言的AIGC能力
HarmonyOS原子化服務(wù)卡片整改、下架、升級失敗部分原因及處理辦法
HarmonyOS元服務(wù)開發(fā)實(shí)踐:桌面卡片字典
華為開發(fā)者HarmonyOS零基礎(chǔ)入門:15分鐘玩轉(zhuǎn)harmonyOS服務(wù)卡片
![華為開發(fā)者<b class='flag-5'>HarmonyOS</b>零基礎(chǔ)入門:15分鐘玩轉(zhuǎn)<b class='flag-5'>harmonyOS</b><b class='flag-5'>服務(wù)</b><b class='flag-5'>卡片</b>](https://file.elecfans.com/web2/M00/19/1D/poYBAGFzg3WAFbCyAAZsF7mKSEg340.png)
評論