Closed mefengl closed 1 year ago
btw your existing ID assignment to elements don't always work because DOM finishes loading + changes after lib loads. Also if other scripts are using those variable names, it will break both scripts (that's why I enclose in IIFE to keep variables scoped and prevent global pollution, coder needs to decide what to name var's instead of breaking scripts + they can use get() in their own mutation observers to avoid DOM problem)
Yes, cause the buttons or elements showing or not is depend on the status, this repo can update the id dynamic when the status change or only give the get() function.
So write the get() function for this issue first instead of labelling
Yes and in future we can implement status checking but the variable assignment would need to be chatgpt.buttonName format, and we keep get(buttonName) for those who want to do it their own way
I wrote getResponse(pos)
(https://github.com/chatgptjs/chatgpt.js/commit/90d975f5ba971ac65bc8cde54c2c70e745d3ccc9)
To use,
chatgpt.getResponse(3) // get 3rd response
chatgpt.getResponse('33rd') // get 33rd response
chatgpt.getResponse('thirteen') // get 13th response
...but for words it doesn't do 'thirty-three' yet (otherwise the logic gets too unnecessarily long for a chatgpt lib)
You may be a fan of ruby on rails
causes you provide many ways to do one thing. To me, I may only add getResponseNumber(3)
...but for words it doesn't do 'thirty-three' yet (otherwise the logic gets too unnecessarily long for a chatgpt lib)
You know what, if we like, we can let chatgpt decide how to call which function, then even getResponse('the one after 32')
will work
but that may be too slow
You may be a fan of
ruby on rails
causes you provide many ways to do one thing. To me, I may only add getResponseNumber(3)
I am not a fan of ruby on rails because it is a hipster language. I indeed like to provide flexibility because i always have target user in mind (in this case, lazy coder who doesn't read docs)
...but for words it doesn't do 'thirty-three' yet (otherwise the logic gets too unnecessarily long for a chatgpt lib)
You know what, if we like, we can let chatgpt decide how to call which function, then even
getResponse('the one after 32')
will workbut that may be too slow
Wait that's a good idea, chatgpt seems to remembers its responses but I'm not sure if it indexes
I just tested it, sometimes it doesn't go far back enough and sometimes it provides a similar but different response
You may be a fan of
ruby on rails
causes you provide many ways to do one thing. To me, I may only add getResponseNumber(3)I am not a fan of ruby on rails because it is a hipster language. I indeed like to provide flexibility because i always have target user in mind (in this case, lazy coder who doesn't read docs)
then the way to do this maybe provide types/chatgptjs
I don't think we need to worry about coders too much since we use ChatGPT eventually
then the way to do this maybe provide types/chatgptjs
What's types/chatgptjs
I don't think we need to worry about coders too much since we use ChatGPT eventually
wdym?
We provide TypeScript type definitions for ChatGPTJS, similar to how @types/jquery provides types for jQuery on npm. These types serve as documentation within the code.
I don't think we need to worry about coders too much since we use ChatGPT eventually
In other words, if developers don't read external documentation, they can still use ChatGPT effectively.
We provide TypeScript type definitions for ChatGPTJS, similar to how @types/jquery provides types for jQuery on npm. These types serve as documentation within the code.
Ok if you want to do that go ahead, then i will see what you mean and expand on it
I don't think we need to worry about coders too much since we use ChatGPT eventually
In other words, if developers don't read external documentation, they can still use ChatGPT effectively.
You mean use chatgpt.js effectively to build chatgpt apps, if they use types? Or you mean the coders you know (and yourself) use ChatGPT to write code instead of reading docs?
You mean use chatgpt.js effectively to build chatgpt apps, if they use types? Or you mean the coders you know (and yourself) use ChatGPT to write code instead of reading docs?
second meaning
Ok if you want to do that go ahead, then i will see what you mean and expand on it
Exploring this is not a priority for me at the moment. My main concern is that I cannot determine if the feature works without implementing it in an actual project. Therefore, I plan to create multiple repositories to test this one and develop interesting projects while fixing and adding features to chatgptjs.
You mean use chatgpt.js effectively to build chatgpt apps, if they use types? Or you mean the coders you know (and yourself) use ChatGPT to write code instead of reading docs?
second meaning
So you guys use bot to write code so I don't have to worry about making chatgpt.js easy to use? How would bot know how to use chatgpt.js?
while fixing and adding features to chatgptjs
There's nothing broken in chagptjs (it was only your added var declarations that users cannot access) because I don't write broken code
I'm just daydreaming.
We still need to write docs for bots to read by the way
I will be writing docs for human to read, you mean chatgpt will read them and teach lazy coders?
There's nothing broken in chagptjs (it was only your added var declarations that users cannot access) because I don't write broken code
Nothing broken doesn't mean it is easy to use, we can always make it better
I will be writing docs for human to read, you mean chatgpt will read them and teach lazy coders?
Until openai uses the latest data to retrain chatgpt
There's nothing broken in chagptjs (it was only your added var declarations that users cannot access) because I don't write broken code
Nothing broken doesn't mean it is easy to use, we can always make it better
It's hard to use for you? Can you give examples
I will be writing docs for human to read, you mean chatgpt will read them and teach lazy coders?
Until openai uses the latest data to retrain chatgpt
OpenAI already has GPT-4 for paid members that uses new data, but is that what you meant by "We still need to write docs for bots to read by the way" ? You want ChatGPT to read it so lazy coders don't have to?
It's hard to use for you?
The effectiveness of the functions varies. While the get functions are great, the event emitter and status management could use improvement.
Don't worry too much about this; we're just getting started.
OpenAI already has GPT-4 for paid members that uses new data, but is that what you meant by "We still need to write docs for bots to read by the way" ? You want ChatGPT to read it so lazy coders don't have to?
It doesn't matter whether I want it or not; it will end up like this. Just like now, I won't go to see the jQuery documentation anymore. (Also, the data for chatgpt4 is still not the latest.)
The effectiveness of the functions varies. While the get functions are great, the event emitter and status management could use improvement.
I haven't had time to even examine what your two functions do, I am working on abstracting things to auto-populate more functions + make it easier (that's why get() is great) so I can finally write docs for a to qualify for js.org domain
To me, they are more like better than none
, and I can make them better (when I really use them)
It doesn't matter whether I want it or not; it will end up like this. Just like now, I won't go to see the jQuery documentation anymore. (Also, the data for chatgpt4 is still not the latest.)
I get it now. I wanted to write docs for human so I can finally launch a website, you wanted the docs for ChatGPT training but this lib is a little baby that ChatGPT will not take seriously until I activate my super marketing
...but that will cum in the future do not worry
You don't need to write docs for ChatGPT; human docs and codes will teach it how to use this
You said you want docs for bot to read, then gave example that's how you research jQuery. I'm saying ChatGPT learned jQuery from user discussion, but no one uses this yet and it has to be really big for ChatGPT to train on user data
...and the bigness is not guaranteed, but I am an expert at marketing (but will not start until the lib is comprehensive)
(better than nothing
is good for progress to reach a level that a release would benefit public)
Yeah, it's like, talk is cheap, show me the code,
I will be away for quite a while, QwQ, have many jobs to do
Computer jobs?
yep
For status check what are you using it for? Would a coder not benefit enough with a very simple getStatus() in their own function that checks each time their own function runs? I don't see why it has to keep checking
This is a library of functions that users are meant to use in their own code to save typing, needs like retrieving status before coder does own stuff is satisfied by a single getStatus() definition
Their benefit from using this library is to save typing, this is not like userscripts where it has to constantly monitor and do things with timer functions etc
For eventEmitter, the user can write listener when it's idle, and finished.
That needs to store old status
There are also other ways to achieve this, such as observing dom change
Can you give example how you would use this in your own script
You seem to be telling me the ways I already achieve this in my scripts. But I would not expect a library to do this for me, because libraries are not designed to do that (think about jQuery, you use it to save typing)
If I use chatgpt.js in my scripts, I would still write observers and use chatgpt.getStatus(), I'm not expecting or understanding how a lib would replace my need to write my own observer
if so, then the status and eventEmitter part can be deleted, I maybe try to build another layer base on this repo
For example, if I want my script to do something when bot is done typing, without lib, I monitor for the change in specific element. With a lib, I still have to monitor for that change, but I would look for a lib function that retrieves specified element in my own observer, then when it finally exists, my function can proceed.
https://github.com/mefengl/chatgpt-twice/blob/master/script.js like in this code, I need to use setInterval to check, but if have a repo to do this for me, I can just write a listener for onDidGenerated
if so, then the status and eventEmitter part can be deleted, I maybe try to build another layer base on this repo
That's a good idea and it can be the first use case of chatgpt.js
https://github.com/mefengl/chatgpt-twice/blob/master/script.js like in this code, I need to use setInterval to check, but if have a repo to do this for me, I can just write a listener for
onDidGenerated
For the URL mentioning this lib in the code, you should put chatgptjs.org
But now I see how you use status check, I can come up with a solution but that will be after I rush to build a site with docs (requirement to launch on js.org)
chatgpt-conversation-1
chatgpt-conversation-1-prompt
chatgpt-conversation-1-response-1
chatgpt-conversation-1-response-2