Skip to content

Commit

Permalink
Format src/bots/openai/ChatGPTBot.js (#915)
Browse files Browse the repository at this point in the history
Use `npm run lint`/`vue-cli-service lint` to format the code.

Related to #914 / 3675a94
  • Loading branch information
PeterDaveHello authored Sep 29, 2024
1 parent 8fbdf6d commit 1bba648
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions src/bots/openai/ChatGPTBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ export default class ChatGPTBot extends Bot {
let available = false;

try {
const response = await axios.get(
"https://chatgpt.com/api/auth/session",
);
const response = await axios.get("https://chatgpt.com/api/auth/session");
if (!response.data?.error && response.data?.accessToken) {
this.accessToken = response.data.accessToken;
available = true;
Expand Down Expand Up @@ -214,16 +212,13 @@ export default class ChatGPTBot extends Bot {

return new Promise((resolve, reject) => {
try {
const source = new SSE(
"https://chatgpt.com/backend-api/conversation",
{
headers: {
...headers,
accept: "text/event-stream",
},
payload,
const source = new SSE("https://chatgpt.com/backend-api/conversation", {
headers: {
...headers,
accept: "text/event-stream",
},
);
payload,
});

let preInfo = [];
source.addEventListener("message", (event) => {
Expand Down

0 comments on commit 1bba648

Please sign in to comment.