链接:
https://mp.weixin.qq.com/s?__biz=MzI1NTIzMTk0Ng==&mid=2247484882&idx=1&sn=18ca197854a046f7ec8b5a6ba1651c44&chksm=ea385777dd4fde619896affc7e678970418d81d784aa2c00ad999286cf5ec376cc16e7fd5446&mpshare=1&scene=1&srcid=0918IZleTEJSS4ubL8epY4uR&sharer_shareinfo=dc11927f5f136aeb09f87452ad5088c2&sharer_shareinfo_first=dc11927f5f136aeb09f87452ad5088c2&exportkey=n_ChQIAhIQNNuL4kkKQN1EsdWf4%2B3yixKZAgIE97dBBAEAAAAAADv0OXOWGcMAAAAOpnltbLcz9gKNyK89dVj07Y5pxnBi3l6TV9ZaURj1eCtBjp3iptCj6Q5T7rAUVLbouDQk5A%2FHcmbeT1EB6T1PKyOoxyWvKiupogHKNPRcVDMP%2BdTSnz8WqDG%2Bn8F8uZvxwrXAyB%2FDOxn4YYjFaj4J%2FNWGKZaQA%2FGICdid0TajRc3BYSCFo9feBSbBeWGNW9V0hEO660WcB74qYprh7F2rEEDEwMuxuWF5GY%2F4tRCjKRCy1%2BG4h6gPlgxTIrElPNHQWnoyfvbUxzTvlO1x012%2FrZf9km2%2FnNHe4Bg3efYaeD7d7zJdpMdActyGqdiBCR%2F73AWaEWBOs6wsmUApBmOkRSgP&acctmode=0&pass_ticket=zRMUtVnhcwLKUIruIpGwc1lN%2FFD%2B%2BWPwqO%2Fc1xmU2mqlToaVX5HJ2IjBR8AFGsCH&wx_header=0#rd
ChatGPT
ChatGPT(Chat Generative Pre-trained Transformer)是 OpenAI公司开发的、基于深度学习构建的、一种大型自然语言处理模型, 简单的说,它能理解人类输入的语言,然后根据自己的所掌握的知识,输出相应的回答或者解释。更多参考:https://openai.com/chatgpt
可以借助ChatGPT来控制IoT设备,其直观强大的交互能力,是语音助手无法比拟的,例如,我们可能只说,“房间有些暗”,灯就能自动调节亮度。“屋里有些热”,空调温度就会自动调低一些。
典型的IoT设备接入云的方式
接入Chat GPT
一种接入Chat GPT的方式实现如下,例如,我们可以基于AWS 云接入OpenAI平台,
chat API如下:
为了能使用ChatGPT,我们需要对ChatGPT进行配置。在配置阶段,当prompt和context设置的足够清晰时,返回到IoT设备才会越明确,例如限定ChatGPT充当的角色,限制回复的内容,以及内容格式。一个使用例子如下:
Context:
You are the controller of my home lighting system , I will ask you a question, Do not explain, just give your answer. Your reply should follow CLIP API REST call.
Here is the datails of my home:
- light in bedroom with ID 1
- light in the living room with id 2
Here is an example:
Query: Turn on the light in the bedroom
Answer:
{
"method":"PUT"
"url": "https:/ip/api/light"
"data": {"id":1, "on":true}
"response": "Done, light in the bedroom is on now"
}
参考:
https://github.com/openai/openai-cookbook/blob/main/examples/How_to_format_inputs_to_ChatGPT_models.ipynb
https://platform.openai.com/overview
标签:light,IoT,openai,https,ChatGPT,com,设备 From: https://www.cnblogs.com/someone-device/p/17713163.html