패키지, 저장소 및 앱 카테고리 검색

패키지 상세v1.0.0

flutter_ai_toolkit

모바일, 데스크톱 및 웹을 대상으로 하는 Flutter 앱용 AI 채팅 위젯으로 텍스트, 이미지 및 음성 입력을 지원합니다.

AndroidiOSWebmacOS
30일 다운로드
1.2만
좋아요
246
Pub 점수
140

패키지 설치

flutter pub add flutter_ai_toolkit

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Flutter AI Toolkit은 모바일, 데스크톱 및 웹 플랫폼용 Flutter 애플리케이션을 위한 다기능 AI 기반 채팅 위젯입니다. 텍스트, 이미지, 음성 입력을 지원하며 생성형 AI 기능을 원활하게 통합할 수 있습니다. 지능형 대화 인터페이스를 통해 사용자 상호작용을 향상시키고자 하는 개발자를 위해 설계되었으며, 복잡한 설정 없이도 고급 AI 기능을 앱에 쉽게 통합할 수 있도록 합니다. 최신 LLM을 활용해 실시간 응답을 제공하므로 챗봇, 가상 비서, 인터랙티브 콘텐츠 도구에 이상적입니다. 이 패키지는 Flutter Labs에서 유지보수되며 GitHub에 호스팅되어 있어 투명성과 커뮤니티 기여를 보장합니다.

사용 사례

  • AI 기반 고객 지원
  • 상호작용 학습 앱
  • 음성 기능이 있는 가상 비서
  • 콘텐츠 생성 도구
  • 실시간 협업 채팅

주요 기능

  • 텍스트, 이미지 및 음성 입력 지원
  • 크로스 플랫폼 호환성
  • 실시간 AI 응답
  • Flutter와의 간편한 통합
  • 채팅 인터페이스용 내장 UI 컴포넌트

적합한 대상

  • AI 챗 기능을 구축하는 개발자
  • 교육 앱 제작자
  • 고객 서비스 애플리케이션 팀
  • 생산성 도구 빌더
  • 웹 및 모바일 앱 스타트업

고려 사항

  • 백엔드 AI 서비스 통합이 필요합니다
  • 특정 LLM에 맞게 사용자 정의가 필요할 수 있습니다
  • 성능은 네트워크 속도에 따라 달라집니다
  • 제한된 오프라인 기능
  • 외부 API 사용 가능 여부에 따라 다름

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

package:flutter_ai_toolkit pub package package publisher

Hello and welcome to the Flutter AI Toolkit!

The AI Toolkit is a set of AI chat-related widgets to make it easy to add an AI chat window to your Flutter app. The AI Toolkit is organized around an abstract LLM provider API that makes it easy to swap out the LLM provider that you'd like your chat provider to use. Out of the box, it comes with support for one LLM provider integration: Firebase AI.

Key features

  • Multi-turn chat: Maintains context across multiple interactions.
  • Streaming responses: Displays AI responses in real-time as they're generated.
  • Rich text display: Supports formatted text in chat messages.
  • Voice input: Allows users to input prompts using speech.
  • Multimedia attachments: Enables sending and receiving various media types.
  • Custom styling: Offers extensive customization to match your app's design.
  • Chat serialization/deserialization: Store and retrieve conversations between app sessions.
  • Pluggable LLM support: Implement a simple interface to plug in your own LLM.
  • Cross-platform support: Compatible with the Android, iOS, web, and macOS platforms.

Getting started

  1. Installation

    Add the following dependencies to your pubspec.yaml file:

    $ flutter pub add flutter_ai_toolkit firebase_ai firebase_core
    
  2. Configuration

    To use Firebase AI in your project, follow the steps described in Get started with the Gemini API using the Firebase AI Logic SDKs.

    After following these instructions, you're ready to use Firebase AI in your Flutter app. Start by initializing Firebase:

    import 'package:firebase_core/firebase_core.dart';
    import 'package:firebase_vertexai/firebase_ai.dart';
    import 'package:flutter_ai_toolkit/flutter_ai_toolkit.dart';
    
    // Other app imports...
    
    import 'firebase_options.dart'; // Generated by `flutterfire config`.
    
    void main() async {
      WidgetsFlutterBinding.ensureInitialized();
      await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
      runApp(const App());
    }
    
    // Implementation of App and other widgets...
    

    With Firebase properly initialized in your Flutter app, you're now ready to create an instance of the Firebase provider:

    class ChatPage extends StatelessWidget {
      const ChatPage({super.key});
    
      @override
      Widget build(BuildContext context) => Scaffold(
        appBar: AppBar(title: const Text(App.title)),
        body: LlmChatView(
          provider: FirebaseProvider(
            model: FirebaseAI.vertexAI().generativeModel(
              model: 'gemini-2.0-flash'
            ),
          ),
        ),
      );
    }
    

    The FirebaseAI class comes from the firebase_ai package. The AI Toolkit provides the FirebaseProvider class to expose Firebase AI to the LlmChatView. Note that you provide a model name that corresponds to one of the available model names.

    For a complete usage example, check out the vertex.dart sample.

  3. Set up device permissions

To enable your users to take advantage of features like voice input and media attachments, ensure that your app has the necessary permissions:

  • Network access:

To enable network access on macOS, add the following to your *.entitlements files:

<plist version="1.0">
    <dict>
      ...
      <key>com.apple.security.network.client</key>
      <true/>
    </dict>
</plist>

To enable network access on Android, ensure that your AndroidManifest.xml file contains the following:

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    ...
    <uses-permission android:name="android.permission.INTERNET"/>
</manifest>
  • Microphone access: To enable voice input for users, update configs according to the permission and setup instructions for package:record.

  • File selection: To enable users to select and attach files, follow the usage instructions for package:file_selector.

  • Image selection: To enable users to take or select a picture from their device, refer to the installation instructions for package:image_picker.

Samples

To run the example apps in the example/lib directory, first replace the example/lib/firebase_options.dart file by running flutterfire config (you may need to manually delete this file first). The provided firebase_options.dart file is a placeholder for configuration needed by the examples.

Breaking changes and migration

The v0.9.8 release contained breaking changes. If you have code that uses a version prior to that, please see the migration notes.

Feedback

As you use this package, please log issues and feature requests as well as submit any code you'd like to contribute. We want your feedback and contributions to ensure that the AI Toolkit is as robust and useful as it can be for your real-world apps.

카테고리

의존성

의존성 목록 13 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.