Orientação gerada a partir de informações públicas. Apenas para referência.
DialogFlowtter é um pacote Flutter que simplifica a integração com o DialogFlow, permitindo que desenvolvedores criem e implantem rapidamente recursos de chatbot em seus aplicativos. Ele melhora a implementação original do DialogFlow com maior confiabilidade, configuração mais fácil e melhor compatibilidade com o Flutter em múltiplas plataformas. Com suporte para Android, iOS, macOS, Windows e Linux, permite o tratamento de conversas em tempo real usando processamento de linguagem natural. Ideal para aplicativos que exigem interações inteligentes com o usuário, ele simplifica o processo de conexão com agentes do DialogFlow e gerenciamento de respostas.
Casos de uso
Construindo chatbots de suporte ao cliente com IA
Integrando assistentes de voz e baseados em texto
Criando guias e tutoriais interativos para aplicativos
Habilitar interações multilíngues com usuários
Desenvolvendo interfaces de usuário conversacionais para dispositivos móveis e desktop
Estabilidade aprimorada em relação ao DialogFlow nativo
Análise de resposta e tratamento de erros embutidos
Suporte para entrada de texto e áudio
Indicado para
Desenvolvedores Flutter construindo chatbots
Equipes integrando NLP em aplicativos existentes
Projetos que exigem capacidades de bate-papo multilíngue
Startups prototipando interfaces conversacionais
Aplicativos que precisam de implantação rápida de assistentes de IA
Considerações
Requer um agente do DialogFlow configurado com intenções e entidades
Necessita de conexão com a internet para processamento de NLP baseado em nuvem
Pode exigir configuração adicional para autenticação personalizada
Funcionalidade offline limitada
Dependente da disponibilidade e quotas da API do DialogFlow
README original
Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.
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. ⭐