DialogFlowtter는 DialogFlow과의 통합을 간소화하는 Flutter 패키지로, 개발자가 애플리케이션 내에서 챗봇 기능을 빠르게 구축하고 배포할 수 있도록 도와줍니다. 원래 DialogFlow 구현을 신뢰성 향상, 설정 용이성, 여러 플랫폼에서의 더 나은 Flutter 호환성으로 개선합니다. Android, iOS, macOS, Windows 및 Linux를 지원하며 자연어 처리를 사용하여 실시간 대화 처리를 원활하게 가능하게 합니다. 지능적인 사용자 상호작용이 필요한 앱에 적합하며, DialogFlow 에이전트에 연결하고 응답을 관리하는 과정을 간소화합니다.
사용 사례
인공지능 기반 고객 지원 챗봇 구축
음성 및 텍스트 기반 보조 장치 통합
인터랙티브 앱 가이드 및 튜토리얼 만들기
다국어 사용자 상호작용 활성화
모바일 및 데스크톱용 대화형 UI 개발
주요 기능
크로스 플랫폼 지원 (Android, iOS, macOS, Windows, Linux)
DialogFlow 에이전트와의 간편한 통합
실시간 메시지 처리
기존 DialogFlow에 비해 안정성 향상
내장된 응답 구문 분석 및 오류 처리
텍스트 및 오디오 입력 지원
적합한 대상
채팅봇을 구축하는 Flutter 개발자
기존 앱에 NLP를 통합하는 팀
다국어 채팅 기능이 필요한 프로젝트
스타트업이 대화형 인터페이스 프로토타입 개발 중
AI 어시스턴트를 빠르게 배포해야 하는 앱
고려 사항
의도 및 엔티티로 구성된 DialogFlow 에이전트가 필요합니다
클라우드 기반의 자연어 처리를 위해 인터넷 연결이 필요합니다
사용자 지정 인증을 위해 추가 설정이 필요할 수 있습니다
제한된 오프라인 기능
DialogFlow의 API 사용 가능성 및 할당량에 따라 다릅니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
A Flutter implementation of DialogFlow, improved.
Build your integrations with DialogFlow easier and faster.
About the package
Dialog Flow on Flutter, now with Null Safety support!
DialogFlowtter is a package that helps you to build integrations with DialogFlow easier and faster.
Authenticate with Google Auth Json
Get an authenticated http client so you can talk with your DialogFlow agent
Get access to all DialogFlow responses and models easily
Inspect what values a DialogFlow response could have
Why DialogFlowtter
The problem with the current DialogFlow integration packages that are available in Pub is that they're:
Completely abandoned
Not well documented
Lack functionality
Lack flexibility
This one is intended to solve those problems and add more features that I've seen the users want. Check the TO-DO section for more info on that.
Platform support
This package is fully supported in Android, iOS and Web.
We have plans on testing and adding support for Windows, Linux and MacOS as this platforms mature in the Flutter SDK.
Installation
Add the package to your flutter dependencies in you pubspec.yaml:
dependencies:dialog_flowtter:^0.3.1
Make sure you add your dialog_flow_auth.json to the pubspec.yaml assets:
One of the core features of DialogFlow is to detect what a person is trying to say. You can do that by detecting an intent that you have defined in your DialogFlow console
Create an instance of DialogFlowtter and set the sessionId that will be used to identify the current conversation of the user with DialogFlow.
It's highly recommended that you use a different sessionId for every conversation that the user establishes with the Assistant
You can check the code for more info on what info you can send and receive
Get the info from the intent
You can access the info returned by DialogFlow from the DetectIntentResponse that the detectIntent function returns.
Get the text from the response
DetectIntentResponse response = await dialogFlowtter.detectIntent(
queryInput: QueryInput(text: TextInput(text: "Hi")),
);
String? textResponse = response.text;
print(textResponse); // Hi, how may I help you?
response.text returns null if there's no text returned by DialogFlow or if the first message returned it's not of type MessageType.text
Get the message from the response
See Message for more info on what the model properties can be
Also, check this issue to see how to create and use Rich Responses like cards and carousels
Set the audio configuration in the detectIntent function
DetectIntentResponse response = await dialogFlowtter.detectIntent(
queryInput: QueryInput(text: TextInput(text: "Hi")),
// You can set your own configuration with the OutputAudioConfig class
audioConfig: OutputAudioConfig(),
);
Every time you instanciate DialogFlowtter, the class creates an authenticated http client, with the credentials obtained from the DialogFlow Auth JSON. Be sure to save this instance and reuse it to avoid memory leaks
Memory leaks
Make sure to dispose your DialogFlowtter instance whenever you're done using it. This makes sure to close the authenticated http client and all its StreamSubscriptions to avoid memory leaks.
Too many models
We have coded almost every Dialog Flow model that you may need to use when implementing this package so you don't have to work with annoying Map<String, dynamic> objects. Feel free to ask for any model that is missing to be added to the package.
The models that were not coded are included as annoying Map<String, dynamic> and are tagged with the //? Create model if necessary.
TO-DO
[x] Add support for null safety
[x] Add support for cards, images, etc.
[x] Memory, file and remote auth JSON
[ ] Secure DialogFlow auth JSON
[ ] Support audio queries
[ ] Add a catalog of supported languages
[ ] Add direct access to common used attributes
[ ] Support use of custom HTTP Client
Starware
DialogFlowtter is Starware.
This means you're free to use the project, as long as you star its GitHub repository.
Your appreciation makes us grow and glow up. ⭐