koishi-plugin-minimax-vits 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ import { Context, Schema } from 'koishi';
2
+ export declare const name = "minimax-vits";
3
+ export interface Config {
4
+ apiKey: string;
5
+ groupId: string;
6
+ apiBase?: string;
7
+ model?: string;
8
+ temperature?: number;
9
+ maxTokens?: number;
10
+ ttsEnabled?: boolean;
11
+ ttsApiKey?: string;
12
+ defaultVoice?: string;
13
+ speechModel?: string;
14
+ }
15
+ export declare const Config: Schema<Config>;
16
+ export declare function apply(ctx: Context, config: Config): void;
package/lib/index.js ADDED
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Config = exports.name = void 0;
4
+ exports.apply = apply;
5
+ const koishi_1 = require("koishi");
6
+ exports.name = 'minimax-vits';
7
+ exports.Config = koishi_1.Schema.object({
8
+ apiKey: koishi_1.Schema.string().required().description('MiniMax API Key').role('secret'),
9
+ groupId: koishi_1.Schema.string().required().description('MiniMax Group ID'),
10
+ apiBase: koishi_1.Schema.string().default('https://api.minimaxi.com/v1').description('API 基础地址'),
11
+ model: koishi_1.Schema.string().default('abab6.5s-chat').description('使用的模型名称'),
12
+ temperature: koishi_1.Schema.number().default(0.7).min(0).max(2).description('温度参数 (0-2)'),
13
+ maxTokens: koishi_1.Schema.number().default(2048).min(1).max(4096).description('最大 token 数'),
14
+ ttsEnabled: koishi_1.Schema.boolean().default(false).description('是否启用 TTS 功能'),
15
+ ttsApiKey: koishi_1.Schema.string().description('TTS API Key(如果与主 API Key 不同)').role('secret'),
16
+ defaultVoice: koishi_1.Schema.string().default('Chinese_female_gentle').description('默认语音 ID'),
17
+ speechModel: koishi_1.Schema.string().default('speech-2.6').description('TTS 模型名称'),
18
+ }).description('MiniMax VITS 配置');
19
+ function apply(ctx, config) {
20
+ ctx.logger('minimax-vits').info('MiniMax VITS 插件已加载');
21
+ ctx.logger('minimax-vits').info(`API Key: ${config.apiKey ? '已配置' : '未配置'}`);
22
+ ctx.logger('minimax-vits').info(`Group ID: ${config.groupId || '未配置'}`);
23
+ if (config.ttsEnabled) {
24
+ ctx.logger('minimax-vits').info('TTS 功能已启用');
25
+ }
26
+ }
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "koishi-plugin-minimax-vits",
3
+ "description": "使用 minimax 国际版生成语音,适配 chatluna",
4
+ "version": "0.0.1",
5
+ "main": "lib/index.js",
6
+ "typings": "lib/index.d.ts",
7
+ "files": [
8
+ "lib",
9
+ "dist",
10
+ "readme.md"
11
+ ],
12
+ "license": "MIT",
13
+ "keywords": [
14
+ "chatbot",
15
+ "koishi",
16
+ "plugin",
17
+ "minimax",
18
+ "tts",
19
+ "vits",
20
+ "chatluna"
21
+ ],
22
+ "peerDependencies": {
23
+ "koishi": "^4.18.10"
24
+ },
25
+ "devDependencies": {
26
+ "@types/node": "^20.0.0",
27
+ "typescript": "^5.0.0"
28
+ },
29
+ "scripts": {
30
+ "build": "tsc"
31
+ },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/yushangjianghe-cell/minimax-vits.git"
35
+ },
36
+ "bugs": {
37
+ "url": "https://github.com/yushangjianghe-cell/minimax-vits.git"
38
+ },
39
+ "homepage": "https://github.com/yushangjianghe-cell/minimax-vits.git"
40
+ }
package/readme.md ADDED
@@ -0,0 +1,48 @@
1
+ # koishi-plugin-minimax-vits
2
+
3
+ [![npm](https://img.shields.io/npm/v/koishi-plugin-minimax-vits?style=flat-square)](https://www.npmjs.com/package/koishi-plugin-minimax-vits)
4
+
5
+ 使用 minimax 国际版生成语音,适配 chatluna
6
+
7
+ ## 安装
8
+
9
+ 在 Koishi 插件目录下运行:
10
+
11
+ ```bash
12
+ npm install koishi-plugin-minimax-vits
13
+ # 或
14
+ yarn add koishi-plugin-minimax-vits
15
+ ```
16
+
17
+ ## 配置
18
+
19
+ 在 `koishi.yml` 中添加插件配置:
20
+
21
+ ```yaml
22
+ plugins:
23
+ minimax-vits:
24
+ apiKey: your-api-key
25
+ groupId: your-group-id
26
+ ttsEnabled: true
27
+ ```
28
+
29
+ ### 配置项说明
30
+
31
+ - `apiKey` (必需): MiniMax API Key
32
+ - `groupId` (必需): MiniMax Group ID
33
+ - `apiBase` (可选): API 基础地址,默认为 `https://api.minimaxi.com/v1`
34
+ - `model` (可选): 使用的模型名称,默认为 `abab6.5s-chat`
35
+ - `temperature` (可选): 温度参数 (0-2),默认为 `0.7`
36
+ - `maxTokens` (可选): 最大 token 数,默认为 `2048`
37
+ - `ttsEnabled` (可选): 是否启用 TTS 功能,默认为 `false`
38
+ - `ttsApiKey` (可选): TTS API Key(如果与主 API Key 不同)
39
+ - `defaultVoice` (可选): 默认语音 ID,默认为 `Chinese_female_gentle`
40
+ - `speechModel` (可选): TTS 模型名称,默认为 `speech-2.6`
41
+
42
+ ## 使用
43
+
44
+ 安装并配置后,插件会自动加载。你可以在 Koishi 控制台的配置页面中直接填写配置信息。
45
+
46
+ ## 许可证
47
+
48
+ MIT