From 9f3cab831c0af44c085c4bdfd4e8e89b147f1c9d Mon Sep 17 00:00:00 2001 From: an-lee Date: Wed, 7 Feb 2024 12:16:25 +0800 Subject: [PATCH] Fix locale & enjoyai config & refactor filename (#279) * max retries = 3 for enjoyai * refactor file name * update locale --- enjoy/src/i18n/en.json | 6 +++--- enjoy/src/i18n/zh-CN.json | 4 ++-- enjoy/src/renderer/hooks/index.ts | 6 +++--- .../renderer/hooks/{useAiCommand.tsx => use-ai-command.tsx} | 0 .../hooks/{useConversation.tsx => use-conversation.tsx} | 1 + .../renderer/hooks/{useTranscode.tsx => use-transcode.tsx} | 0 6 files changed, 9 insertions(+), 8 deletions(-) rename enjoy/src/renderer/hooks/{useAiCommand.tsx => use-ai-command.tsx} (100%) rename enjoy/src/renderer/hooks/{useConversation.tsx => use-conversation.tsx} (99%) rename enjoy/src/renderer/hooks/{useTranscode.tsx => use-transcode.tsx} (100%) diff --git a/enjoy/src/i18n/en.json b/enjoy/src/i18n/en.json index 05a380f2..018aab81 100644 --- a/enjoy/src/i18n/en.json +++ b/enjoy/src/i18n/en.json @@ -20,9 +20,9 @@ "isTranscribed": "transcribed", "added": "Successfully added audio", "removed": "Successfully removed audio", - "notFound": "Video not found", + "notFound": "Audio not found", "fileTooLarge": "File too large {{ file }}", - "failedToAdd": "Failed to add audio, {{ error }}", + "failedToAdd": "Failed to add, {{ error }}", "fileNotFound": "File not found {{file}}", "fileNotSupported": "File not supported {{file}}", "failedToCopyFile": "Failed to copy file {{file}}", @@ -47,7 +47,7 @@ "removed": "Successfully removed video", "notFound": "Video not found", "fileTooLarge": "File too large {{ file }}", - "failedToAdd": "Failed to add video, {{ error }}", + "failedToAdd": "Failed to add, {{ error }}", "fileNotFound": "File not found {{file}}", "fileNotSupported": "File not supported {{file}}", "failedToCopyFile": "Failed to copy file {{file}}", diff --git a/enjoy/src/i18n/zh-CN.json b/enjoy/src/i18n/zh-CN.json index 89ff47fc..6996fdfa 100644 --- a/enjoy/src/i18n/zh-CN.json +++ b/enjoy/src/i18n/zh-CN.json @@ -22,7 +22,7 @@ "removed": "成功删除音频", "notFound": "未找到音频", "fileTooLarge": "文件太大了 {{ file }}", - "failedToAdd": "添加音频失败, {{error}}", + "failedToAdd": "添加失败, {{error}}", "fileNotFound": "无法访问文件 {{file}}", "fileNotSupported": "文件不支持 {{file}}", "failedToCopyFile": "无法复制文件 {{file}}", @@ -47,7 +47,7 @@ "removed": "成功删除视频", "notFound": "未找到视频", "fileTooLarge": "文件太大了 {{ file }}", - "failedToAdd": "添加视频失败, {{error}}", + "failedToAdd": "添加失败, {{error}}", "fileNotFound": "无法访问文件 {{file}}", "fileNotSupported": "文件不支持 {{file}}", "failedToCopyFile": "无法复制文件 {{file}}", diff --git a/enjoy/src/renderer/hooks/index.ts b/enjoy/src/renderer/hooks/index.ts index 8c678842..ee7f37de 100644 --- a/enjoy/src/renderer/hooks/index.ts +++ b/enjoy/src/renderer/hooks/index.ts @@ -1,3 +1,3 @@ -export * from './useTranscode'; -export * from './useAiCommand'; -export * from './useConversation'; +export * from './use-transcode'; +export * from './use-ai-command'; +export * from './use-conversation'; diff --git a/enjoy/src/renderer/hooks/useAiCommand.tsx b/enjoy/src/renderer/hooks/use-ai-command.tsx similarity index 100% rename from enjoy/src/renderer/hooks/useAiCommand.tsx rename to enjoy/src/renderer/hooks/use-ai-command.tsx diff --git a/enjoy/src/renderer/hooks/useConversation.tsx b/enjoy/src/renderer/hooks/use-conversation.tsx similarity index 99% rename from enjoy/src/renderer/hooks/useConversation.tsx rename to enjoy/src/renderer/hooks/use-conversation.tsx index e1687cfc..fe5b12bc 100644 --- a/enjoy/src/renderer/hooks/useConversation.tsx +++ b/enjoy/src/renderer/hooks/use-conversation.tsx @@ -36,6 +36,7 @@ export const useConversation = () => { configuration: { baseURL: `${apiUrl}/api/ai`, }, + maxRetries: 3, modelName: model, temperature, maxTokens, diff --git a/enjoy/src/renderer/hooks/useTranscode.tsx b/enjoy/src/renderer/hooks/use-transcode.tsx similarity index 100% rename from enjoy/src/renderer/hooks/useTranscode.tsx rename to enjoy/src/renderer/hooks/use-transcode.tsx