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

TODO #1

Closed
3 tasks
transitive-bullshit opened this issue Dec 3, 2022 · 10 comments
Closed
3 tasks

TODO #1

transitive-bullshit opened this issue Dec 3, 2022 · 10 comments

Comments

@transitive-bullshit
Copy link
Owner

  • Add message and conversation IDs
  • Add support for streaming responses
  • Add basic unit tests
@monomy001
Copy link

It would also be a great idea if you can pass in like GPT3 api key or something on the initialization part.
ie: const api = new ChatGPTAPI('API KEY HERE');

Right now as is, i cant login.
node:internal/process/promises:246
triggerUncaughtException(err, true /* fromPromise */);
^

page.$: Execution context was destroyed, most likely because of a navigation
at y._getInputBox (file:///home/chilly/Projects/Testing/node_modules/chatgpt/build/index.js:1:3336)
at y.getIsSignedIn (file:///home/chilly/Projects/Testing/node_modules/chatgpt/build/index.js:1:2091)
at y.init (file:///home/chilly/Projects/Testing/node_modules/chatgpt/build/index.js:1:1935)
at async answer (file:///home/chilly/Projects/Testing/chat.mjs:5:5) {
name: 'Error'
}

When I run your code, it only opens a browser that shows openAI login. when i click login button, this error happens.

@transitive-bullshit
Copy link
Owner Author

@monomy001 thanks for letting me know; I was mainly testing the already authenticated codepaths. Working on a fix now.

@transitive-bullshit
Copy link
Owner Author

@monomy001 I fixed several bugs related to the initial auth flow.

Here's a demo video showing how the initial auth flow works (29 seconds): https://www.loom.com/share/0c44525b07354d679f30c45d8eec6271

And here's a demo video showing how it works once you're already authenticated (13 seconds): https://www.loom.com/share/98e712dbddf843289e2b6615095bbdd7

@zenxds
Copy link

zenxds commented Dec 7, 2022

  • Add message and conversation IDs
  • Add support for streaming responses
  • Add basic unit tests
  • add proxy option for fetch

I want to visit chatgpt with a proxy,can you add an option for it

@transitive-bullshit
Copy link
Owner Author

@zenxds that's the plan. Tracking this in #47

@monomy001
Copy link

Here's a demo video showing how the initial auth flow works (29 seconds): https://www.loom.com/share/0c44525b07354d679f30c45d8eec6271
And here's a demo video showing how it works once you're already authenticated (13 seconds): https://www.loom.com/share/98e712dbddf843289e2b6615095bbdd7

Thanks Travis, I'm not sure if the screen cast is still relevant though.. seeing its been a week since i last visited this webpage.
I tried following the usage instruction on github landing page, and am stumbling across another issue.

Access to fetch at 'https://chat.openai.com/api/auth/session' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
chatgpt-api.ts:242
GET https://chat.openai.com/api/auth/session net::ERR_FAILED 200

It seems to have sent the GET request successfully. I am trying to implement this into a nodejs capacitor hybrid apps.
any advise?

@transitive-bullshit
Copy link
Owner Author

@monomy001 this package is not meant to be used rom client-side browser. It's intended to be used from the server-side, where there won't be CORS issues.

@transitive-bullshit
Copy link
Owner Author

And yes, those demo videos are for pre-v1.0.0 when this package was using playwright to automate the webapp. Now, there's no need for a browser.

@monomy001
Copy link

alright, thanks for the pointer, Travis.
and I am really sorry for coming back at this.. hahah..

I have tried porting chatGPT to an express nodejs server i have running.
when i do a const chatgpt = require('chatgpt'); it now throws an error :
Error [ERR_REQUIRE_ESM]: require() of ES Module node_modules/chatgpt/build/index.js from route-chat.js not supported.

Are you still open to allow new contributor to help tweak this chatGPT?
If OK with you, I'd like to join as contributor to improve your project, although at the moment i'm not very sure how to adjust this to accommodate express.

@transitive-bullshit
Copy link
Owner Author

@monomy001 please search the repo before posting questions. There have been quite a few people who've had your same question about ERR_REQUIRE_ESM, and I've answered them all with the same advice.

transitive-bullshit pushed a commit that referenced this issue Dec 14, 2022
danielfomin96 pushed a commit to danielfomin96/chatgpt-api that referenced this issue Jan 29, 2023
cyhhao pushed a commit to cyhhao/chatgpt-api that referenced this issue Feb 8, 2023
cyhhao pushed a commit to cyhhao/chatgpt-api that referenced this issue Feb 8, 2023
transitive-bullshit pushed a commit that referenced this issue Feb 21, 2023
add DomainGPT as an interesting use case for chatgpt-api
SmileSmith pushed a commit to SmileSmith/chatgpt-api that referenced this issue Apr 7, 2023
mi-ann0613 pushed a commit to mi-ann0613/chatgpt-api that referenced this issue May 9, 2024
add DomainGPT as an interesting use case for chatgpt-api
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

3 participants