搜索插件、代码仓与 APP 分类

插件详情v1.1.0+1

mistralai_client_dart

(已弃用) 这是一个用于 Mistral AI API 的非官方 Dart/Flutter 客户端。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
34
喜欢数
12
Pub 分数
150

安装插件

flutter pub add mistralai_client_dart

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Mistral AI API 的非官方 Dart/Flutter 客户端,可在 Flutter 应用中集成 Mistral 的大型语言模型。此包简化了向 Mistral 模型发起 API 调用的过程,适用于文本生成、聊天交互和自然语言处理等任务。注意:该包已弃用,可能不会接收更新或对新 API 变更的支持。支持多种平台,包括 Android、iOS、Web、macOS、Windows 和 Linux。

适合场景

  • 将 Mistral AI 模型集成到 Flutter 应用中
  • 构建基于人工智能的聊天界面
  • 使用大型语言模型生成文本
  • 使用AI创建多语言应用程序
  • 在跨平台应用中进行AI功能的原型设计

主要特点

  • 非官方但功能完整的 API 包装器
  • 支持所有主要平台
  • 用于常见 AI 任务的简单方法调用
  • 专为 Flutter 开发打造
  • 轻量且易于集成

适合对象

  • 在Flutter中开发AI功能的开发者
  • Teams 正在开发 LLM 集成
  • 需要快速访问 Mistral AI 的项目
  • 教育或实验性人工智能应用

使用建议

  • 该软件包已弃用 – 自行承担风险使用
  • 可能不支持最新的 Mistral API 更新
  • 无官方维护或支持
  • 需要手动处理 API 密钥和错误
  • 未经验证不建议在生产环境中使用

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

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.

所属分类

依赖

依赖清单 4 项

源码仓库

使用此插件的项目

暂无相关数据。