Model Overview
M2-her is MiniMax’s text model optimized for dialogue scenarios, supporting rich role settings and conversation history management capabilities.Supported Models
| Model Name | Context Window | Description |
|---|---|---|
| M2-her | 2,048 | Designed for dialogue scenarios, supporting role-playing and multi-turn conversations |
M2-her Core Features
Rich Role Setting Capabilities
Rich Role Setting Capabilities
M2-her supports multiple role type configurations, including model roles (system), user roles (user_system), conversation groups (group), etc., allowing you to flexibly build complex dialogue scenarios.
Example Dialogue Learning
Example Dialogue Learning
Through sample_message_user and sample_message_ai, you can provide example dialogues to help the model better understand the expected conversation style and response patterns.
Context Memory
Context Memory
The model supports complete conversation history management and can conduct coherent multi-turn conversations based on previous content, providing a more natural interactive experience.
Usage Example
1
Install SDK
2
Set Environment Variables
3
Call M2-her
Role Type Description
M2-her supports the following message role types:Basic Roles
| Role Type | Description | Use Case |
|---|---|---|
system | Define the model’s role and behavior | Define AI’s identity, personality, knowledge scope, etc. |
user | User’s input | Messages sent by the user |
assistant | Model’s historical responses | AI’s previous responses, used for multi-turn conversations |
Advanced Roles
| Role Type | Description | Use Case |
|---|---|---|
user_system | Define user’s role and persona | Define user identity in role-playing scenarios |
group | Conversation name | Identify conversation group or scenario name |
sample_message_user | Example user input | Provide examples of user messages |
sample_message_ai | Example model output | Provide examples of expected AI responses |
Usage Scenario Examples
Scenario 1: Basic Conversation
Scenario 2: Role-Playing Conversation
Scenario 3: Example Learning Conversation
Parameter Description
Core Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
model | string | - | Model name, fixed as M2-her |
messages | array | - | Conversation message list, see API Reference |
temperature | number | 1.0 | Temperature coefficient, controls output randomness |
top_p | number | 0.95 | Sampling strategy parameter |
max_completion_tokens | integer | - | Maximum length of generated content, up to 2048 |
stream | boolean | false | Whether to use streaming output |
Best Practices
Set Roles Appropriately
Set Roles Appropriately
Use
system to define AI’s basic behavior and user_system to define user identity, making conversations more natural and scenario-appropriate.Provide Example Conversations
Provide Example Conversations
Provide 1-3 example conversations through
sample_message_user and sample_message_ai to effectively guide the model’s response style.Maintain Conversation History
Maintain Conversation History
Keep complete conversation history (including
user and assistant messages) for the model to provide coherent responses based on context.Control Conversation Length
Control Conversation Length
Set appropriate
max_completion_tokens according to scenario needs to avoid responses being too long or truncated.FAQ
How to implement multi-turn conversations?
How to implement multi-turn conversations?
Include complete conversation history in each request, arranging
user and assistant messages in chronological order.What's the difference between user_system and system?
What's the difference between user_system and system?
system defines AI’s role, while user_system defines the user’s role. In role-playing scenarios, using both together creates richer conversation experiences.Do example messages consume tokens?
Do example messages consume tokens?
Yes, all messages (including example messages) count toward input tokens. It’s recommended to provide 1-3 concise examples.
Does it support image input?
Does it support image input?
M2-her currently only supports text input and does not support mixed text-image input.