Comments (6)
未复现,请检查你的 API_KEY 是否可用。
from mi-gpt.
我刚刚用你上面发的 env 参数测试也是可以正常响应的。兄弟不要直接把 API Key 发出来,已经泄漏了,建议 revoke 掉。你可以 clone 下本仓库切换到最新的 example 分支,然后安装下依赖,再把你的 .env 配置好,在 VS Code 里按 F5 启动调试,看看是否正常。
好的,我按你的方法再试一下,这个key我会重新生成,没有关系
from mi-gpt.
检查你的 env 是否生效,我刚注册了 Moonshot 试了下,可以正常使用:
from mi-gpt.
未复现,请检查你的 API_KEY 是否可用。
刚用对话工具测试过key,是可用的,但是在node方式里,通过和小爱音箱的对话的方式使用会报错
我尝试过切换不同的服务,得到的鉴权失败信息有所不同,这说明是未能正确传递api_key
以下是我的月之暗面配置,
OPENAI_BASE_URL=https://api.moonshot.cn/v1
OPENAI_MODEL=moonshot-v1-8k
OPENAI_API_KEY=sk-TuKL1mvY2QXN8foNu0QSzL2Oa0pnlCirQ67YG9o7WRtpIvx9
2024/06/03 09:37:19 Open AI ❌ ❌ openai chat failed AuthenticationError: 401 Incorrect API key provided
at APIError.generate (file:///D:/document/Github/mi-gpt-2/node_modules/.pnpm/[email protected]/node_modules/openai/error.mjs:44:20)
at OpenAI.makeStatusError (file:///D:/document/Github/mi-gpt-2/node_modules/.pnpm/[email protected]/node_modules/openai/core.mjs:256:25)
at OpenAI.makeRequest (file:///D:/document/Github/mi-gpt-2/node_modules/.pnpm/[email protected]/node_modules/openai/core.mjs:299:30)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async OpenAIClient.chatStream (file:///D:/document/Github/mi-gpt-2/node_modules/.pnpm/[email protected]/node_modules/mi-gpt/dist/index.js:1086:20) {
status: 401,
headers: {
connection: 'keep-alive',
'content-length': '83',
'content-type': 'application/json; charset=utf-8',
date: 'Mon, 03 Jun 2024 01:37:18 GMT',
server: 'nginx',
'server-timing': 'inner; dur=37',
'strict-transport-security': 'max-age=15724800; includeSubDomains',
vary: 'Origin'
},
request_id: undefined,
error: {
message: 'Incorrect API key provided',
type: 'incorrect_api_key_error'
},
code: undefined,
param: undefined,
type: 'incorrect_api_key_error'
}
from mi-gpt.
我刚刚用你上面发的 env 参数测试也是可以正常响应的。兄弟不要直接把 API Key 发出来,已经泄漏了,建议 revoke 掉。你可以 clone 下本仓库切换到最新的 example 分支,然后安装下依赖,再把你的 .env 配置好,在 VS Code 里按 F5 启动调试,看看是否正常。
from mi-gpt.
跑不通,不折腾了
from mi-gpt.
Related Issues (20)
- 小米账号异地登录安全验证机制 验证后依然登录不了 HOT 1
- 调用mi-gpt-tts(火山引擎),单独内网测试tts都没问题,但是mi-git无法调用,是型号问题吗?一直报unWakeUp,然后没有声音 HOT 16
- 小米 sound pro 问题 HOT 4
- LLM 响应异常 BadRequestError: 400 Invalid parameter HOT 1
- text generation webui 的api无法使用 HOT 4
- throw new Errors.OpenAIError("The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'My API Key' })."); ^ HOT 4
- 其他品牌音箱适配问题 HOT 1
- 关于问他是哪个版本的GPT的问题 HOT 1
- 请问可以支持华为sound joy嘛 HOT 2
- docker镜像在arm设备上无法启动 HOT 1
- 能否支持多个小爱音箱? HOT 1
- docker无法登陆,触发小米账号异地登录安全验证机制 HOT 3
- docker提示错误:SyntaxError: Unexpected identifier 'wakeUpKeywords' HOT 1
- ❌ 找不到设备:小米AI音箱(第二代) HOT 2
- 关于小爱抢话是不是可以通过播放空白音频去抢占说话时机来解决
- 调用火山引擎(豆包)回答不正确 HOT 1
- 群晖NAS Container 无法启动 HOT 2
- 优化用户体验,无需主动唤醒 AI,只要小爱同学不知道怎么回答的时候,就主动去调用AI问答,可以实现吗? HOT 1
- 设置了模型,但是完全没有调用? HOT 1
- docker run error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mi-gpt.