Skip to content

Commit

Permalink
Fix Nextway
Browse files Browse the repository at this point in the history
  • Loading branch information
zachey01 committed Jul 17, 2024
1 parent 8f78068 commit b7d9e97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/Providers/ChatCompletion/Nextway.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ class NextwayProvider extends Provider {
: "https://chat.eqing.tech/api/openai/v1/chat/completions";

const response = await fetch(proxyUrl, {
headers: baseHeaders(
"https://chat.eqing.tech/api/openai/v1/chat/completions"
),
headers: {
...baseHeaders("https://chat.eqing.tech"),
usesearch: options.webSearch,
},
body: JSON.stringify({
messages: messages,
stream: options.stream,
Expand Down
3 changes: 2 additions & 1 deletion src/Utils/baseHeaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ function baseHeaders(url) {
'"Chromium";v="124", "YaBrowser";v="24.6", "Not-A.Brand";v="99", "Yowser";v="2.5"',
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": '"Windows"',
plugins: "0",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"x-requested-with": "XMLHttpRequest",
Referer: url,
"Referrer-Policy": "strict-origin-when-cross-origin",
usesearch: "true",
};
}
export default baseHeaders;

0 comments on commit b7d9e97

Please sign in to comment.