Skip to content

Commit

Permalink
💄 style(config): Update Azure model and API versions (#3405)
Browse files Browse the repository at this point in the history
* 💄 style(config): Update Azure model and API versions

* 💄 style: Modify text
  • Loading branch information
RubuJam authored Aug 5, 2024
1 parent bd2812b commit a4938eb
Show file tree
Hide file tree
Showing 26 changed files with 49 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ OPENAI_API_KEY=sk-xxxxxxxxx
# AZURE_ENDPOINT=https://docs-test-001.openai.azure.com

# Azure's API version, follows the YYYY-MM-DD format
# AZURE_API_VERSION=2024-02-01
# AZURE_API_VERSION=2024-06-01


### Anthropic Service ####
Expand Down
2 changes: 1 addition & 1 deletion docs/self-hosting/examples/azure-openai.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ LobeChat 支持使用 [Azure OpenAI](https://learn.microsoft.com/zh-cn/azure/ai-

- **APIKey**:你在 Azure OpenAI 账户页面申请的 API 密钥,可在 “密钥和终结点” 部分中找到此值
- **API 地址**:Azure API 地址,从 Azure 门户检查资源时,可在 “密钥和终结点” 部分中找到此值
- **Azure Api Version**: Azure 的 API 版本,遵循 YYYY-MM-DD 格式,查阅[最新版本](https://learn.microsoft.com/zh-cn/azure/ai-services/openai/reference#chat-completions)
- **Azure API Version**: Azure 的 API 版本,遵循 YYYY-MM-DD 格式,查阅[最新版本](https://learn.microsoft.com/zh-cn/azure/ai-services/openai/reference#chat-completions)
- **模型列表**: 用来控制模型列表,你可以自行配置你的部署模型。

完成上述字段配置后,点击「检查」,如果提示「检查通过」,则说明配置成功。
Expand Down
2 changes: 1 addition & 1 deletion locales/ar/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"azureApiVersion": {
"desc": "نسخة API الخاصة بـ Azure، والتي تتبع تنسيق YYYY-MM-DD، راجع [الإصدارات الأحدث](https://learn.microsoft.com/zh-en/azure/ai-services/openai/reference#chat-completions)",
"fetch": "جلب القائمة",
"title": "Azure Api Version"
"title": "Azure API Version"
},
"empty": "الرجاء إدخال معرف النموذج لإضافة أول نموذج",
"endpoint": {
Expand Down
2 changes: 1 addition & 1 deletion locales/bg-BG/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"azureApiVersion": {
"desc": "Версия на Azure API, в формат YYYY-MM-DD, вижте [най-новата версия](https://learn.microsoft.com/zh-cn/azure/ai-services/openai/reference#chat-completions)",
"fetch": "Извличане на списък",
"title": "Версия на Azure Api"
"title": "Версия на Azure API"
},
"empty": "Моля, въведете идентификатор на модела, за да добавите първия модел",
"endpoint": {
Expand Down
2 changes: 1 addition & 1 deletion locales/en-US/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
},
"checker": {
"button": "Check",
"desc": "Test if the Api Key and proxy address are filled in correctly",
"desc": "Test if the API Key and proxy address are filled in correctly",
"pass": "Check Passed",
"title": "Connectivity Check"
},
Expand Down
2 changes: 1 addition & 1 deletion locales/ja-JP/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"azureApiVersion": {
"desc": "Azure の API バージョン、YYYY-MM-DD 形式に従う、[最新バージョン](https://learn.microsoft.com/zh-cn/azure/ai-services/openai/reference#chat-completions)を参照",
"fetch": "リストを取得",
"title": "Azure Api Version"
"title": "Azure API Version"
},
"empty": "モデル ID を入力して最初のモデルを追加してください",
"endpoint": {
Expand Down
2 changes: 1 addition & 1 deletion locales/nl-NL/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"azureApiVersion": {
"desc": "De API-versie van Azure, volgt het formaat YYYY-MM-DD, raadpleeg [de nieuwste versie](https://learn.microsoft.com/nl-nl/azure/ai-services/openai/reference#chat-completions)",
"fetch": "Lijst ophalen",
"title": "Azure Api Versie"
"title": "Azure API Versie"
},
"empty": "Voer een model-ID in om het eerste model toe te voegen",
"endpoint": {
Expand Down
2 changes: 1 addition & 1 deletion locales/pl-PL/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"azureApiVersion": {
"desc": "Wersja API Azure, stosuj format YYYY-MM-DD, zobacz [najnowszą wersję](https://learn.microsoft.com/pl-pl/azure/ai-services/openai/reference#chat-completions)",
"fetch": "Pobierz listę",
"title": "Wersja Azure Api"
"title": "Wersja Azure API"
},
"empty": "Wprowadź identyfikator modelu, aby dodać pierwszy model",
"endpoint": {
Expand Down
2 changes: 1 addition & 1 deletion locales/pt-BR/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
},
"checker": {
"button": "Verificar",
"desc": "Verifica se a Api Key e o endereço do proxy estão preenchidos corretamente",
"desc": "Verifica se a API Key e o endereço do proxy estão preenchidos corretamente",
"pass": "Verificação aprovada",
"title": "Verificação de Conectividade"
},
Expand Down
2 changes: 1 addition & 1 deletion locales/tr-TR/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"azureApiVersion": {
"desc": "Azure'un API versiyonu, YYYY-AA-GG formatına uygun, [en son versiyonu](https://learn.microsoft.com/zh-cn/azure/ai-services/openai/reference#chat-completions) kontrol edin",
"fetch": "Listeyi al",
"title": "Azure Api Versiyonu"
"title": "Azure API Versiyonu"
},
"empty": "İlk modeli eklemek için model kimliğini girin",
"endpoint": {
Expand Down
2 changes: 1 addition & 1 deletion locales/tr-TR/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
},
"checker": {
"button": "Kontrol Et",
"desc": "Api Anahtarı ve vekil adresinin doğru şekilde doldurulup doldurulmadığını test eder",
"desc": "API Anahtarı ve vekil adresinin doğru şekilde doldurulup doldurulmadığını test eder",
"pass": "Kontrol Başarılı",
"title": "Bağlantı Kontrolü"
},
Expand Down
2 changes: 1 addition & 1 deletion locales/vi-VN/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
},
"checker": {
"button": "Kiểm tra",
"desc": "Kiểm tra xem Api Key và địa chỉ proxy đã được điền đúng chưa",
"desc": "Kiểm tra xem API Key và địa chỉ proxy đã được điền đúng chưa",
"pass": "Kiểm tra thành công",
"title": "Kiểm tra kết nối"
},
Expand Down
2 changes: 1 addition & 1 deletion locales/zh-CN/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"PluginManifestNotFound": "很抱歉,服务器没有找到该插件的描述清单 (manifest.json),请检查插件描述文件地址是否正确",
"PluginManifestInvalid": "很抱歉,该插件的描述清单校验未通过,请检查描述清单格式是否规范",
"PluginApiNotFound": "很抱歉,插件描述清单中不存在该 API ,请检查你的请求方法与插件清单 API 是否匹配",
"PluginApiParamsError": "很抱歉,该插件请求的入参校验未通过,请检查入参与 Api 描述信息是否匹配",
"PluginApiParamsError": "很抱歉,该插件请求的入参校验未通过,请检查入参与 API 描述信息是否匹配",
"PluginSettingsInvalid": "该插件需要正确配置后才可以使用,请检查你的配置是否正确",
"PluginServerError": "插件服务端请求返回出错,请检查根据下面的报错信息检查你的插件描述文件、插件配置或服务端实现",
"PluginGatewayError": "很抱歉,插件网关出现错误,请检查插件网关配置是否正确",
Expand Down
2 changes: 1 addition & 1 deletion locales/zh-CN/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"azureApiVersion": {
"desc": "Azure 的 API 版本,遵循 YYYY-MM-DD 格式,查阅[最新版本](https://learn.microsoft.com/zh-cn/azure/ai-services/openai/reference#chat-completions)",
"fetch": "获取列表",
"title": "Azure Api Version"
"title": "Azure API Version"
},
"empty": "请输入模型 ID 添加第一个模型",
"endpoint": {
Expand Down
2 changes: 1 addition & 1 deletion locales/zh-CN/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
},
"checker": {
"button": "检查",
"desc": "测试 Api Key 与代理地址是否正确填写",
"desc": "测试 API Key 与代理地址是否正确填写",
"pass": "检查通过",
"title": "连通性检查"
},
Expand Down
2 changes: 1 addition & 1 deletion locales/zh-TW/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"azureApiVersion": {
"desc": "Azure 的 API 版本,遵循 YYYY-MM-DD 格式,查閱[最新版本](https://learn.microsoft.com/zh-cn/azure/ai-services/openai/reference#chat-completions)",
"fetch": "獲取列表",
"title": "Azure Api 版本"
"title": "Azure API 版本"
},
"empty": "請輸入模型 ID 添加第一個模型",
"endpoint": {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@
"@khmyznikov/pwa-install": "^0.3.9",
"@lobehub/chat-plugin-sdk": "^1.32.4",
"@lobehub/chat-plugins-gateway": "^1.9.0",
"@lobehub/icons": "^1.27.0",
"@lobehub/icons": "^1.28.0",
"@lobehub/tts": "^1.24.3",
"@lobehub/ui": "^1.146.9",
"@lobehub/ui": "^1.147.0",
"@microsoft/fetch-event-source": "^2.0.1",
"@neondatabase/serverless": "^0.9.4",
"@next/third-parties": "^14.2.4",
Expand Down
3 changes: 3 additions & 0 deletions src/app/(main)/settings/llm/ProviderList/Azure/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ export const useAzureProvider = (): ProviderItem => {
children: (
<AutoComplete
options={[
'2024-06-01',
'2024-02-01',
'2024-05-01-preview',
'2024-04-01-preview',
'2024-03-01-preview',
'2024-02-15-preview',
'2023-10-01-preview',
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/chat/agentRuntime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('initAgentRuntimeWithUserPayload method', () => {
const jwtPayload: JWTPayload = {
apiKey: 'user-azure-key',
endpoint: 'user-azure-endpoint',
azureApiVersion: '2024-02-01',
azureApiVersion: '2024-06-01',
};
const runtime = await initAgentRuntimeWithUserPayload(ModelProvider.Azure, jwtPayload);
expect(runtime).toBeInstanceOf(AgentRuntime);
Expand Down
10 changes: 0 additions & 10 deletions src/config/modelProviders/ai360.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,41 @@ const Ai360: ModelProviderCard = {
},
{
displayName: '360GPT Pro',
enabled: false,
functionCall: false,
id: '360gpt-pro',
maxOutput: 7000,
tokens: 8192,
},
{
displayName: '360GPT Pro Perf',
enabled: false,
functionCall: false,
id: '360gpt-pro-perf',
maxOutput: 7000,
tokens: 8192,
},
{
displayName: '360GPT Pro sc202401v3',
enabled: false,
functionCall: false,
id: '360gpt-pro-sc202401v3',
maxOutput: 2048,
tokens: 4096,
},
{
displayName: '360GPT Pro sc202401v2',
enabled: false,
functionCall: false,
id: '360gpt-pro-sc202401v2',
maxOutput: 2048,
tokens: 4096,
},
{
displayName: '360GPT Pro sc202401v1',
enabled: false,
functionCall: false,
id: '360gpt-pro-sc202401v1',
maxOutput: 2048,
tokens: 4096,
},
{
displayName: '360GPT Pro v2.0.3',
enabled: false,
functionCall: false,
id: '360gpt-pro-v2.0.3',
maxOutput: 2048,
Expand All @@ -77,31 +71,27 @@ const Ai360: ModelProviderCard = {
},
{
displayName: '360GPT Turbo 32K Responsibility 240530',
enabled: false,
functionCall: false,
id: '360gpt-turbo-32k-responsibility-240530',
maxOutput: 32_000,
tokens: 32_000,
},
{
displayName: '360GPT Turbo 32K Responsibility 240516',
enabled: false,
functionCall: false,
id: '360gpt-turbo-32k-responsibility-240516',
maxOutput: 32_000,
tokens: 32_000,
},
{
displayName: '360GPT_S1_QIYUAN',
enabled: false,
functionCall: false,
id: '360GPT_S1_QIYUAN',
maxOutput: 2048,
tokens: 4096,
},
{
displayName: '360GPT_S2_V9',
enabled: false,
functionCall: false,
id: '360GPT_S2_V9',
maxOutput: 7000,
Expand Down
5 changes: 1 addition & 4 deletions src/config/modelProviders/anthropic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,28 +49,25 @@ const Anthropic: ModelProviderCard = {
},
{
displayName: 'Claude 2.1',
enabled: false,
id: 'claude-2.1',
maxOutput: 4096,
tokens: 200_000,
},
{
displayName: 'Claude 2.0',
enabled: false,
id: 'claude-2.0',
maxOutput: 4096,
tokens: 100_000,
},
{
displayName: 'Claude Instant 1.2',
enabled: false,
id: 'claude-instant-1.2',
maxOutput: 4096,
tokens: 100_000,
},
],
checkModel: 'claude-3-haiku-20240307',
disableBrowserRequest: true,
disableBrowserRequest: true,
id: 'anthropic',
name: 'Anthropic',
proxyUrl: {
Expand Down
27 changes: 23 additions & 4 deletions src/config/modelProviders/azure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const Azure: ModelProviderCard = {
{
deploymentName: 'gpt-35-turbo',
description: 'GPT 3.5 Turbo,适用于各种文本生成和理解任务',
displayName: 'GPT-3.5 Turbo',
displayName: 'GPT 3.5 Turbo',
enabled: true,
functionCall: true,
id: 'gpt-35-turbo',
Expand All @@ -15,27 +15,46 @@ const Azure: ModelProviderCard = {
},
{
deploymentName: 'gpt-35-turbo-16k',
displayName: 'GPT-3.5 Turbo',
displayName: 'GPT 3.5 Turbo',
functionCall: true,
id: 'gpt-35-turbo-16k',
tokens: 16_384,
},
{
deploymentName: 'gpt-4-turbo',
displayName: 'GPT-4 Turbo',
displayName: 'GPT 4 Turbo',
enabled: true,
functionCall: true,
id: 'gpt-4',
tokens: 128_000,
vision: true,
},
{
deploymentName: 'gpt-4-vision',
description: 'GPT-4 视觉预览版,支持视觉任务',
displayName: 'GPT-4 Turbo with Vision Preview',
displayName: 'GPT 4 Turbo with Vision Preview',
id: 'gpt-4-vision-preview',
tokens: 128_000,
vision: true,
},
{
deploymentName: 'gpt-4o-mini',
displayName: 'GPT 4o Mini',
enabled: true,
functionCall: true,
id: 'gpt-4o-mini',
tokens: 128_000,
vision: true,
},
{
deploymentName: 'gpt-4o',
displayName: 'GPT 4o',
enabled: true,
functionCall: true,
id: 'gpt-4o',
tokens: 128_000,
vision: true,
},
],
defaultShowBrowserRequest: true,
id: 'azure',
Expand Down
1 change: 0 additions & 1 deletion src/config/modelProviders/groq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const Groq: ModelProviderCard = {
chatModels: [
{
displayName: 'LLaMA3.1 405B (Preview)',
enabled: false,
functionCall: true,
id: 'llama-3.1-405b-reasoning',
tokens: 16_000,
Expand Down
2 changes: 1 addition & 1 deletion src/libs/agent-runtime/AgentRuntime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('AgentRuntime', () => {
const jwtPayload = {
apikey: 'user-azure-key',
endpoint: 'user-azure-endpoint',
apiVersion: '2024-02-01',
apiVersion: '2024-06-01',
};

const runtime = await AgentRuntime.initializeWithProviderOptions(ModelProvider.Azure, {
Expand Down
2 changes: 1 addition & 1 deletion src/locales/default/modelProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default {
azureApiVersion: {
desc: 'Azure 的 API 版本,遵循 YYYY-MM-DD 格式,查阅[最新版本](https://learn.microsoft.com/zh-cn/azure/ai-services/openai/reference#chat-completions)',
fetch: '获取列表',
title: 'Azure Api Version',
title: 'Azure API Version',
},
empty: '请输入模型 ID 添加第一个模型',
endpoint: {
Expand Down
2 changes: 1 addition & 1 deletion src/services/__tests__/chat.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ describe('AgentRuntimeOnClient', () => {
azure: {
apiKey: 'user-azure-key',
endpoint: 'user-azure-endpoint',
apiVersion: '2024-02-01',
apiVersion: '2024-06-01',
},
},
},
Expand Down

0 comments on commit a4938eb

Please sign in to comment.