kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
chore: tweaks
rodzic
13e9e3e0a4
commit
acf5261b48
|
@ -189,7 +189,6 @@ export class ChatGPTAPI {
|
||||||
|
|
||||||
async resetThread() {
|
async resetThread() {
|
||||||
const resetButton = await this._page.$('nav > a:nth-child(1)')
|
const resetButton = await this._page.$('nav > a:nth-child(1)')
|
||||||
|
|
||||||
if (!resetButton) throw new Error('not signed in')
|
if (!resetButton) throw new Error('not signed in')
|
||||||
|
|
||||||
await resetButton.click()
|
await resetButton.click()
|
||||||
|
|
|
@ -47,16 +47,9 @@ async function main() {
|
||||||
// Wait forever; useful for debugging chromium sessions
|
// Wait forever; useful for debugging chromium sessions
|
||||||
// await new Promise(() => {})
|
// await new Promise(() => {})
|
||||||
|
|
||||||
await api.resetThread()
|
|
||||||
|
|
||||||
const newResponse = await api.sendMessage(
|
|
||||||
// 'Write a TypeScript function for conway sort.'
|
|
||||||
'Write a javascript version of bubble sort. Do not include example usage.'
|
|
||||||
)
|
|
||||||
|
|
||||||
await api.close()
|
await api.close()
|
||||||
|
|
||||||
return newResponse
|
return response
|
||||||
}
|
}
|
||||||
|
|
||||||
main().then((res) => {
|
main().then((res) => {
|
||||||
|
|
Ładowanie…
Reference in New Issue