Giter VIP home page Giter VIP logo

m-gpt's Introduction

M-GPT v0.1.0

  1. feat: chinese to arabic number
  2. feat: remove spaces in query, like "你好 世界" -> "你好世界"
  3. fix: replacing " " with ", " breaks english sentence
  4. fix: wait time for xiaoai complete response is too long, 8s -> 1s

xiaogpt

Play ChatGPT with Xiaomi AI Speaker

image

准备

  1. ChatGPT id
  2. 小爱音响
  3. 能正常联网的环境或 proxy
  4. python3.8+

使用

  1. pip install -r requirements.txt
  2. 参考 MiService 项目 README 并在本地 terminal 跑 micli list 拿到你音响的 DID 成功 别忘了设置 export MI_DID=xxx 这个 MI_DID 用
  3. 参考 revChatGPT 项目 README 配置 chatGPT 的 config
  4. run python xiaogpt.py --hardware ${your_hardware} hardware 你看小爱屁股上有型号,输入进来
  5. 跑起来之后就可以问小爱同学问题了,“帮我回答开头的问题” 会发送一份给 ChatGPT 然后小爱同学用 tts 回答
  6. 如果你想用 conversation_id 来持续对话,可以加上 --conversation_id="xxxxxxxx"
  7. 如果上面不可用,可以尝试用手机抓包,https://userprofile.mina.mi.com/device_profile/v2/conversation 找到 cookie 利用 --cookie '${cookie}' cookie 别忘了用单引号包裹
  8. 默认用目前 ubus, 如果你的设备不支持 ubus 可以使用 --use_command 来使用 command 来 tts
  9. 使用 --mute_xiaoai 选项,可以让小爱不回答,但会频繁请求,玩一下可以使用,不建议一直用
  10. 使用 --account ‘${account}’ --password ‘${password}’ 可以不进行步骤 2
  11. 如果有能力可以自行替换唤醒词,也可以去掉唤醒词,源码 if query.find("帮我回答") != -1:

e.g.

python3 xiaogpt.py --hardware LX06;
# or
python3 xiaogpt.py --hardware LX06 --conversation_id="xxxxxxxx";
# or 
python3 xiaogpt.py --hardware LX06 --conversation_id="xxxxxxxx" --cookie ${cookie};
# 如果你想直接输入账号密码
python3 xiaogpt.py --hardware LX06 --conversation_id="xxxxxxxx" --account ${your_xiaomi_account} --password ${your_password};

QA

  1. 用破解么?不用
  2. 连不上 revChatGPT?国情,你得设置 proxy 并且该地区可用的 proxy
  3. 你做这玩意也没用啊?确实。。。但是挺好玩的,有用对你来说没用,对我们来说不一定呀
  4. 想把它变得更好?PR Issue always welcome.
  5. 还有问题?提 Issuse 哈哈

感谢

赞赏

谢谢就够了

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.