dart_mistral_api 1.0.4 copy "dart_mistral_api: ^1.0.4" to clipboard
dart_mistral_api: ^1.0.4 copied to clipboard

Dart package for Mistral AI API access

Dart Mistral API Package #

This Dart package provides idiomatic access to the Mistral AI API for both Dart and Flutter applications. Mistral AI is a powerful platform for artificial intelligence and machine learning tasks, and this package simplifies integration with your Dart and Flutter projects.

Installation #

Add the following to your pubspec.yaml:

dependencies:
  dart_mistral_api: ^1.0.4

Then, run:

$ flutter pub get

Usage #

Import the package where you need to use it:

import 'package:dart_mistral_api/dart_mistral_api.dart';

Initialize the Mistral API client with your API key:

final mistral = MistralService(apiKey: 'your_api_key');

Now you can use the various methods provided by the Mistral API. For example:
Send a request to the Mistral Chat models endpoint.

final List<MistralModel> models = mistral.listModels(); 

Send a request to the Mistral Chat completions endpoint.

var mistralRequest = MistralRequest();
final MistralResponse response = mistral.sendMistralRequest(mistralRequest); 

Send a request to the Mistral Chat embeddings endpoint.

var mistralEmbeddingRequest = MistralEmbeddingRequest();
final List<MistralEmbeddingResponse> response = mistral.sendEmbeddingRequest(mistralEmbeddingRequest); 

For more details on available methods and their usage, refer to the API documentation.

Authentication #

You need an API key from Mistral AI to use this package. You can sign up and get your API key from the Mistral AI website.

Example #

You can find a simple example in the example directory of this repository.

Issues and Feedback #

Please file any issues, bugs, or feature requests in the issue tracker.

License #

This package is licensed under the MIT License. See the LICENSE file for details.

0
likes
120
points
49
downloads

Publisher

unverified uploader

Weekly Downloads

Dart package for Mistral AI API access

Documentation

API reference

License

unknown (license)

Dependencies

dio, json_annotation

More

Packages that depend on dart_mistral_api