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:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user