transitive-bullshit / agentic

AI agent stdlib that works with any LLM and TypeScript AI SDK.
https://agentic.so
MIT License
16.26k stars 2.13k forks source link

TODO #1

Closed transitive-bullshit closed 1 year ago

transitive-bullshit commented 1 year ago
monomy001 commented 1 year ago

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 commented 1 year ago

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

transitive-bullshit commented 1 year ago

@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 commented 1 year ago
  • [ ] Add message and conversation IDs
  • [ ] Add support for streaming responses
  • [ ] Add basic unit tests

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

transitive-bullshit commented 1 year ago

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

monomy001 commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

@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.