Feat: add Enjoy AI as option (#206)

* add enjoyAI as option

* use enjoyai config

* may call enjoyai

* may set default ai engine

* refactor setting context

* refactor preferences

* add warning when openai key not provided

* tweak locale

* update duration for audio/video

* add balance settings

* may select ai role when create conversation

* may forward message from conversation

* tweak ui

* refactor transcribe method

* refactor ai commands to hooks

* fix webapi

* tweak playback rate options

* add playMode, next & prev, ref: #124

* upgrade deps

* may skip whisper model download

* audios/videos default order by updated_At
This commit is contained in:
an-lee
2024-01-31 00:04:59 +08:00
committed by GitHub
parent 58dcd1523e
commit 00cbc8403b
56 changed files with 1590 additions and 858 deletions

View File

@@ -13,8 +13,9 @@ export class Client {
baseUrl: string;
accessToken?: string;
logger?: any;
locale?: "en" | "zh-CN";
}) {
const { baseUrl, accessToken, logger } = options;
const { baseUrl, accessToken, logger, locale = "en" } = options;
this.baseUrl = baseUrl;
this.logger = logger || console;
@@ -27,6 +28,7 @@ export class Client {
});
this.api.interceptors.request.use((config) => {
config.headers.Authorization = `Bearer ${accessToken}`;
config.headers['Accept-Language'] = locale;
this.logger.debug(
config.method.toUpperCase(),