用HarmonyOS元服务万能卡片训练一下文心一言的AIGC能力

鸿蒙时代
发布于 2023-4-18 10:21
浏览
1收藏

一、部分效果图展示

1.服务卡片

 用HarmonyOS元服务万能卡片训练一下文心一言的AIGC能力-鸿蒙开发者社区
2.AIGC服务

 用HarmonyOS元服务万能卡片训练一下文心一言的AIGC能力-鸿蒙开发者社区

二、DEMO说明

本Demo案例只是使用了HarmonyOS元服务卡片连接合规外网的能力进行AIGC元服务卡片概念演示,还不足以成为一个正式上架运营的元服务与万能卡片。

我们认为基于AIGC能力类型的HarmonyOS元服务万能卡片应该通过API方式调用合规训练后的各具特色的模型与角色来服务用户,通过万能卡片、智能语音、手势动作等更加自然友好的方式来和用户交互。

我们既对互联网、移动互联网的多种应用形式进行了HarmonyOS原子化服务卡片的尝试,也会基于AIGC对HarmonyOS元服务与万能卡片进行探索。特别期待的是盘古大模型对HarmonyOS元服务、应用的全面开放与支持。

三、部分代码

widget代码:
index.hml

<div class="container" onclick="routerEvent">
    <button class="btn" type="text" onclick="routerEvent">{{title}}</button>
</div>

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 服务"
  },
  "actions": {
    "routerEvent": {
      "action": "router",
      "bundleName": "com.example.aidemo.hmservice",
      "abilityName": "com.example.aidemo.MainAbility",
      "params": {
        "message": "add detail"
      }
    }
  }
}

2.page代码:

index.hml

<div >
    <web src="{{ 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

export default {
    data: {
        path: "https://yiyan.baidu.com/invitationCode"
    },
    reloadWeb() {
        this.$element('web').reload()
    },

    pageStart: function(e) {
        console.info('web pageStart: ' + e.url)
    },

    pageFinish: function(e) {
        console.info('web pageFinish: ' + e.url)
    },

    pageError: function(e) {
        console.info('web pageError url: ' + e.url)
        console.info('web pageError errorCode: ' + e.errorCode)
        console.info('web pageError description: ' + e.description)
    }
}

五、完整代码地址
https://gitee.com/jltfcloudcn/jump_to/tree/master/AiDemo

标签
用HarmonyOS元服务卡片训练一下文心一言的A.docx 1.11M 9次下载
2
收藏 1
回复
举报
3条回复
按时间正序
/
按时间倒序
鸿蒙时代
鸿蒙时代

看视频更清晰,HarmonyOS元服务卡片跑AIGC还是很顺畅的,​​平板模拟器演示效果:https://ost.51cto.com/show/23442​​ 

回复
2023-4-19 08:58:37
鸿蒙时代
鸿蒙时代

​https://ost.51cto.com/show/23443​​,在看看手机上跑的效果。

回复
2023-4-19 09:00:00
红叶亦知秋
红叶亦知秋

学习一波

回复
2023-4-19 15:13:35
回复
    相关推荐