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 ↗