Skip to content

Commit

Permalink
fix gpt unofficial api
Browse files Browse the repository at this point in the history
  • Loading branch information
FishHawk committed Dec 2, 2023
1 parent 28daf6d commit 7489c78
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions web/src/components/TranslateTask.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ const startTask = async (
show.value = true;
let accessToken = params.accessToken.trim();
try {
let accessToken = params.accessToken.trim();
const obj = JSON.parse(accessToken);
accessToken = obj.accessToken;
params.accessToken = obj.accessToken;
} catch {}
await (
Expand All @@ -104,7 +104,7 @@ const startTask = async (
} else if (params.translatorId === 'youdao') {
emit('update:youdao', zh);
} else if (params.translatorId === 'gpt') {
setting.addToken(accessToken);
setting.addToken(params.accessToken);
emit('update:gpt', zh);
} else {
emit('update:sakura', zh);
Expand Down
2 changes: 1 addition & 1 deletion web/src/data/translator/openai/api_unofficial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class OpenAiUnofficialApi {

constructor(client: KyInstance, accessToken: string) {
this.client = client.create({
prefixUrl: 'https://ai.fakeopen.com/api',
prefixUrl: 'https://chatgpt-proxy.lss233.com/api',
headers: {
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/home/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const linkExample = [
<img v-if="isDesktop" :src="qqUrl" width="120" />

<n-ul>
<n-li>GPT现在用不了token了,不知道什么时候能修好。</n-li>
<n-li>GPT修好了。</n-li>
<n-li>
如果发现Sakura某段翻译得不准确,可以点击该段提交(需要登录),帮助我们改善Sakura模型。
</n-li>
Expand Down

0 comments on commit 7489c78

Please sign in to comment.