🏠 将小爱音箱接入 ChatGPT 和豆包,改造成你的专属语音助手。
Go to file
2025-04-14 16:42:38 +08:00
.vscode fix: init db 2024-06-03 00:25:29 +08:00
.gitignore fix: init db 2024-06-03 00:25:29 +08:00
index.ts chore: 更新 MiGPT 至 v4.0.0 2024-06-18 01:30:55 +08:00
package.json chore: 更新 MiGPT 至 v4.2.0 2024-08-26 21:52:44 +08:00
pnpm-lock.yaml chore: 更新 MiGPT 至 v4.2.0 2024-08-26 21:52:44 +08:00
README.md fix: 增加安装依赖后需要执行构建依赖命令 (#321) 2025-04-14 16:42:38 +08:00
tsconfig.json chore: 更新 MiGPT 至 v4.0.0 2024-06-18 01:30:55 +08:00

MiGPT

npm version

首先,安装依赖

pnpm install

安装依赖时候出现Warning:

╭ Warning-───────────────────────────────────────────────────────────────────────────────────╮
│                                                                                            │
│   Ignored build scripts: @prisma/client, @prisma/engines, esbuild, mi-gpt, prisma.         │
│   Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts.   │
│                                                                                            │
╰────────────────────────────────────────────────────────────────────────────────────────────╯

请按照提示执行命令构建依赖:

pnpm approve-builds

然后,创建并启动 MiGPT 实例,查看如何「配置参数」

// index.ts
import { MiGPT } from "mi-gpt";

async function main() {
  const client = MiGPT.create({
    speaker: {
      userId: process.env.MI_USER,
      password: process.env.MI_PASS,
      did: process.env.MI_DID,
    },
  });
  await client.start();
}

main();

配置完成后,启动项目。

pnpm run start