Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Cloudflare official API, including model list. #38

Merged
merged 11 commits into from
Aug 1, 2024
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ OPENAI_API_KEY=sk-xxxxxxxxx

### Cloudflare Workers AI ####

# CLOUDFLARE_ACCOUNT_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# CLOUDFLARE_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# CLOUDFLARE_BASE_URL_OR_ACCOUNT_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


########################################
Expand Down
10 changes: 5 additions & 5 deletions locales/ar/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
}
},
"cloudflare": {
"accountID": {
"desc": "يرجى ملء Cloudflare Account ID",
"placeholder": "Cloudflare Account ID",
"title": "Cloudflare Account ID"
},
"apiKey": {
"desc": "يرجى ملء Cloudflare API Key",
"placeholder": "Cloudflare API Key",
"title": "Cloudflare API Key"
},
"baseURLOrAccountID": {
"desc": "أدخل رقم حساب Cloudflare أو عنوان URL API المخصص",
"placeholder": "رقم حساب Cloudflare / عنوان URL API المخصص",
"title": "رقم حساب Cloudflare / عنوان URL API"
}
},
"ollama": {
Expand Down
10 changes: 5 additions & 5 deletions locales/bg-BG/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
}
},
"cloudflare": {
"accountID": {
"desc": "Моля, въведете Cloudflare Account ID",
"placeholder": "Cloudflare Account ID",
"title": "Cloudflare Account ID"
},
"apiKey": {
"desc": "Моля, въведете Cloudflare API Key",
"placeholder": "Cloudflare API Key",
"title": "Cloudflare API Key"
},
"baseURLOrAccountID": {
"desc": "Въведете ID на Cloudflare или личен API адрес",
"placeholder": "ID на Cloudflare / личен API адрес",
"title": "ID на Cloudflare / API адрес"
}
},
"ollama": {
Expand Down
10 changes: 5 additions & 5 deletions locales/de-DE/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
}
},
"cloudflare": {
"accountID": {
"desc": "Bitte füllen Sie die Cloudflare Account ID",
"placeholder": "Cloudflare Account ID",
"title": "Cloudflare Account ID"
},
"apiKey": {
"desc": "Bitte füllen Sie die Cloudflare API Key",
"placeholder": "Cloudflare API Key",
"title": "Cloudflare API Key"
},
"baseURLOrAccountID": {
"desc": "Eingeben Sie die Cloudflare-Kundenkennung oder die benutzerdefinierte API-Adresse",
"placeholder": "Cloudflare-Kundenkennung / benutzerdefinierte API-Adresse",
"title": "Cloudflare-Kundenkennung / API-Adresse"
}
},
"ollama": {
Expand Down
10 changes: 5 additions & 5 deletions locales/en-US/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
}
},
"cloudflare": {
"accountID": {
"desc": "Please enter Cloudflare Account ID",
"placeholder": "Cloudflare Account ID",
"title": "Cloudflare Account ID"
},
"apiKey": {
"desc": "Please enter Cloudflare API Key",
"placeholder": "Cloudflare API Key",
"title": "Cloudflare API Key"
},
"baseURLOrAccountID": {
"desc": "Enter your Cloudflare account ID or custom API address",
"placeholder": "Cloudflare Account ID / custom API URL",
"title": "Cloudflare Account ID / API Address"
}
},
"ollama": {
Expand Down
10 changes: 5 additions & 5 deletions locales/es-ES/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
}
},
"cloudflare": {
"accountID": {
"desc": "Por favor complete la Cloudflare Account ID",
"placeholder": "Cloudflare Account ID",
"title": "Cloudflare Account ID"
},
"apiKey": {
"desc": "Por favor complete la Cloudflare API Key",
"placeholder": "Cloudflare API Key",
"title": "Cloudflare API Key"
},
"baseURLOrAccountID": {
"desc": "Ingrese el ID de cuenta de Cloudflare o la dirección URL personalizada de API",
"placeholder": "ID de cuenta de Cloudflare / URL de API personalizada",
"title": "ID de cuenta de Cloudflare / dirección URL de API"
}
},
"ollama": {
Expand Down
10 changes: 5 additions & 5 deletions locales/fr-FR/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
}
},
"cloudflare": {
"accountID": {
"desc": "Veuillez remplir l'Cloudflare Account ID",
"placeholder": "Cloudflare Account ID",
"title": "Cloudflare Account ID"
},
"apiKey": {
"desc": "Veuillez remplir l'Cloudflare API Key",
"placeholder": "Cloudflare API Key",
"title": "Cloudflare API Key"
},
"baseURLOrAccountID": {
"desc": "Saisir l'ID de compte Cloudflare ou l'adresse API personnalisée",
"placeholder": "ID de compte Cloudflare / URL API personnalisée",
"title": "ID de compte Cloudflare / adresse API"
}
},
"ollama": {
Expand Down
10 changes: 5 additions & 5 deletions locales/it-IT/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
}
},
"cloudflare": {
"accountID": {
"desc": "Compila l'Cloudflare Account ID",
"placeholder": "Cloudflare Account ID",
"title": "Cloudflare Account ID"
},
"apiKey": {
"desc": "Compila l'Cloudflare API Key",
"placeholder": "Cloudflare API Key",
"title": "Cloudflare API Key"
},
"baseURLOrAccountID": {
"desc": "Inserisci l'ID dell'account Cloudflare o l'indirizzo API personalizzato",
"placeholder": "ID account Cloudflare / URL API personalizzato",
"title": "ID account Cloudflare / indirizzo API"
}
},
"ollama": {
Expand Down
10 changes: 5 additions & 5 deletions locales/ja-JP/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
}
},
"cloudflare": {
"accountID": {
"desc": "Cloudflare Account ID を入力してください",
"placeholder": "Cloudflare Account ID",
"title": "Cloudflare Account ID"
},
"apiKey": {
"desc": "Cloudflare API Key を入力してください",
"placeholder": "Cloudflare API Key",
"title": "Cloudflare API Key"
},
"baseURLOrAccountID": {
"desc": "Cloudflare アカウント ID またはカスタム API アドレスを入力してください。",
"placeholder": "Cloudflare アカウント ID / カスタム API URL",
"title": "Cloudflare アカウント ID / API アドレス"
}
},
"ollama": {
Expand Down
10 changes: 5 additions & 5 deletions locales/ko-KR/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
}
},
"cloudflare": {
"accountID": {
"desc": "Cloudflare Account ID 를 작성해 주세요.",
"placeholder": "Cloudflare Account ID",
"title": "Cloudflare Account ID"
},
"apiKey": {
"desc": "Cloudflare API Key 를 작성해 주세요.",
"placeholder": "Cloudflare API Key",
"title": "Cloudflare API Key"
},
"baseURLOrAccountID": {
"desc": "클라우드 플레어 계정 ID 또는 사용자 지정 API 주소 입력",
"placeholder": "클라우드 플레어 계정 ID / 사용자 지정 API 주소",
"title": "클라우드 플레어 계정 ID / API 주소"
}
},
"ollama": {
Expand Down
10 changes: 5 additions & 5 deletions locales/nl-NL/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
}
},
"cloudflare": {
"accountID": {
"desc": "Voer Cloudflare Account ID in",
"placeholder": "Cloudflare Account ID",
"title": "Cloudflare Account ID"
},
"apiKey": {
"desc": "Voer Cloudflare API Key in",
"placeholder": "Cloudflare API Key",
"title": "Cloudflare API Key"
},
"baseURLOrAccountID": {
"desc": "Voer uw Cloudflare-account ID of een custom API-URL in",
"placeholder": "Cloudflare-account ID / custom API-URL",
"title": "Cloudflare-account ID / API-URL"
}
},
"ollama": {
Expand Down
10 changes: 5 additions & 5 deletions locales/pl-PL/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
}
},
"cloudflare": {
"accountID": {
"desc": "Wprowadź klucz Cloudflare Account ID",
"placeholder": "Cloudflare Account ID",
"title": "Cloudflare Account ID"
},
"apiKey": {
"desc": "Wprowadź klucz Cloudflare API Key",
"placeholder": "Cloudflare API Key",
"title": "Cloudflare API Key"
},
"baseURLOrAccountID": {
"desc": "Wprowadź ID konta Cloudflare lub adres API niestandardowy",
"placeholder": "ID konta Cloudflare / adres API niestandardowy",
"title": "ID konta Cloudflare / adres API"
}
},
"ollama": {
Expand Down
10 changes: 5 additions & 5 deletions locales/pt-BR/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
}
},
"cloudflare": {
"accountID": {
"desc": "Insira o Cloudflare Account ID",
"placeholder": "Cloudflare Account ID",
"title": "Cloudflare Account ID"
},
"apiKey": {
"desc": "Insira o Cloudflare API Key",
"placeholder": "Cloudflare API Key",
"title": "Cloudflare API Key"
},
"baseURLOrAccountID": {
"desc": "Insira o ID da conta do Cloudflare ou o endereço da API personalizado",
"placeholder": "ID da conta do Cloudflare / URL da API personalizada",
"title": "ID da conta do Cloudflare / Endereço da API"
}
},
"ollama": {
Expand Down
10 changes: 5 additions & 5 deletions locales/ru-RU/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
}
},
"cloudflare": {
"accountID": {
"desc": "Пожалуйста, заполните Cloudflare Account ID",
"placeholder": "Cloudflare Account ID",
"title": "Cloudflare Account ID"
},
"apiKey": {
"desc": "Пожалуйста, заполните Cloudflare API Key",
"placeholder": "Cloudflare API Key",
"title": "Cloudflare API Key"
},
"baseURLOrAccountID": {
"desc": "Введите ID аккаунта Cloudflare или адрес API по умолчанию",
"placeholder": "ID аккаунта Cloudflare / адрес API по умолчанию",
"title": "ID аккаунта Cloudflare / адрес API"
}
},
"ollama": {
Expand Down
10 changes: 5 additions & 5 deletions locales/tr-TR/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
}
},
"cloudflare": {
"accountID": {
"desc": "Lütfen doldurun Cloudflare Account ID",
"placeholder": "Cloudflare Account ID",
"title": "Cloudflare Account ID"
},
"apiKey": {
"desc": "Lütfen doldurun Cloudflare API Key",
"placeholder": "Cloudflare API Key",
"title": "Cloudflare API Key"
},
"baseURLOrAccountID": {
"desc": "Cloudflare hesabınızın ID'sini veya özel API adresinizi girin",
"placeholder": "Cloudflare Hesap ID / Özel API Adresi",
"title": "Cloudflare Hesap ID / API Adresi"
}
},
"ollama": {
Expand Down
10 changes: 5 additions & 5 deletions locales/vi-VN/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
}
},
"cloudflare": {
"accountID": {
"desc": "Vui lòng nhập Cloudflare Account ID",
"placeholder": "Cloudflare Account ID",
"title": "Cloudflare Account ID"
},
"apiKey": {
"desc": "Vui lòng nhập Cloudflare API Key",
"placeholder": "Cloudflare API Key",
"title": "Cloudflare API Key"
},
"baseURLOrAccountID": {
"desc": "Nhập ID tài khoản Cloudflare hoặc địa chỉ API tùy chỉnh",
"placeholder": "ID tài khoản Cloudflare / địa chỉ API tùy chỉnh",
"title": "ID tài khoản Cloudflare / địa chỉ API"
}
},
"ollama": {
Expand Down
10 changes: 5 additions & 5 deletions locales/zh-CN/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
}
},
"cloudflare": {
"accountID": {
"desc": "请填写 Cloudflare 账户 ID",
"placeholder": "Cloudflare Account ID",
"title": "Cloudflare Account ID"
},
"apiKey": {
"desc": "请填写 Cloudflare API Key",
"placeholder": "Cloudflare API Key",
"title": "Cloudflare API Key"
},
"baseURLOrAccountID": {
"desc": "填入 Cloudflare 账户 ID 或 自定义 API 地址",
"placeholder": "Cloudflare Account ID / custom API URL",
"title": "Cloudflare 账户 ID / API 地址"
}
},
"ollama": {
Expand Down
10 changes: 5 additions & 5 deletions locales/zh-TW/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
}
},
"cloudflare": {
"accountID": {
"desc": "請填入 Cloudflare 帳戶 ID",
"placeholder": "Cloudflare Account ID",
"title": "Cloudflare Account ID"
},
"apiKey": {
"desc": "請填入 Cloudflare API Key",
"placeholder": "Cloudflare API Key",
"title": "Cloudflare API Key"
},
"baseURLOrAccountID": {
"desc": "填入 Cloudflare 帳戶 ID 或 自定義 API 位址",
"placeholder": "Cloudflare 帳戶 ID / 自定義 API 位址",
"title": "Cloudflare 帳戶 ID / API 位址"
}
},
"ollama": {
Expand Down
11 changes: 5 additions & 6 deletions src/app/(main)/settings/llm/ProviderList/Cloudflare/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@ export const useCloudflareProvider = (): ProviderItem => {
},
{
children: (
<Input.Password
autoComplete={'new-password'}
placeholder={t(`${providerKey}.accountID.placeholder`)}
<Input
placeholder={t(`${providerKey}.baseURLOrAccountID.placeholder`)}
/>
),
desc: t(`${providerKey}.accountID.desc`),
label: t(`${providerKey}.accountID.title`),
name: [KeyVaultsConfigKey, providerKey, 'accountID'],
desc: t(`${providerKey}.baseURLOrAccountID.desc`),
label: t(`${providerKey}.baseURLOrAccountID.title`),
name: [KeyVaultsConfigKey, providerKey, 'baseURLOrAccountID'],
},
],
title: <CloudflareBrand />,
Expand Down
Loading
Loading