搜尋套件、儲存庫與 APP 分類

GitHub 儲存庫nomtek/mistralai_client_dart

mistralai_client_dart

這是 Mistral AI API 的非官方 Dart/Flutter 客戶端。

mistralai_client_dart 專案封面
星標
32
分支
1
最近推送(UTC)
2025年6月4日
專案狀態
未封存

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

Mistral AI client for Dart (Deprecated)

.github/workflows/check.yaml style: very good analysis

⚠️ Deprecation Notice

This library is deprecated and no longer maintained.

We recommend migrating to actively maintained alternatives for continued support and updates.

Description

This is an unofficial Dart/Flutter client for the Mistral AI API.

Installation

dart pub add mistralai_client_dart

Usage

Create client
import 'package:mistralai_client_dart/mistralai_client_dart.dart';

final client = MistralAIClient(apiKey: 'your api key here');
List models
final modelsResult = await client.listModels();
final models = modelsResult.data?.map((e) => e.id).toList();
print(models?.join(', '));
Chat
const request = ChatCompletionRequest(
  model: 'mistral-small-latest',
  messages: [
    UserMessage(content: UserMessageContent.string('Hello chat!')),
  ],
);
final chatCompletion = await client.chatComplete(request: request);
final chatMessage = chatCompletion.choices?[0].message;
print(chatMessage?.content);
Chat stream
final stream = client.chatStream(request: request);
await for (final completionChunk in stream) {
  final chatMessage = completionChunk.choices[0].delta.content;
  if (chatMessage != null) {
    print(chatMessage);
  }
}
Embeddings
final embeddings = await client.createEmbeddings(
  request: const EmbeddingRequest(
    model: 'mistral-embed',
    input: EmbeddingRequestInput.arrayString(['Hello chat!']),
  ),
);
for (final data in embeddings.data) {
  print('Embeddings: ${data.embedding}');
}
Function calling

Check examples:

Files

Check examples:

Fine-tuning Jobs

Check examples:

Fill in the middle completion

Check examples:

Agents

Check examples:

Moderation

Check examples:

Resources

You can check the official Mistral AI docs.

Contributing

For contributing guide please see CONTRIBUTING.md.

Flutter Flow (deprecated)

For Flutter Flow integration please use the mistralai_client_dart_flutter_flow package.

It's a version of this package that is adapted to work with Flutter Flow.

Aknowledgements

Part of the code was generated thx to openapi_spec package.

nomtek GitHub avatar
GitHub 作者

nomtek ↗

語言Dart

分類

此儲存庫發佈的套件

使用的依賴

依賴清單 10 項

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗