chrome_ai
Flutter에서 Chrome AI 지원. 이 패키지는 Chrome AI API용 래퍼입니다. Flutter에서 Chrome AI API를 사용하는 간단한 방법을 제공합니다.
melodysdreamj/chrome_ai open-source repository details.
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
Recently, Chrome has added window.ai — a Gemini Nano AI model right inside your browser. This means that web developers can instantly and unlimitedly use on-device AI without any configuration.
I believe this will truly transform web applications. The use-cases are endless: smart auto-completion, error correction and validation, natural language filtering, auto-filling forms, UI suggestions, first-pass summarization, and search.
Accordingly, I have developed a library to enable this feature in Flutter. With this library, you can easily utilize the feature in Flutter web as well.
you can watch this video to see how to enable AI in Chrome and run this library.
Chrome built-in AI is a preview feature, you need to use chrome version 127 or greater, now in dev or canary channel, may release on stable chanel at Jul 17, 2024.
After then, you should turn on these flags:
EnabledEnabled BypassPrefRequirementOptimization Guide On Device Model to download the model.flutter pub add chrome_ai
flutter run -d web-server
http://localhost:portimport 'package:chrome_ai/chrome_ai.dart';
final availability = await ChromeAI.canCreateTextSession();
if(availability == AIModelAvailability.no){
// can not create text session
}else if(availability == AIModelAvailability.afterDownload) {
// need to download model
}else if(availability == AIModelAvailability.readily){
// model is ready
}
import 'package:chrome_ai/chrome_ai.dart';
final session = await ChromeAI.createTextSession();
var result = await session.prompt("why is the sky blue?");
print(result);
import 'package:chrome_ai/chrome_ai.dart';
final session = await ChromeAI.createTextSession();
final stream = session.promptStreaming("why is the sky blue?");
stream.listen((result) {
print(result);
}).onError((e, stackTrace) {
print(e.toString());
});
This project is very new. If you have any questions, please open an issue. Contributions are very welcome.
의존성 목록 4 개
{"sdk":"flutter"}^0.7.1{"sdk":"flutter"}^3.0.0사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗