AI 助手 UI 业务包

更新时间:2025-04-14 06:15:40下载pdf

简介

AI 助手 UI 业务包提供 AI 助手语音识别、内容生成和指令执行相关的能力。

接入

版本要求:v6.0.0 及以上。

在工程的 Podfile 文件中添加业务包组件,执行 pod update 命令。

source 'https://github.com/tuya/tuya-pod-specs.git'
source "https://github.com/TuyaInc/TuyaPublicSpecs.git"
source 'https://github.com/CocoaPods/Specs.git'

target 'your_target_name' do
  # 依赖 AI 助手业务包
  pod "ThingSmartAIAssistantBizBundle"
  # 需要依赖面板业务包
  pod 'ThingSmartPanelBizBundle'
end

注意事项

使用语音识别功能,需要在 info.plist 中设置 NSMicrophoneUsageDescription

<key>NSMicrophoneUsageDescription</key>
<string>进行 AI 对话</string>

使用

  1. 生成 AI 助手小程序。关于创建智能体,请参考 智能体开发平台

  2. 打开 AI 助手小程序。

    import ThingModuleManager
    
    func gotoAIAssistant() {
        let link: String = "your ai assistant miniapp url"
        let impl = ThingSmartBizCore.sharedInstance().service(of: ThingModuleRouteBlueprint.self)
        let _ = (impl as AnyObject).openRoute(link, withParams: nil)
    }
    

获取小程序链接,需要手动解析调试二维码,并删除链接中的 tuyaSmart– 前缀。关于调试二维码,参考 智能体开发平台 > 调试