Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No keys available #10

Open
mrahmadt opened this issue Aug 30, 2023 · 1 comment
Open

No keys available #10

mrahmadt opened this issue Aug 30, 2023 · 1 comment

Comments

@mrahmadt
Copy link

Hello

I'm just using the example code in README, and I keep getting this error, I added the key and I'm 100% sure about it, seems the database is not created/saved and I don't know what to do

    let bot = new ChatGPT(openAIAPIKeys, options);
    let conversationId = "conversation name";
    let response1 = await bot.ask("What is my first name?", conversationId);
    console.log(response1);
/node_modules/chatgpt-official/dist/classes/chatgpt.js:64
            throw new Error("No keys available.");
                  ^

Error: No keys available.
    at ChatGPT.getOpenAIKey (/node_modules/chatgpt-official/src/classes/chatgpt.ts:65:4)
    at ChatGPT.askStream (/node_modules/chatgpt-official/src/classes/chatgpt.ts:150:19)
    at ChatGPT.ask (/node_modules/chatgpt-official/src/classes/chatgpt.ts:146:3)
    at example (/test.ts:53:31)
    at /test.ts:87:5
    at /test.ts:88:1
    at ViteNodeRunner.directRequest (file:///node_modules/vite-node/dist/client.mjs:328:5)
    at ViteNodeRunner.cachedRequest (file:///node_modules/vite-node/dist/client.mjs:186:14)
    at ViteNodeRunner.executeFile (file:///node_modules/vite-node/dist/client.mjs:154:12)
    at CAC.run (file:///node_modules/vite-node/dist/cli.mjs:70:5)

Node.js v19.8.1
@seanconrad1
Copy link

also getting the above error message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants