You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/services/apis/chatgpt-web.mjs
+51-38Lines changed: 51 additions & 38 deletions
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,39 @@ export async function getRequirementsToken(accessToken) {
58
58
}
59
59
}
60
60
61
+
exportasyncfunctiongetArkoseToken(config){
62
+
if(!config.chatgptArkoseReqUrl)
63
+
thrownewError(
64
+
t('Please login at https://chat.openai.com first')+
65
+
'\n\n'+
66
+
t(
67
+
"Please keep https://chat.openai.com open and try again. If it still doesn't work, type some characters in the input box of chatgpt web page and try again.",
"Please keep https://chat.openai.com open and try again. If it still doesn't work, type some characters in the input box of chatgpt web page and try again.",
89
+
),
90
+
)
91
+
returnarkoseToken
92
+
}
93
+
61
94
/**
62
95
* @param {Runtime.Port} port
63
96
* @param {string} question
@@ -82,52 +115,34 @@ export async function generateAnswersWithChatgptWebApi(port, question, session,
t('Please login at https://chat.openai.com first')+
106
-
'\n\n'+
107
-
t(
108
-
"Please keep https://chat.openai.com open and try again. If it still doesn't work, type some characters in the input box of chatgpt web page and try again.",
"Please keep https://chat.openai.com open and try again. If it still doesn't work, type some characters in the input box of chatgpt web page and try again.",
129
-
),
130
-
)
143
+
).value
144
+
}
145
+
131
146
letanswer=''
132
147
letgenerationPrefixAnswer=''
133
148
letgeneratedImageUrl=''
@@ -144,6 +159,8 @@ export async function generateAnswersWithChatgptWebApi(port, question, session,
@@ -177,11 +194,7 @@ export async function generateAnswersWithChatgptWebApi(port, question, session,
177
194
onMessage(message){
178
195
functionhandleMessage(data){
179
196
if(data.error){
180
-
if(data.error.includes('unusual activity'))
181
-
thrownewError(
182
-
"Please keep https://chat.openai.com open and try again. If it still doesn't work, type some characters in the input box of chatgpt web page and try again.",
0 commit comments