Skip to content

Commit 72de829

Browse files
committed
fix: Gemini 500
1 parent e1de51e commit 72de829

File tree

6 files changed

+24
-16
lines changed

6 files changed

+24
-16
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ https://dash.deno.com
1616
- Build Step改为`NITRO_PRESET=deno-deploy npm run build_node`
1717
- Deploy Project
1818
- 设置环境变量
19-
- 部分地区可能需要Gemini反代
2019

2120
### Docker
2221

@@ -53,6 +52,7 @@ https://developers.cloudflare.com/workers-ai/models/
5352
| CF_GATEWAY | Cloudflare AI Gateway URL |
5453
| OPENAI_API_KEY | OpenAI API Key (需要ChatGPT时填写) |
5554
| G_API_KEY | Google AI API Key (需要GeminiPro时填写) |
55+
| G_API_URL | Google AI 反代 (不支持地区填写,或参考以下配置) |
5656
| PASSWORD | 访问密码 (可选) |
5757

5858
示例: 查看`.env.example`文件
@@ -75,12 +75,26 @@ https://dash.cloudflare.com/
7575
- 添加新 AI Gateway
7676
- 填写名称和URL slug创建
7777
- 单击右上角API Endpoints
78-
- 复制您的Universal Endpoint(去掉末尾'/'),设置环境变量
78+
- 复制您的Universal Endpoint(去掉末尾`/`),设置环境变量
7979

8080
#### G_API_KEY
8181

8282
https://ai.google.dev/tutorials/rest_quickstart#set_up_your_api_key
8383

84+
#### G_API_URL
85+
86+
参考 https://github.com/Jazee6/gemini-proxy 搭建反代,末尾无需`/`
87+
88+
或者在`nuxt.config.ts`中添加以下配置
89+
90+
```
91+
nitro: {
92+
vercel: {
93+
regions: ["sin1", "syd1", "sfo1", "iad1", "pdx1", "cle1"]
94+
}
95+
}
96+
```
97+
8498
## Star History
8599

86100
[![Star History Chart](https://api.star-history.com/svg?repos=Jazee6/cloudflare-ai-web&type=Date)](https://star-history.com/#Jazee6/cloudflare-ai-web&Date)

components/ChatInput.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const handlePaste = (e: ClipboardEvent) => {
124124
<UButton class="m-1" @click="addHistory = !addHistory" :color="addHistory?'primary':'gray'"
125125
icon="i-heroicons-clock-solid"/>
126126
</UTooltip>
127-
<UTooltip v-if="selectedModel.type === 'universal'" :text="$t('add_image')">
127+
<UTooltip v-if="selectedModel.type === 'universal'" :text="$t('add_image') + '(' + $t('support_paste') + ')'">
128128
<UButton @click="handleAddFiles" color="white" class="m-1" icon="i-heroicons-paper-clip-16-solid"/>
129129
</UTooltip>
130130
<UTextarea v-model="input" :placeholder="$t('please_input_text') + '...' "

components/IButton.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
2-
defineProps({
3-
name: String
4-
})
2+
defineProps<{
3+
name: string
4+
}>()
55
</script>
66

77
<template>

components/Sidebar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ defineProps<{
3737
</aside>
3838
</template>
3939

40-
<style scoped>
40+
<style scoped lang="postcss">
4141
.hide {
4242
@apply -translate-x-full opacity-0 w-0 m-0 invisible transition-all
4343
}

i18n.config.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@ export default defineI18nConfig(() => ({
55
setting: '设置',
66
use_own_key: '使用自己的key',
77
new_chat: '新建对话',
8-
// need_image: '需要图片',
9-
// waited: '已等待',
10-
// image_max_5MB: '图片大小不能超过5MB',
118
input_password: '请输入访问密码',
129
confirm: '确定',
1310
with_history: '发送时携带历史记录',
1411
without_history: '发送时不携带历史记录',
1512
please_input_text: '请输入文本',
1613
add_image: '添加图片',
17-
// support_paste: '支持粘贴',
14+
support_paste: '支持粘贴',
1815
send: '发送',
1916
img_gen_steps: '图片生成步数',
2017
text_generation: '文本生成',
@@ -26,16 +23,13 @@ export default defineI18nConfig(() => ({
2623
setting: 'Setting',
2724
use_own_key: 'Use own key',
2825
new_chat: 'New chat',
29-
// need_image: 'Need image',
30-
// waited: 'Waited',
31-
// image_max_5MB: 'Image size cannot exceed 5MB',
3226
input_password: 'Please enter access password',
3327
confirm: 'Confirm',
3428
with_history: 'Send with history',
3529
without_history: 'Send without history',
3630
please_input_text: 'Please input text',
3731
add_image: 'Add image',
38-
// support_paste: 'Support paste',
32+
support_paste: 'Support paste',
3933
send: 'Send',
4034
img_gen_steps: 'Image generation steps',
4135
text_generation: 'Text generation',

nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default defineNuxtConfig({
5353
}
5454
// nitro: {
5555
// vercel: {
56-
// regions: ["cle1", "iad1", "pdx1", "sfo1", "sin1", "syd1", "hnd1", "kix1"]
56+
// regions: ["sin1", "syd1", "sfo1", "iad1", "pdx1", "cle1"]
5757
// }
5858
// }
5959
})

0 commit comments

Comments
 (0)