minimax_box 0.0.4 copy "minimax_box: ^0.0.4" to clipboard
minimax_box: ^0.0.4 copied to clipboard

A MiniMax AI provider based on ai_box.

minimax_box #

GitHub pub package GitHub Stars Github-sponsors

A MiniMax AI provider based on ai_box.

Usage #

import 'package:ai_box/ai_box.dart';
import 'package:minimax_box/minimax_box.dart';

Future<void> main() async {
  final ai = MiniMax(apiKey: '...');

  // One-shot text generation.
  final answer = await ai.generateText(
    model: 'MiniMax-M3',
    message: 'Say hello in one short sentence.',
  );
  print(answer);

  // Multi-turn chat.
  final res = await ai.chat(
    model: 'MiniMax-M3',
    messages: [
      LLMContent.system('You are concise.'),
      LLMContent.user('What is the capital of Japan?'),
    ],
    maxTokens: 32,
  );
  print(res.text);
  print(res.usage); // token usage
}

Streaming #

True SSE streaming — text arrives incrementally and the final chunk carries the finish reason:

await for (final text in ai.generateTextStream(
  model: 'MiniMax-M3',
  message: 'Write a haiku about Dart.',
)) {
  stdout.write(text);
}

Models and key validation #

final models = await ai.getModels();
final ok = await ai.validateKey();

Tool calling, structured output and the sealed LLMException error hierarchy are all provided by ai_box — see its README for details.

0
likes
130
points
52
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A MiniMax AI provider based on ai_box.

Repository (GitHub)
View/report issues

Topics

#ai #minimax #ai-box #llm

License

MIT (license)

Dependencies

ai_box, api_http, freezed_annotation, json_annotation

More

Packages that depend on minimax_box