Skip to content
/ xiaogpt Public
forked from yihong0618/xiaogpt

play chatgpt with xiaomi ai speaker

Notifications You must be signed in to change notification settings

yolain/xiaogpt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xiaogpt

让小爱同学使用ChatGpt来回答

image

前言

由于我的设备是L05C,使用 原项目 大佬的版本会出现些许问题,想说自己简化一下。目前替换成了流式对话的API也保留了持续唤醒小爱的功能。 如果使用的是国内转发的baseurl是无法使用流式对话的,会按原来的方式输出结果。

原理 —— 大佬的灵光乍现

不用 root 使用小爱同学和 ChatGPT 交互折腾记

准备

  1. ChatGPT id
  2. 小爱音响(需开启蓝牙)
  3. 能正常联网的环境或 proxy
  4. python3.8+

使用

  1. pip install -r requirements.txt
  2. 在项目根目录创建一个config.json文件配置参数 (目前已知 LX04 和 L05B L05C 可能需要将 use_command 为 true才能正常播放)
{
  "hardware": "", 
  "account": "", 
  "password": "", 
  "openai_key": "", 
  "openai_baseurl": "https://api.openai.com", 
  "use_command": false, 
  "keep_chat": true,
  "end_prompt": "请在50字以内回答"
}
  1. keep_chat 为 true 时,可以不用一直唤醒小爱,否则它只会回答一次
  2. 运行项目
python xiaogpt.py

感谢

About

play chatgpt with xiaomi ai speaker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%