chrome_ai 패키지는 Chrome AI API를 위한 플러터 래퍼로, 개발자가 플러터 애플리케이션에 Chrome AI 기능을 통합할 수 있도록 해줍니다. 자연어 처리 및 생성 응답과 같은 AI 기반 기능에 대한 접근을 간소화합니다. 플러터 프로젝트에서 원활하게 사용하도록 설계되었으며, 복잡한 API 상호작용을 간단한 메서드로 추상화합니다. AI 기반 채팅, 콘텐츠 생성 또는 지능형 사용자 지원을 활용하려는 앱에 적합합니다. 미래의 플랫폼 확장을 지원하지만, 현재 플랫폼 지원은 명시되어 있지 않습니다.
사용 사례
AI 기반 채팅 인터페이스
앱에서의 콘텐츠 생성
스마트 어시스턴트 통합
실시간 언어 처리
AI와 사용자 상호작용 향상
자동 응답 시스템
주요 기능
Chrome AI를 위한 간단한 API 래퍼
무결점 플러터 통합
생성형 AI 작업을 지원합니다
깨끗하고 사용하기 쉬운 방법
플랫폼 확장에 대비한 미래 지향적
경량이고 집중된
적합한 대상
AI 기능이 강화된 Flutter 앱을 개발하는 개발자
Chrome AI 기능을 통합하는 팀
실시간 텍스트 생성이 필요한 앱
인공지능 기반 사용자 경험 프로토타이핑
최소한의 설정 오버헤드를 목표로 하는 프로젝트
고려 사항
특정 플랫폼 지원이 목록에 없습니다
외부 Chrome AI API 사용 가능성을 의존합니다
제한된 문서가 암시함
AI 호출을 위해 인터넷 연결이 필요합니다
출판사의 유지보수에 따라 다름
오프라인 AI 기능에 적합하지 않습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
ChromeAI
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.
Installation
you can watch this video to see how to enable AI in Chrome and run this library.
[chrome://components/](chrome://components/): Click Optimization Guide On Device Model to download the model.
2. Add library
flutter pub add chrome_ai
3. Run your project
1. Open terminal and run web-server
flutter run -d web-server
2. Open Chrome dev or canary, and open your project in http://localhost:port
Usage
Check Availability of Chrome AI
import'package:chrome_ai/chrome_ai.dart';
final availability = awaitChromeAI.canCreateTextSession();
if(availability == AIModelAvailability.no){
// can not create text session
}elseif(availability == AIModelAvailability.afterDownload) {
// need to download model
}elseif(availability == AIModelAvailability.readily){
// model is ready
}
Generate Text
import'package:chrome_ai/chrome_ai.dart';
final session = awaitChromeAI.createTextSession();
var result = await session.prompt("why is the sky blue?");
print(result);
Generate Streaming Text
import'package:chrome_ai/chrome_ai.dart';
final session = awaitChromeAI.createTextSession();
final stream = session.promptStreaming("why is the sky blue?");
stream.listen((result) {
print(result);
}).onError((e, stackTrace) {
print(e.toString());
});
Need Help!
This project is very new. If you have any questions, please open an issue. Contributions are very welcome.