mistral_sgela_ai 1.0.1 mistral_sgela_ai: ^1.0.1 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:
mistral_sgela_ai: ^1.0.1
Then, run:
$ flutter pub get
Usage #
Import the package where you need to use it:
import 'package:mistral_sgela_ai/mistral_sgela_ai.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.