💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
## 4.7 多种回答方式 >本节主要介绍如何使机器人的回答丰富多样。包含图片、音频、视频、图文等多种素材的上传使用,支持自定义素材。 场景意图中的机器人答支持多种回答方式,可以返回文本、图片、音频、视频、图文(仅限于微信)。 ### 4.7.1 微信素材使用 微信素材的使用分为两种: + 第一种,微信授权后,使用授权微信公众号的素材库 ![](http://gitlab.ruyi.ai/ruyi-ai/ruyi-fuwu/uploads/fdcd90ece2393fdd131fa000036f38ed/1.png) + 第二种,自定义机器人答微信端素材(自定义图片、音频、视频的操作方式与硬件素材使用相同,详情请看硬件素材使用)。 ![](http://gitlab.ruyi.ai/ruyi-ai/ruyi-fuwu/uploads/e2f1ccc343d2ccf72960f21ba53bf94f/1.png) ![](http://gitlab.ruyi.ai/ruyi-ai/ruyi-fuwu/uploads/853657fee100cdd56ed8d7491328f380/2.png) ### 4.7.2 硬件素材使用 用户在开发者后台自建意图的机器人答中,如下图示意使用自定义素材。 + 点击使用硬件素材 ![](http://gitlab.ruyi.ai/ruyi-ai/ruyi-fuwu/uploads/6f83b1b42fc84325cbc84b6f023f1026/1.png) + 上传图片、音频、视频素材后,选择使用 ![](http://gitlab.ruyi.ai/ruyi-ai/ruyi-fuwu/uploads/6eb0c71930b09cf4337a0faee4231e45/1.png) + 输入名称和url,设置自定义图片、音频、视频 ![](http://gitlab.ruyi.ai/ruyi-ai/ruyi-fuwu/uploads/22015b3f173a61f076bae2c35240a477/1.png) ![](http://gitlab.ruyi.ai/ruyi-ai/ruyi-fuwu/uploads/436a872c23ec93b14928f63504328b54/3.png) ![](http://gitlab.ruyi.ai/ruyi-ai/ruyi-fuwu/uploads/3ff164657435cc432d277dd598e9d7f4/4.png) 之后就可在返回json中按需求解析素材使用,示意如下。 自定义图片调用 ``` { "_text": "我要看图片", "msg_id": "0da813ec-e0ba-4242-a5b6-59635c965160", "intents": [ { "parameters": {}, "name": "我要看图片", "result": { "text": "hello", "type": "dialog" }, "outputs": [ { "type": "wechat.text", "property": { "text": "hello" } }, { "type": "image", "property": { "name": "小兔子", "image_url": "http://image.so.com/v?q=小兔子&cmsid=586f94b58e0737108deccae81aa95b73&cmran=0&cmras=0&i=0&cmg=87c95995a71d98ac5185102a7b500ab9&src=360pic_strong&z=1#q=%E5%B0%8F%E5%85%94%E5%AD%90&i=0&src=360pic_strong&z=1&lightboxindex=0&id=5c06b8456556b356ac8a7783b0d789db&multiple=0&itemindex=0&dataindex=0&prevsn=0&currsn=0" } } ], "score": "1.0", "scoreColor": "c4", "is_match": 1, "id": "8782516e-db76-4eaa-83cd-4182f92c20bb", "action": "dialog" } ], "meta_process_milliseconds": 38 } ``` 自定义音频调用 ``` { "_text": "我要听音频", "msg_id": "5ea21cde-d461-4133-90ff-acdbea403576", "intents": [ { "parameters": {}, "name": "我要听音频", "result": { "text": "hello", "type": "dialog" }, "outputs": [ { "type": "wechat.text", "property": { "text": "hello" } }, { "type": "voice", "property": { "name": "下雨声", "voice_url": "http://www.ximalaya.com/1000294/sound/240732" } } ], "score": "1.0", "scoreColor": "c4", "is_match": 1, "id": "8782516e-db76-4eaa-83cd-4182f92c20bb", "action": "dialog" } ], "meta_process_milliseconds": 60 } ``` 自定义视频调用 ``` { "_text": "我要看视频", "msg_id": "bf6739e5-b273-49e4-884b-af8657c38791", "intents": [ { "parameters": {}, "name": "我要看视频", "result": { "text": "hello", "type": "dialog" }, "outputs": [ { "type": "wechat.text", "property": { "text": "hello" } }, { "type": "video", "property": { "name": "ruyi.ai干货-人工智能关键技术", "video_url": "http://video.tudou.com/v/XMjY0Mzc1NTY3Ng==.html?spm=a2h0k.8191414.0.0&from=s1.8-1-1.2" } } ], "score": "1.0", "scoreColor": "c4", "is_match": 1, "id": "8782516e-db76-4eaa-83cd-4182f92c20bb", "action": "dialog" } ], "meta_process_milliseconds": 61 } ```