mistralai_client_dart
(अप्रचलित) यह Mistral AI API के लिए अनौपचारिक Dart/Flutter क्लाइंट है।
यह Mistral AI API के लिए अनौपचारिक Dart/Flutter क्लाइंट है।
यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
This library is deprecated and no longer maintained.
We recommend migrating to actively maintained alternatives for continued support and updates.
This is an unofficial Dart/Flutter client for the Mistral AI API.
dart pub add mistralai_client_dart
import 'package:mistralai_client_dart/mistralai_client_dart.dart';
final client = MistralAIClient(apiKey: 'your api key here');
final modelsResult = await client.listModels();
final models = modelsResult.data?.map((e) => e.id).toList();
print(models?.join(', '));
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);
final stream = client.chatStream(request: request);
await for (final completionChunk in stream) {
final chatMessage = completionChunk.choices[0].delta.content;
if (chatMessage != null) {
print(chatMessage);
}
}
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}');
}
Check examples:
Check examples:
Check examples:
Check examples:
Check examples:
Check examples:
You can check the official Mistral AI docs.
For contributing guide please see CONTRIBUTING.md.
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.
Part of the code was generated thx to openapi_spec package.
निर्भरता सूची 10 आइटम
^2.4.4^1.2.0^4.8.1^1.10.0^2.4.9^2.4.1^6.7.1{"git":{"url":"https://github.com/gawi151/openapi_spec.git","ref":"feat/better-all-of-generation-support"}}^1.24.9^5.1.0उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗