Git Product home page Git Product logo

Comments (6)

idootop avatar idootop commented on July 28, 2024 1

未复现,请检查你的 API_KEY 是否可用。

from mi-gpt.

csjuXYZ avatar csjuXYZ commented on July 28, 2024 1

我刚刚用你上面发的 env 参数测试也是可以正常响应的。兄弟不要直接把 API Key 发出来,已经泄漏了,建议 revoke 掉。你可以 clone 下本仓库切换到最新的 example 分支,然后安装下依赖,再把你的 .env 配置好,在 VS Code 里按 F5 启动调试,看看是否正常。

好的,我按你的方法再试一下,这个key我会重新生成,没有关系

from mi-gpt.

idootop avatar idootop commented on July 28, 2024

检查你的 env 是否生效,我刚注册了 Moonshot 试了下,可以正常使用:
图片

from mi-gpt.

csjuXYZ avatar csjuXYZ commented on July 28, 2024

未复现,请检查你的 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.

idootop avatar idootop commented on July 28, 2024

我刚刚用你上面发的 env 参数测试也是可以正常响应的。兄弟不要直接把 API Key 发出来,已经泄漏了,建议 revoke 掉。你可以 clone 下本仓库切换到最新的 example 分支,然后安装下依赖,再把你的 .env 配置好,在 VS Code 里按 F5 启动调试,看看是否正常。

from mi-gpt.

csjuXYZ avatar csjuXYZ commented on July 28, 2024

跑不通,不折腾了

from mi-gpt.

Related Issues (20)

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.