junr-plugin-minimax 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/README.md +94 -0
- package/dist/_assets/icon_l_en.png +0 -0
- package/dist/_assets/icon_s_en.png +0 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -0
- package/dist/llm/abab5-chat.yaml +38 -0
- package/dist/llm/abab5.5-chat.yaml +53 -0
- package/dist/llm/abab5.5s-chat.yaml +44 -0
- package/dist/llm/abab6-chat.yaml +46 -0
- package/dist/llm/abab6.5-chat.yaml +46 -0
- package/dist/llm/abab6.5s-chat.yaml +46 -0
- package/dist/llm/abab6.5t-chat.yaml +44 -0
- package/dist/llm/abab7-chat-preview.yaml +46 -0
- package/dist/llm/llm.d.ts +12 -0
- package/dist/llm/llm.d.ts.map +1 -0
- package/dist/llm/llm.js +48 -0
- package/dist/llm/minimax-m1.yaml +37 -0
- package/dist/llm/minimax-m2.5-lightning.yaml +37 -0
- package/dist/llm/minimax-m2.5.yaml +37 -0
- package/dist/llm/minimax-m2.yaml +37 -0
- package/dist/llm/minimax-text-01.yaml +46 -0
- package/dist/manifest.yaml +36 -0
- package/dist/minimax.module.d.ts +3 -0
- package/dist/minimax.module.d.ts.map +1 -0
- package/dist/minimax.module.js +16 -0
- package/dist/provider.strategy.d.ts +8 -0
- package/dist/provider.strategy.d.ts.map +1 -0
- package/dist/provider.strategy.js +34 -0
- package/dist/text-embedding/embo-01.yaml +9 -0
- package/dist/text-embedding/text-embedding.d.ts +31 -0
- package/dist/text-embedding/text-embedding.d.ts.map +1 -0
- package/dist/text-embedding/text-embedding.js +132 -0
- package/dist/tts/speech-01-hd.yaml +151 -0
- package/dist/tts/speech-01-turbo.yaml +151 -0
- package/dist/tts/speech-02-hd.yaml +151 -0
- package/dist/tts/speech-02-turbo.yaml +151 -0
- package/dist/tts/tts.d.ts +24 -0
- package/dist/tts/tts.d.ts.map +1 -0
- package/dist/tts/tts.js +207 -0
- package/dist/types.d.ts +21 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +39 -0
- package/package.json +48 -0
package/README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Xpert Plugin: MiniMax
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
`@xpert-ai/plugin-minimax` connects [MiniMax AI](https://www.minimaxi.com/) models to the [XpertAI](https://github.com/xpert-ai/xpert) platform. The plugin integrates MiniMax's OpenAI-compatible API so XpertAI agents can leverage MiniMax's large language models, text embeddings, and text-to-speech capabilities.
|
|
6
|
+
|
|
7
|
+
## Core Features
|
|
8
|
+
|
|
9
|
+
- Ships `MiniMaxModule`, which registers the NestJS provider strategy, lifecycle hooks, and configuration schema required by the plugin runtime.
|
|
10
|
+
- Implements `MiniMaxLargeLanguageModel`, a LangChain-powered adapter built on `ChatOAICompatReasoningModel` that supports streaming chat completions, function calling, and token accounting callbacks for agent telemetry.
|
|
11
|
+
- Provides `MiniMaxTextEmbeddingModel`, a custom implementation that handles MiniMax's specific embedding API format with support for document and query embedding types.
|
|
12
|
+
- Exposes `MiniMaxTTSModel`, which supports streaming text-to-speech synthesis with multiple voice options and audio formats.
|
|
13
|
+
- Shares a console-ready `manifest.yaml` that drives the XpertAI UI forms (icons, help links, credential prompts) for quick operator onboarding.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @xpert-ai/plugin-minimax
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
> **Peer Dependencies**: Ensure your host service also provides `@xpert-ai/plugin-sdk`, `@nestjs/common`, `@nestjs/config`, `@metad/contracts`, `@langchain/core`, `@langchain/openai`, `zod`, and `tslib`. Refer to `package.json` for exact versions.
|
|
22
|
+
|
|
23
|
+
## Enabling in XpertAI
|
|
24
|
+
|
|
25
|
+
1. Add the plugin to the service dependencies so Node.js can resolve `@xpert-ai/plugin-minimax`.
|
|
26
|
+
2. Declare the plugin before bootstrapping the XpertAI server:
|
|
27
|
+
```bash
|
|
28
|
+
PLUGINS=@xpert-ai/plugin-minimax
|
|
29
|
+
```
|
|
30
|
+
3. In the XpertAI admin console (or config file), create a model provider pointing to `minimax`, then add individual models that map to the specific MiniMax model variants you want to use.
|
|
31
|
+
|
|
32
|
+
## Credentials & Model Configuration
|
|
33
|
+
|
|
34
|
+
The plugin schema backs the form fields you see in the console:
|
|
35
|
+
|
|
36
|
+
| Field | Description |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| `api_key` | Required. Your MiniMax API Key from [platform.minimaxi.com](https://platform.minimaxi.com/user-center/basic-information/interface-key). |
|
|
39
|
+
| `group_id` | Required. Your MiniMax Group ID from [platform.minimaxi.com](https://platform.minimaxi.com/user-center/basic-information/interface-key). |
|
|
40
|
+
| `base_url` | Optional. Base URL for API requests (defaults to `https://api.minimaxi.com`). Useful for custom endpoints or proxy configurations. |
|
|
41
|
+
|
|
42
|
+
During validation, the plugin checks that both `api_key` and `group_id` are provided and validates the base URL format if specified.
|
|
43
|
+
|
|
44
|
+
## Supported Models
|
|
45
|
+
|
|
46
|
+
### Large Language Models (LLM)
|
|
47
|
+
- `MiniMax-M2` - Latest MiniMax M2 model
|
|
48
|
+
- `MiniMax-M2-Stable` - Stable version of M2 model
|
|
49
|
+
- `abab7-chat-preview` - Preview version of abab7 chat model
|
|
50
|
+
- `abab6.5-chat` - abab6.5 chat model
|
|
51
|
+
- `abab6.5s-chat` - Speed-optimized abab6.5 chat model
|
|
52
|
+
- `abab6.5t-chat` - Turbo version of abab6.5 chat model
|
|
53
|
+
- `abab6-chat` - abab6 chat model
|
|
54
|
+
- `abab5.5-chat` - abab5.5 chat model
|
|
55
|
+
- `abab5.5s-chat` - Speed-optimized abab5.5 chat model
|
|
56
|
+
- `abab5-chat` - abab5 chat model
|
|
57
|
+
- `minimax-text-01` - Text generation model
|
|
58
|
+
- `minimax-m1` - MiniMax M1 model
|
|
59
|
+
|
|
60
|
+
### Text Embedding Models
|
|
61
|
+
- `embo-01` - MiniMax embedding model
|
|
62
|
+
- `text-embedding-ada-002` - OpenAI-compatible embedding model
|
|
63
|
+
|
|
64
|
+
### Text-to-Speech Models
|
|
65
|
+
- `speech-01` - Standard TTS model
|
|
66
|
+
- `speech-01-hd` - High-definition TTS model
|
|
67
|
+
- `speech-01-turbo` - Turbo TTS model
|
|
68
|
+
- `speech-02` - Speech-02 model
|
|
69
|
+
- `speech-02-hd` - High-definition Speech-02 model
|
|
70
|
+
- `speech-02-turbo` - Turbo Speech-02 model
|
|
71
|
+
- `tts-1` - TTS-1 model
|
|
72
|
+
- `tts-1-hd` - High-definition TTS-1 model
|
|
73
|
+
|
|
74
|
+
## Model Capabilities
|
|
75
|
+
|
|
76
|
+
- **Conversational Models**: `MiniMaxLargeLanguageModel` merges provider credentials with per-model overrides, enables streaming, and registers token usage callbacks so agent telemetry stays accurate.
|
|
77
|
+
- **Embedding Models**: `MiniMaxTextEmbeddingModel` implements custom embedding logic to handle MiniMax's specific API format, supporting both document and query embedding types.
|
|
78
|
+
- **TTS Models**: `MiniMaxTTSModel` supports streaming text-to-speech synthesis with configurable voice settings, audio formats (mp3, wav, opus, aac, flac), and playback speed.
|
|
79
|
+
|
|
80
|
+
## Development & Debugging
|
|
81
|
+
|
|
82
|
+
From the repo root, run Nx commands for this package:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
cd xpertai
|
|
86
|
+
npx nx build models/minimax
|
|
87
|
+
npx nx lint models/minimax
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Artifacts land in `xpertai/models/minimax/dist`. Jest settings live in `jest.config.ts`.
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
This plugin is distributed under the [MIT License](../../../LICENSE) located at the repository root.
|
|
Binary file
|
|
Binary file
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { XpertPlugin } from '@xpert-ai/plugin-sdk';
|
|
3
|
+
declare const ConfigSchema: z.ZodObject<{
|
|
4
|
+
api_key: z.ZodString;
|
|
5
|
+
group_id: z.ZodString;
|
|
6
|
+
base_url: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
api_key?: string;
|
|
9
|
+
group_id?: string;
|
|
10
|
+
base_url?: string;
|
|
11
|
+
}, {
|
|
12
|
+
api_key?: string;
|
|
13
|
+
group_id?: string;
|
|
14
|
+
base_url?: string;
|
|
15
|
+
}>;
|
|
16
|
+
declare const plugin: XpertPlugin<z.infer<typeof ConfigSchema>>;
|
|
17
|
+
export { ConfigSchema };
|
|
18
|
+
export default plugin;
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAOxD,QAAA,MAAM,YAAY;;;;;;;;;;;;EAIhB,CAAC;AAQH,QAAA,MAAM,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAsBrD,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,eAAe,MAAM,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { readFileSync } from 'fs';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { MiniMaxModule } from './minimax.module.js';
|
|
5
|
+
const pkg = JSON.parse(readFileSync(join(process.cwd(), 'package.json'), 'utf8'));
|
|
6
|
+
const ConfigSchema = z.object({
|
|
7
|
+
api_key: z.string().min(1, 'API Key is required'),
|
|
8
|
+
group_id: z.string().min(1, 'Group ID is required'),
|
|
9
|
+
base_url: z.string().url().optional().describe('Optional base URL, defaults to https://api.minimaxi.com')
|
|
10
|
+
});
|
|
11
|
+
const SvgIcon = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
12
|
+
<rect width="24" height="24" rx="6" fill="#111827"/>
|
|
13
|
+
<path d="M12 4C12 4 8 8 8 12C8 16 12 20 12 20C12 20 16 16 16 12C16 8 12 4 12 4Z" fill="white" fill-opacity="0.88"/>
|
|
14
|
+
<path d="M12 8C10 8 8 10 8 12C8 14 10 16 12 16C14 16 16 14 16 12C16 10 14 8 12 8Z" fill="white"/>
|
|
15
|
+
</svg>`;
|
|
16
|
+
const plugin = {
|
|
17
|
+
meta: {
|
|
18
|
+
name: pkg.name,
|
|
19
|
+
version: pkg.version,
|
|
20
|
+
category: 'model',
|
|
21
|
+
icon: { type: 'svg', value: SvgIcon },
|
|
22
|
+
displayName: 'MiniMax',
|
|
23
|
+
description: 'MiniMax LLM / Embedding / TTS via OpenAI compatible API',
|
|
24
|
+
keywords: ['minimax', 'openai-compatible', 'llm', 'embedding', 'tts'],
|
|
25
|
+
author: 'XpertAI Team'
|
|
26
|
+
},
|
|
27
|
+
config: { schema: ConfigSchema },
|
|
28
|
+
register(ctx) {
|
|
29
|
+
ctx.logger.log('Register MiniMax plugin');
|
|
30
|
+
return { module: MiniMaxModule, global: true };
|
|
31
|
+
},
|
|
32
|
+
async onStart(ctx) {
|
|
33
|
+
ctx.logger.log('MiniMax plugin started');
|
|
34
|
+
},
|
|
35
|
+
async onStop(ctx) {
|
|
36
|
+
ctx.logger.log('MiniMax plugin stopped');
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export { ConfigSchema };
|
|
40
|
+
export default plugin;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
model: abab5-chat
|
|
2
|
+
label:
|
|
3
|
+
en_US: Abab5-Chat
|
|
4
|
+
model_type: llm
|
|
5
|
+
features:
|
|
6
|
+
- agent-thought
|
|
7
|
+
model_properties:
|
|
8
|
+
mode: chat
|
|
9
|
+
context_size: 6144
|
|
10
|
+
parameter_rules:
|
|
11
|
+
- name: temperature
|
|
12
|
+
use_template: temperature
|
|
13
|
+
- name: top_p
|
|
14
|
+
use_template: top_p
|
|
15
|
+
- name: max_tokens
|
|
16
|
+
use_template: max_tokens
|
|
17
|
+
required: true
|
|
18
|
+
default: 6144
|
|
19
|
+
min: 1
|
|
20
|
+
max: 6144
|
|
21
|
+
- name: mask_sensitive_info
|
|
22
|
+
type: boolean
|
|
23
|
+
default: true
|
|
24
|
+
label:
|
|
25
|
+
zh_Hans: 隐私保护
|
|
26
|
+
en_US: Moderate
|
|
27
|
+
help:
|
|
28
|
+
zh_Hans: 对输出中易涉及隐私问题的文本信息进行打码,目前包括但不限于邮箱、域名、链接、证件号、家庭住址等,默认true,即开启打码
|
|
29
|
+
en_US: Mask the sensitive info of the generated content, such as email/domain/link/address/phone/id..
|
|
30
|
+
- name: presence_penalty
|
|
31
|
+
use_template: presence_penalty
|
|
32
|
+
- name: frequency_penalty
|
|
33
|
+
use_template: frequency_penalty
|
|
34
|
+
pricing:
|
|
35
|
+
input: '0.015'
|
|
36
|
+
output: '0.015'
|
|
37
|
+
unit: '0.001'
|
|
38
|
+
currency: RMB
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
model: abab5.5-chat
|
|
2
|
+
label:
|
|
3
|
+
en_US: Abab5.5-Chat
|
|
4
|
+
model_type: llm
|
|
5
|
+
features:
|
|
6
|
+
- agent-thought
|
|
7
|
+
- tool-call
|
|
8
|
+
- stream-tool-call
|
|
9
|
+
model_properties:
|
|
10
|
+
mode: chat
|
|
11
|
+
context_size: 16384
|
|
12
|
+
parameter_rules:
|
|
13
|
+
- name: temperature
|
|
14
|
+
use_template: temperature
|
|
15
|
+
min: 0.01
|
|
16
|
+
max: 1
|
|
17
|
+
default: 0.9
|
|
18
|
+
- name: top_p
|
|
19
|
+
use_template: top_p
|
|
20
|
+
min: 0.01
|
|
21
|
+
max: 1
|
|
22
|
+
default: 0.95
|
|
23
|
+
- name: max_tokens
|
|
24
|
+
use_template: max_tokens
|
|
25
|
+
required: true
|
|
26
|
+
default: 6144
|
|
27
|
+
min: 1
|
|
28
|
+
max: 16384
|
|
29
|
+
- name: mask_sensitive_info
|
|
30
|
+
type: boolean
|
|
31
|
+
default: true
|
|
32
|
+
label:
|
|
33
|
+
zh_Hans: 隐私保护
|
|
34
|
+
en_US: Moderate
|
|
35
|
+
help:
|
|
36
|
+
zh_Hans: 对输出中易涉及隐私问题的文本信息进行打码,目前包括但不限于邮箱、域名、链接、证件号、家庭住址等,默认true,即开启打码
|
|
37
|
+
en_US: Mask the sensitive info of the generated content, such as email/domain/link/address/phone/id..
|
|
38
|
+
- name: presence_penalty
|
|
39
|
+
use_template: presence_penalty
|
|
40
|
+
- name: frequency_penalty
|
|
41
|
+
use_template: frequency_penalty
|
|
42
|
+
- name: plugin_web_search
|
|
43
|
+
required: false
|
|
44
|
+
default: false
|
|
45
|
+
type: boolean
|
|
46
|
+
label:
|
|
47
|
+
en_US: Enable Web Search
|
|
48
|
+
zh_Hans: 开启网页搜索
|
|
49
|
+
pricing:
|
|
50
|
+
input: '0.015'
|
|
51
|
+
output: '0.015'
|
|
52
|
+
unit: '0.001'
|
|
53
|
+
currency: RMB
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
model: abab5.5s-chat
|
|
2
|
+
label:
|
|
3
|
+
en_US: Abab5.5s-Chat
|
|
4
|
+
model_type: llm
|
|
5
|
+
features:
|
|
6
|
+
- agent-thought
|
|
7
|
+
model_properties:
|
|
8
|
+
mode: chat
|
|
9
|
+
context_size: 8192
|
|
10
|
+
parameter_rules:
|
|
11
|
+
- name: temperature
|
|
12
|
+
use_template: temperature
|
|
13
|
+
min: 0.01
|
|
14
|
+
max: 1
|
|
15
|
+
default: 0.9
|
|
16
|
+
- name: top_p
|
|
17
|
+
use_template: top_p
|
|
18
|
+
min: 0.01
|
|
19
|
+
max: 1
|
|
20
|
+
default: 0.95
|
|
21
|
+
- name: max_tokens
|
|
22
|
+
use_template: max_tokens
|
|
23
|
+
required: true
|
|
24
|
+
default: 3072
|
|
25
|
+
min: 1
|
|
26
|
+
max: 8192
|
|
27
|
+
- name: mask_sensitive_info
|
|
28
|
+
type: boolean
|
|
29
|
+
default: true
|
|
30
|
+
label:
|
|
31
|
+
zh_Hans: 隐私保护
|
|
32
|
+
en_US: Moderate
|
|
33
|
+
help:
|
|
34
|
+
zh_Hans: 对输出中易涉及隐私问题的文本信息进行打码,目前包括但不限于邮箱、域名、链接、证件号、家庭住址等,默认true,即开启打码
|
|
35
|
+
en_US: Mask the sensitive info of the generated content, such as email/domain/link/address/phone/id..
|
|
36
|
+
- name: presence_penalty
|
|
37
|
+
use_template: presence_penalty
|
|
38
|
+
- name: frequency_penalty
|
|
39
|
+
use_template: frequency_penalty
|
|
40
|
+
pricing:
|
|
41
|
+
input: '0.005'
|
|
42
|
+
output: '0.005'
|
|
43
|
+
unit: '0.001'
|
|
44
|
+
currency: RMB
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
model: abab6-chat
|
|
2
|
+
label:
|
|
3
|
+
en_US: Abab6-Chat
|
|
4
|
+
model_type: llm
|
|
5
|
+
features:
|
|
6
|
+
- agent-thought
|
|
7
|
+
- tool-call
|
|
8
|
+
- stream-tool-call
|
|
9
|
+
model_properties:
|
|
10
|
+
mode: chat
|
|
11
|
+
context_size: 32768
|
|
12
|
+
parameter_rules:
|
|
13
|
+
- name: temperature
|
|
14
|
+
use_template: temperature
|
|
15
|
+
min: 0.01
|
|
16
|
+
max: 1
|
|
17
|
+
default: 0.1
|
|
18
|
+
- name: top_p
|
|
19
|
+
use_template: top_p
|
|
20
|
+
min: 0.01
|
|
21
|
+
max: 1
|
|
22
|
+
default: 0.9
|
|
23
|
+
- name: max_tokens
|
|
24
|
+
use_template: max_tokens
|
|
25
|
+
required: true
|
|
26
|
+
default: 2048
|
|
27
|
+
min: 1
|
|
28
|
+
max: 32768
|
|
29
|
+
- name: mask_sensitive_info
|
|
30
|
+
type: boolean
|
|
31
|
+
default: true
|
|
32
|
+
label:
|
|
33
|
+
zh_Hans: 隐私保护
|
|
34
|
+
en_US: Moderate
|
|
35
|
+
help:
|
|
36
|
+
zh_Hans: 对输出中易涉及隐私问题的文本信息进行打码,目前包括但不限于邮箱、域名、链接、证件号、家庭住址等,默认true,即开启打码
|
|
37
|
+
en_US: Mask the sensitive info of the generated content, such as email/domain/link/address/phone/id..
|
|
38
|
+
- name: presence_penalty
|
|
39
|
+
use_template: presence_penalty
|
|
40
|
+
- name: frequency_penalty
|
|
41
|
+
use_template: frequency_penalty
|
|
42
|
+
pricing:
|
|
43
|
+
input: '0.1'
|
|
44
|
+
output: '0.1'
|
|
45
|
+
unit: '0.001'
|
|
46
|
+
currency: RMB
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
model: abab6.5-chat
|
|
2
|
+
label:
|
|
3
|
+
en_US: Abab6.5-Chat
|
|
4
|
+
model_type: llm
|
|
5
|
+
features:
|
|
6
|
+
- agent-thought
|
|
7
|
+
- tool-call
|
|
8
|
+
- stream-tool-call
|
|
9
|
+
model_properties:
|
|
10
|
+
mode: chat
|
|
11
|
+
context_size: 8192
|
|
12
|
+
parameter_rules:
|
|
13
|
+
- name: temperature
|
|
14
|
+
use_template: temperature
|
|
15
|
+
min: 0.01
|
|
16
|
+
max: 1
|
|
17
|
+
default: 0.1
|
|
18
|
+
- name: top_p
|
|
19
|
+
use_template: top_p
|
|
20
|
+
min: 0.01
|
|
21
|
+
max: 1
|
|
22
|
+
default: 0.95
|
|
23
|
+
- name: max_tokens
|
|
24
|
+
use_template: max_tokens
|
|
25
|
+
required: true
|
|
26
|
+
default: 2048
|
|
27
|
+
min: 1
|
|
28
|
+
max: 8192
|
|
29
|
+
- name: mask_sensitive_info
|
|
30
|
+
type: boolean
|
|
31
|
+
default: true
|
|
32
|
+
label:
|
|
33
|
+
zh_Hans: 隐私保护
|
|
34
|
+
en_US: Moderate
|
|
35
|
+
help:
|
|
36
|
+
zh_Hans: 对输出中易涉及隐私问题的文本信息进行打码,目前包括但不限于邮箱、域名、链接、证件号、家庭住址等,默认true,即开启打码
|
|
37
|
+
en_US: Mask the sensitive info of the generated content, such as email/domain/link/address/phone/id..
|
|
38
|
+
- name: presence_penalty
|
|
39
|
+
use_template: presence_penalty
|
|
40
|
+
- name: frequency_penalty
|
|
41
|
+
use_template: frequency_penalty
|
|
42
|
+
pricing:
|
|
43
|
+
input: '0.03'
|
|
44
|
+
output: '0.03'
|
|
45
|
+
unit: '0.001'
|
|
46
|
+
currency: RMB
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
model: abab6.5s-chat
|
|
2
|
+
label:
|
|
3
|
+
en_US: Abab6.5s-Chat
|
|
4
|
+
model_type: llm
|
|
5
|
+
features:
|
|
6
|
+
- agent-thought
|
|
7
|
+
- tool-call
|
|
8
|
+
- stream-tool-call
|
|
9
|
+
model_properties:
|
|
10
|
+
mode: chat
|
|
11
|
+
context_size: 245760
|
|
12
|
+
parameter_rules:
|
|
13
|
+
- name: temperature
|
|
14
|
+
use_template: temperature
|
|
15
|
+
min: 0.01
|
|
16
|
+
max: 1
|
|
17
|
+
default: 0.1
|
|
18
|
+
- name: top_p
|
|
19
|
+
use_template: top_p
|
|
20
|
+
min: 0.01
|
|
21
|
+
max: 1
|
|
22
|
+
default: 0.95
|
|
23
|
+
- name: max_tokens
|
|
24
|
+
use_template: max_tokens
|
|
25
|
+
required: true
|
|
26
|
+
default: 2048
|
|
27
|
+
min: 1
|
|
28
|
+
max: 245760
|
|
29
|
+
- name: mask_sensitive_info
|
|
30
|
+
type: boolean
|
|
31
|
+
default: true
|
|
32
|
+
label:
|
|
33
|
+
zh_Hans: 隐私保护
|
|
34
|
+
en_US: Moderate
|
|
35
|
+
help:
|
|
36
|
+
zh_Hans: 对输出中易涉及隐私问题的文本信息进行打码,目前包括但不限于邮箱、域名、链接、证件号、家庭住址等,默认true,即开启打码
|
|
37
|
+
en_US: Mask the sensitive info of the generated content, such as email/domain/link/address/phone/id..
|
|
38
|
+
- name: presence_penalty
|
|
39
|
+
use_template: presence_penalty
|
|
40
|
+
- name: frequency_penalty
|
|
41
|
+
use_template: frequency_penalty
|
|
42
|
+
pricing:
|
|
43
|
+
input: '0.01'
|
|
44
|
+
output: '0.01'
|
|
45
|
+
unit: '0.001'
|
|
46
|
+
currency: RMB
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
model: abab6.5t-chat
|
|
2
|
+
label:
|
|
3
|
+
en_US: Abab6.5t-Chat
|
|
4
|
+
model_type: llm
|
|
5
|
+
features:
|
|
6
|
+
- agent-thought
|
|
7
|
+
model_properties:
|
|
8
|
+
mode: chat
|
|
9
|
+
context_size: 8192
|
|
10
|
+
parameter_rules:
|
|
11
|
+
- name: temperature
|
|
12
|
+
use_template: temperature
|
|
13
|
+
min: 0.01
|
|
14
|
+
max: 1
|
|
15
|
+
default: 0.9
|
|
16
|
+
- name: top_p
|
|
17
|
+
use_template: top_p
|
|
18
|
+
min: 0.01
|
|
19
|
+
max: 1
|
|
20
|
+
default: 0.95
|
|
21
|
+
- name: max_tokens
|
|
22
|
+
use_template: max_tokens
|
|
23
|
+
required: true
|
|
24
|
+
default: 3072
|
|
25
|
+
min: 1
|
|
26
|
+
max: 8192
|
|
27
|
+
- name: mask_sensitive_info
|
|
28
|
+
type: boolean
|
|
29
|
+
default: true
|
|
30
|
+
label:
|
|
31
|
+
zh_Hans: 隐私保护
|
|
32
|
+
en_US: Moderate
|
|
33
|
+
help:
|
|
34
|
+
zh_Hans: 对输出中易涉及隐私问题的文本信息进行打码,目前包括但不限于邮箱、域名、链接、证件号、家庭住址等,默认true,即开启打码
|
|
35
|
+
en_US: Mask the sensitive info of the generated content, such as email/domain/link/address/phone/id..
|
|
36
|
+
- name: presence_penalty
|
|
37
|
+
use_template: presence_penalty
|
|
38
|
+
- name: frequency_penalty
|
|
39
|
+
use_template: frequency_penalty
|
|
40
|
+
pricing:
|
|
41
|
+
input: '0.005'
|
|
42
|
+
output: '0.005'
|
|
43
|
+
unit: '0.001'
|
|
44
|
+
currency: RMB
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
model: abab7-chat-preview
|
|
2
|
+
label:
|
|
3
|
+
en_US: Abab7-chat-preview
|
|
4
|
+
model_type: llm
|
|
5
|
+
features:
|
|
6
|
+
- agent-thought
|
|
7
|
+
- tool-call
|
|
8
|
+
- stream-tool-call
|
|
9
|
+
model_properties:
|
|
10
|
+
mode: chat
|
|
11
|
+
context_size: 245760
|
|
12
|
+
parameter_rules:
|
|
13
|
+
- name: temperature
|
|
14
|
+
use_template: temperature
|
|
15
|
+
min: 0.01
|
|
16
|
+
max: 1
|
|
17
|
+
default: 0.1
|
|
18
|
+
- name: top_p
|
|
19
|
+
use_template: top_p
|
|
20
|
+
min: 0.01
|
|
21
|
+
max: 1
|
|
22
|
+
default: 0.95
|
|
23
|
+
- name: max_tokens
|
|
24
|
+
use_template: max_tokens
|
|
25
|
+
required: true
|
|
26
|
+
default: 2048
|
|
27
|
+
min: 1
|
|
28
|
+
max: 245760
|
|
29
|
+
- name: mask_sensitive_info
|
|
30
|
+
type: boolean
|
|
31
|
+
default: true
|
|
32
|
+
label:
|
|
33
|
+
zh_Hans: 隐私保护
|
|
34
|
+
en_US: Moderate
|
|
35
|
+
help:
|
|
36
|
+
zh_Hans: 对输出中易涉及隐私问题的文本信息进行打码,目前包括但不限于邮箱、域名、链接、证件号、家庭住址等,默认true,即开启打码
|
|
37
|
+
en_US: Mask the sensitive info of the generated content, such as email/domain/link/address/phone/id..
|
|
38
|
+
- name: presence_penalty
|
|
39
|
+
use_template: presence_penalty
|
|
40
|
+
- name: frequency_penalty
|
|
41
|
+
use_template: frequency_penalty
|
|
42
|
+
pricing:
|
|
43
|
+
input: '0.1'
|
|
44
|
+
output: '0.1'
|
|
45
|
+
unit: '0.001'
|
|
46
|
+
currency: RMB
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ICopilotModel } from '@metad/contracts';
|
|
2
|
+
import { ChatOAICompatReasoningModel, LargeLanguageModel, TChatModelOptions } from '@xpert-ai/plugin-sdk';
|
|
3
|
+
import { MiniMaxProviderStrategy } from '../provider.strategy.js';
|
|
4
|
+
import { MiniMaxModelCredentials } from '../types.js';
|
|
5
|
+
export declare class MiniMaxLargeLanguageModel extends LargeLanguageModel {
|
|
6
|
+
constructor(modelProvider: MiniMaxProviderStrategy);
|
|
7
|
+
protected createChatModel(params: object): ChatOAICompatReasoningModel;
|
|
8
|
+
getChatModel(copilotModel: ICopilotModel, options?: TChatModelOptions): ChatOAICompatReasoningModel;
|
|
9
|
+
validateCredentials(model: string, credentials: MiniMaxModelCredentials): Promise<void>;
|
|
10
|
+
static getSupportedModels(): string[];
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=llm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm.d.ts","sourceRoot":"","sources":["../../src/llm/llm.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EACL,2BAA2B,EAE3B,kBAAkB,EAElB,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAA4C,MAAM,aAAa,CAAC;AAEhG,qBACa,yBAA0B,SAAQ,kBAAkB;gBACnD,aAAa,EAAE,uBAAuB;IAIlD,SAAS,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM;IAI/B,YAAY,CAAC,YAAY,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,iBAAiB;IAkBxE,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IAY7F,MAAM,CAAC,kBAAkB;CAG1B"}
|
package/dist/llm/llm.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { Injectable } from '@nestjs/common';
|
|
3
|
+
import { AiModelTypeEnum } from '@metad/contracts';
|
|
4
|
+
import { ChatOAICompatReasoningModel, CredentialsValidateFailedError, LargeLanguageModel, mergeCredentials } from '@xpert-ai/plugin-sdk';
|
|
5
|
+
import { MiniMaxProviderStrategy } from '../provider.strategy.js';
|
|
6
|
+
import { SUPPORTED_LLM_MODELS, toCredentialKwargs } from '../types.js';
|
|
7
|
+
let MiniMaxLargeLanguageModel = class MiniMaxLargeLanguageModel extends LargeLanguageModel {
|
|
8
|
+
constructor(modelProvider) {
|
|
9
|
+
super(modelProvider, AiModelTypeEnum.LLM);
|
|
10
|
+
}
|
|
11
|
+
createChatModel(params) {
|
|
12
|
+
return new ChatOAICompatReasoningModel(params);
|
|
13
|
+
}
|
|
14
|
+
getChatModel(copilotModel, options) {
|
|
15
|
+
const { copilot } = copilotModel;
|
|
16
|
+
const { modelProvider } = copilot;
|
|
17
|
+
const modelCredentials = mergeCredentials(modelProvider.credentials, options?.modelProperties);
|
|
18
|
+
const model = copilotModel.model;
|
|
19
|
+
const params = toCredentialKwargs(modelCredentials, model);
|
|
20
|
+
return this.createChatModel({
|
|
21
|
+
...params,
|
|
22
|
+
model,
|
|
23
|
+
streaming: copilotModel.options?.['streaming'] ?? true,
|
|
24
|
+
temperature: copilotModel.options?.['temperature'] ?? 0,
|
|
25
|
+
maxTokens: copilotModel.options?.['max_tokens'],
|
|
26
|
+
verbose: options?.verbose
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
async validateCredentials(model, credentials) {
|
|
30
|
+
if (!model || !SUPPORTED_LLM_MODELS.includes(model)) {
|
|
31
|
+
throw new CredentialsValidateFailedError(`LLM model ${model} is not supported`);
|
|
32
|
+
}
|
|
33
|
+
if (!credentials.api_key) {
|
|
34
|
+
throw new CredentialsValidateFailedError('API key is required');
|
|
35
|
+
}
|
|
36
|
+
if (!credentials.group_id) {
|
|
37
|
+
throw new CredentialsValidateFailedError('Group ID is required');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
static getSupportedModels() {
|
|
41
|
+
return SUPPORTED_LLM_MODELS;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
MiniMaxLargeLanguageModel = __decorate([
|
|
45
|
+
Injectable(),
|
|
46
|
+
__metadata("design:paramtypes", [MiniMaxProviderStrategy])
|
|
47
|
+
], MiniMaxLargeLanguageModel);
|
|
48
|
+
export { MiniMaxLargeLanguageModel };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
model: minimax-m1
|
|
2
|
+
label:
|
|
3
|
+
en_US: MiniMax-M1
|
|
4
|
+
model_type: llm
|
|
5
|
+
features:
|
|
6
|
+
- agent-thought
|
|
7
|
+
- tool-call
|
|
8
|
+
- stream-tool-call
|
|
9
|
+
model_properties:
|
|
10
|
+
mode: chat
|
|
11
|
+
context_size: 1000000
|
|
12
|
+
parameter_rules:
|
|
13
|
+
- name: temperature
|
|
14
|
+
use_template: temperature
|
|
15
|
+
min: 0.01
|
|
16
|
+
max: 1
|
|
17
|
+
default: 0.1
|
|
18
|
+
- name: top_p
|
|
19
|
+
use_template: top_p
|
|
20
|
+
min: 0.01
|
|
21
|
+
max: 1
|
|
22
|
+
default: 0.95
|
|
23
|
+
- name: max_tokens
|
|
24
|
+
use_template: max_tokens
|
|
25
|
+
required: true
|
|
26
|
+
default: 8192
|
|
27
|
+
min: 1
|
|
28
|
+
max: 1000000
|
|
29
|
+
- name: presence_penalty
|
|
30
|
+
use_template: presence_penalty
|
|
31
|
+
- name: frequency_penalty
|
|
32
|
+
use_template: frequency_penalty
|
|
33
|
+
pricing:
|
|
34
|
+
input: "0.8"
|
|
35
|
+
output: "2.4"
|
|
36
|
+
unit: "0.001"
|
|
37
|
+
currency: RMB
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
model: MiniMax-M2.5lightning
|
|
2
|
+
label:
|
|
3
|
+
en_US: MiniMax-M2.5-Lightning
|
|
4
|
+
model_type: llm
|
|
5
|
+
features:
|
|
6
|
+
- agent-thought
|
|
7
|
+
- tool-call
|
|
8
|
+
- stream-tool-call
|
|
9
|
+
model_properties:
|
|
10
|
+
mode: chat
|
|
11
|
+
context_size: 204800
|
|
12
|
+
parameter_rules:
|
|
13
|
+
- name: temperature
|
|
14
|
+
use_template: temperature
|
|
15
|
+
min: 0.01
|
|
16
|
+
max: 1
|
|
17
|
+
default: 0.1
|
|
18
|
+
- name: top_p
|
|
19
|
+
use_template: top_p
|
|
20
|
+
min: 0.01
|
|
21
|
+
max: 1
|
|
22
|
+
default: 0.95
|
|
23
|
+
- name: max_tokens
|
|
24
|
+
use_template: max_tokens
|
|
25
|
+
required: true
|
|
26
|
+
default: 10240
|
|
27
|
+
min: 1
|
|
28
|
+
max: 204800
|
|
29
|
+
- name: presence_penalty
|
|
30
|
+
use_template: presence_penalty
|
|
31
|
+
- name: frequency_penalty
|
|
32
|
+
use_template: frequency_penalty
|
|
33
|
+
pricing:
|
|
34
|
+
input: "2.1"
|
|
35
|
+
output: "8.4"
|
|
36
|
+
unit: "0.000001"
|
|
37
|
+
currency: RMB
|