Package com.tnsai.llm.providers
Class MiniMaxClient
java.lang.Object
com.tnsai.llm.providers.AbstractLLMClient
com.tnsai.llm.providers.MiniMaxClient
- All Implemented Interfaces:
JsonCapableLLMClient,com.tnsai.llm.LLMClient
MiniMax LLM client implementation.
Provides access to MiniMax's models via OpenAI-compatible API.
MiniMax is a Chinese AI company offering advanced language models with extensive context windows (up to 1M tokens) and multimodal capabilities.
Supported models:
- MiniMax-M2 - Latest flagship model with 1M context
- MiniMax-M2.1 - Enhanced multilingual capabilities
- MiniMax-Text-01 - Text-optimized model
- abab6.5s-chat - Balanced performance and speed
- abab6.5t-chat - Turbo version for faster responses
- abab5.5s-chat - Efficient model for simpler tasks
Configuration via environment variables:
- MINIMAX_API_KEY - Required API key for authentication
- MINIMAX_BASE_URL - Optional, defaults to https://api.minimax.io/v1
- MINIMAX_GROUP_ID - Optional group ID for some endpoints
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionMiniMaxClient(String model) MiniMaxClient(String model, float temperature) MiniMaxClient(String model, float temperature, Float topP, Integer maxTokens) MiniMaxClient(String model, float temperature, Integer maxTokens) MiniMaxClient(String baseUrl, String model, float temperature, Float topP, Integer maxTokens, String apiKey, String groupId, boolean reasoningSplit) MiniMaxClient(String baseUrl, String model, float temperature, Integer maxTokens, String apiKey, String groupId, boolean reasoningSplit) -
Method Summary
Modifier and TypeMethodDescriptionstatic MiniMaxClient.Builderbuilder()Builder for MiniMaxClient.com.tnsai.llm.ChatResponsechat(String message, Optional<String> systemPrompt, Optional<List<Map<String, Object>>> history, Optional<List<Map<String, Object>>> tools) com.tnsai.llm.ChatResponsechatWithFormat(String message, Optional<String> systemPrompt, Optional<List<Map<String, Object>>> history, Optional<List<Map<String, Object>>> tools, ResponseFormat format) Sends a chat message with the specified response format.static MiniMaxClientCreates a MiniMaxClient configured for China region.Returns the configured group ID.streamChat(String message, Optional<String> systemPrompt, Optional<List<Map<String, Object>>> history, Optional<List<Map<String, Object>>> tools) booleanReturns true if the current model supports extended context (1M tokens).booleansupportsFormat(ResponseFormat format) Checks if this client supports the given response format.booleanReturns true if the current model supports reasoning split mode.Methods inherited from class com.tnsai.llm.providers.AbstractLLMClient
getBaseUrl, getCallTimeoutMs, getMaxTokens, getModel, getTemperature, getTopPMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.tnsai.llm.format.JsonCapableLLMClient
chatJson, chatJson, chatWithSchema, chatWithSchemaMethods inherited from interface com.tnsai.llm.LLMClient
chat, chat, chat, chat, chat, getCapabilities, getMaxTokens, getModel, getProviderName, getTemperature, getTopP, listModels, streamChat, streamChat, streamChatWithHandler, streamChatWithHandler, streamChatWithSpec, streamChatWithSpec
-
Constructor Details
-
MiniMaxClient
-
MiniMaxClient
-
MiniMaxClient
-
MiniMaxClient
-
MiniMaxClient
-
MiniMaxClient
-
-
Method Details
-
chat
public com.tnsai.llm.ChatResponse chat(String message, Optional<String> systemPrompt, Optional<List<Map<String, Object>>> history, Optional<List<Map<String, Object>>> tools) - Specified by:
chatin interfacecom.tnsai.llm.LLMClient
-
chatWithFormat
public com.tnsai.llm.ChatResponse chatWithFormat(String message, Optional<String> systemPrompt, Optional<List<Map<String, Object>>> history, Optional<List<Map<String, Object>>> tools, ResponseFormat format) Description copied from interface:JsonCapableLLMClientSends a chat message with the specified response format.- Specified by:
chatWithFormatin interfaceJsonCapableLLMClient- Parameters:
message- The user messagesystemPrompt- Optional system prompthistory- Optional conversation historytools- Optional list of available toolsformat- The desired response format- Returns:
- The LLM response
-
streamChat
public Stream<String> streamChat(String message, Optional<String> systemPrompt, Optional<List<Map<String, Object>>> history, Optional<List<Map<String, Object>>> tools) - Specified by:
streamChatin interfacecom.tnsai.llm.LLMClient
-
supportsFormat
Description copied from interface:JsonCapableLLMClientChecks if this client supports the given response format.- Specified by:
supportsFormatin interfaceJsonCapableLLMClient- Parameters:
format- The format to check- Returns:
- true if the format is supported
-
supportsExtendedContext
public boolean supportsExtendedContext()Returns true if the current model supports extended context (1M tokens). -
supportsReasoningSplit
public boolean supportsReasoningSplit()Returns true if the current model supports reasoning split mode. -
getGroupId
Returns the configured group ID. -
forChina
Creates a MiniMaxClient configured for China region. -
builder
Builder for MiniMaxClient.
-