Coder Social home page Coder Social logo

deimos-applications / dialog_flowtter Goto Github PK

View Code? Open in Web Editor NEW
42.0 42.0 24.0 796 KB

A Flutter implementation of Google's Dialog Flow improved

License: MIT License

Dart 97.97% Kotlin 0.15% Swift 0.49% Objective-C 0.05% HTML 1.34%
chatbot chatbots conversation dart dialogflow flutter flutter-library intent json open-source starware

dialog_flowtter's People

Contributors

elzombieisra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dialog_flowtter's Issues

Undefined DialogFlowtter

I have added dialog_flowtter version 0.3.3, however, when I call the DialogFlowtter class, there is a problem said that DialogFlowtter is undefined. How can I solve this problem?

[BUG] HandshakeException (HandshakeException: Connection terminated during handshake)

Describe the bug
The app works fine for 1-2 minutes, but after running either my implementation or the one downloaded from the latest Github branch, it crashes...

Contry: Romania.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image
image
image

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • Pixel 2
  • OS: [e.g. iOS8.1]
  • Version [e.g. 22]

Package version

  • Version [e.g. 0.1.0]
    0.3.0-nullsafety.0
    And the latest version of the Github Branch....
    Stack Trace
    E/flutter (23676): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: HandshakeException: Connection terminated during handshake

Flutter Doctor Info
Add the flutter doctor command output

Additional context
Add any other context about the problem here.

Pass context to Dialogflow with Query Input

I there a way to pass a context to Dialogflow using the QueryInput?
There is a EventInput field to pass an event in. But is it also possible to predefine the conversation context from the flutter app when sending a query?

And if not, how would it be possible to continue a Dialogflow conversation after a certain period of time (The session of a conversation only lasts for about 20 minutes)?

I am thankful for any answer.

[FEATURE] Browse Carousel Card

Is your feature request related to a problem? Please describe.
I would like to enable users to tap the card when dialog flow response Google assistance browse carousel card so they can open a browser.

Describe the solution you'd like
A clear and concise description of what you want to happen.
Displaying multiple options through the browse carousel so user can tap and redirect to an external browser.
This is a good feature so we can provide rich media messages to users.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
I'm also thinking of create a custom model for the Google Assistance response

Additional context
Add any other context or screenshots about the feature request here.
Screenshot 2022-12-28 at 1 22 10 PM
Screenshot 2022-12-28 at 1 21 56 PM

[BUG] Unhandled Exception: type 'Null' is not a subtype of type 'num' in type cast

Describe the bug
When sending any message to Dialogflow that contains any special characters. The lib shows the following error in the DetectIntentResponse class.

To Reproduce
Just send send a sentence that contains an invalid character, example: 04/30/2023

Expected behavior
I expected it to return the next phrases registered in DialogFlow.

Screenshots
image

Smartphone (please complete the following information):

  • Device: Poco M3 Pro 5G
  • OS: Android
  • Version: 11

Package version

  • Version: ^0.3.3

Stack Trace
E/flutter ( 4066): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'Null' is not a subtype of type 'num' in type cast
E/flutter ( 4066): #0 _$SentimentFromJson (package:dialog_flowtter/src/models/detect_intent_response/sentiment.g.dart:10:29)
E/flutter ( 4066): #1 new Sentiment.fromJson (package:dialog_flowtter/src/models/detect_intent_response/sentiment.dart:30:7)
E/flutter ( 4066): #2 _$SentimentAnalysisResultFromJson (package:dialog_flowtter/src/models/detect_intent_response/sentiment_analysis_result.g.dart:14:23)
E/flutter ( 4066): #3 new SentimentAnalysisResult.fromJson (package:dialog_flowtter/src/models/detect_intent_response/sentiment_analysis_result.dart:40:7)
E/flutter ( 4066): #4 _$QueryResultFromJson (package:dialog_flowtter/src/models/detect_intent_response/query_result.g.dart:34:37)
E/flutter ( 4066): #5 new QueryResult.fromJson (package:dialog_flowtter/src/models/detect_intent_response/query_result.dart:156:7)
E/flutter ( 4066): #6 _$DetectIntentResponseFromJson (package:dialog_flowtter/src/models/detect_intent_response/detect_intent_response.g.dart:15:25)
E/flutter ( 4066): #7 new DetectIntentResponse.fromJson (package:dialog_flowtter/src/models/detect_intent_response/detect_intent_response.dart:82:7)
E/flutter ( 4066): #8 DialogFlowtter.detectIntent (package:dialog_flowtter/src/dialog.dart:215:33)

Flutter Doctor Info
Add the flutter doctor command output

Additional context
Add any other context about the problem here.

Dialogflow detects wrong intent with queries containing an apostrophe sent from Flutter app

Hello!

I coded a Flutter app which uses a Dialogflow API to send requests to my Dialogflow agent. Now I have the problem that queries sent from the Flutter app that have an apostrophe in it (e.g. I'm jogging) get a wrong intent match.
I already tried importing several Dialogflow APIs such as

https://pub.dev/packages/flutter_dialogflow_v2
https://pub.dev/packages/flutter_dialogflow

Both of them give the same result. So first of all, here is a screenshot of the intent I want my Flutter app to match when I type this: I'm jogging

Bildschirmfoto 2021-02-02 um 09 11 10

On the right hand side you can see that matching this query works fine inside the Dialogflow Console.
And here is the raw api response when I click on diagnostic info below the "Try it now"-field inside the Dialogflow Console:

{ "responseId": "06e5b7c1-0b27-4f7d-bca9-23aa25575592-59c3eb0f", "queryResult": { "queryText": "I'm jogging", "parameters": { "pronounsIndefinite": [], "articles": [], "verbsgerund": [ "jogging" ], "nouns": [], "verbsPastParticiple": [], "verbshelppresent": [ "am" ], "adverbsTime": [], "pronounsdefinite": [ "I" ], "prepositions": [] }, "allRequiredParamsPresent": true, "fulfillmentText": "You are jogging, cool! ", "fulfillmentMessages": [ { "text": { "text": [ "You are jogging, cool! " ] } } ], "outputContexts": [ { "name": "projects/reddy-1/locations/global/agent/sessions/7e6ef20b-4de3-5758-ceca-a1996acf87f8/contexts/__system_counters__", "lifespanCount": 1, "parameters": { "prepositions": [], "prepositions.original": [], "no-match": 0, "verbsgerund": [ "jogging" ], "verbshelppresent": [ "am" ], "nouns": [], "verbshelppresent.original": [ "'m" ], "verbsPastParticiple.original": [], "pronounsIndefinite.original": [], "no-input": 0, "pronounsIndefinite": [], "nouns.original": [], "adverbsTime.original": [], "articles": [], "articles.original": [], "adverbsTime": [], "pronounsdefinite": [ "I" ], "verbsPastParticiple": [], "pronounsdefinite.original": [ "I" ], "verbsgerund.original": [ "jogging" ] } }, { "name": "projects/reddy-1/locations/global/agent/sessions/7e6ef20b-4de3-5758-ceca-a1996acf87f8/contexts/start", "lifespanCount": 9999, "parameters": { "articles": [], "sessionID_original": "3wd93kj4-2jeo-0d82-2hd8ej9f7jp1", "adverbsTime": [], "nouns": [], "articles.original": [], "verbshelppresent.original": [ "'m" ], "nouns.original": [], "verbsgerund": [ "jogging" ], "pronounsdefinite.original": [ "I" ], "prepositions.original": [], "pronounsIndefinite": [], "verbsgerund.original": [ "jogging" ], "verbsPastParticiple": [], "verbshelppresent": [ "am" ], "pronounsIndefinite.original": [], "verbsPastParticiple.original": [], "adverbsTime.original": [], "pronounsdefinite": [ "I" ], "prepositions": [] } } ], "intent": { "name": "projects/reddy-1/locations/global/agent/intents/176fc623-739e-4463-8df7-b970749630b2", "displayName": "gHealthFitnessAC" }, "intentDetectionConfidence": 1, "diagnosticInfo": { "webhook_latency_ms": 4153 }, "languageCode": "en" }, "webhookStatus": { "message": "Webhook execution successful" }, "agentId": "0bafa24f-02d0-46a3-ad37-b6011d756104" }

Now here is a screenshot of the intent that get's a wrong match when I send the query (I'm jogging) from the Flutter app that uses a Dialogflow API:

Bildschirmfoto 2021-02-02 um 09 14 59

And here is the raw api response when I click on history and then the last conversation from the Flutter app with Dialogflow:

{ "id": "c0d19ce2-a638-4243-8612-56d00250bc13-59c3eb0f", "fulfillmentText": "gLeisureShoppingAC", "language_code": "en", "queryText": "I‘m jogging", "webhookPayload": {}, "intentDetectionConfidence": 1, "action": "", "webhookSource": "", "parameters": { "pronounsdefinite": [ "I" ], "articles": [], "prepositions": [], "verbsGerund": [ "jogging" ], "nouns": [], "verbsHelpPresent": [ "am" ], "adverbsTime": [] }, "fulfillmentMessages": [ { "text": { "text": [ "gLeisureShoppingAC" ] } } ], "webhookStatus": { "webhookUsed": false }, "outputContexts": [ { "lifespanCount": 1, "name": "__system_counters__", "parameters": { "adverbsTime.original": [], "no-input": 0, "pronounsdefinite.original": [ "I" ], "no-match": 0, "adverbsTime": [], "articles.original": [], "verbsGerund": [ "jogging" ], "prepositions.original": [], "pronounsdefinite": [ "I" ], "verbsGerund.original": [ "jogging" ], "verbsHelpPresent.original": [ "‘m" ], "nouns.original": [], "nouns": [], "verbsHelpPresent": [ "am" ], "articles": [], "prepositions": [] } }, { "lifespanCount": 9999, "name": "start", "parameters": { "nouns.original": [], "pronounsdefinite.original": [ "I" ], "sessionID_original": "3wd93kj4-2jeo-0d82-2hd8ej9f7jp1", "adverbsTime.original": [], "verbsGerund.original": [ "jogging" ], "articles": [], "verbsHelpPresent": [ "am" ], "prepositions": [], "adverbsTime": [], "pronounsdefinite": [ "I" ], "articles.original": [], "verbsHelpPresent.original": [ "‘m" ], "verbsGerund": [ "jogging" ], "prepositions.original": [], "nouns": [] } } ], "intent": { "isFallback": false, "displayName": "gLeisureShoppingAC", "id": "76efc477-006c-4ccd-a0c9-6e254ec72976" } }

All my intents have a start context. I am sure this does not influence the intent matching as all of my intents have the start context and I also removed all context and got the same result.

What I just noticed writing this Issue here:
When you look at both raw api responses, right at the beginning, there is the query text:

  1. [...] "queryText": "I'm jogging"
  2. [...] "queryText": "I‘m jogging",

I copied them directly and I noticed that the apostrophes look different (The second one is from the Flutter app and I typed in exactly the same query but there still is this difference). I don't know if this is a reason for the intent-mismatch.

Unfortunately I am not an expert, so I haven't tried making an http request through curl, Postman or Insomnia yet, as I am not sure how to do it. I solved all problems I had with my Flutter app and Dialogflow but this one got me stuck for a really long time now. I got it to this point where I know it has to do with the apostrophe in the query text that matches to the wrong intent.

Maybe it is because of the API I am using in my Flutter app that changes the apostrophe somehow.

I also found this related issue where other users seem to have a similar problem with apostrophes in their queries:
VictorRancesCode/flutter_dialogflow#21

Thank you for reading this issue and I hope we can find a solution together.

Greetings
Finn

Handshake exception : Handshake error in client(OS error: CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate client

I was working on the demo example. My app works fine in android 9 but not in 11 and shows

Handshake exception : Handshake error in client(OS error: CERTIFICATE_VERIFY_FAILED : unable to get local issuer certificate)

https://stackoverflow.com/questions/66958295/flutter-chatbot-handshakeexception-when-accessing-dialogflowapi

The same problem but mine is your demo example.

How to solve this?

Please help

[BUG ?] detectIntent throws Exception

Describe the bug
Using the code provided in the Example, whenever I try to use

    DetectIntentResponse response = await dialogFlowInstance.detectIntent(
      queryInput: queryInput,
    );

I get this;

Exception has occurred.
ArgumentError (Invalid argument(s): Invalid internet address accounts.google.com)

Forcing the execution to continue throws the same Exception again, then it seems to go through as I get a real response.

flutter: DetectIntentResponse(a3b83791-23b1-411a-9156-c31726a8b27c-48f56f2f, QueryResult(how are you?, en, null, smalltalk.greetings.how_are_you, {}, true, [Message(DialogPlatform.PLATFORM_UNSPECIFIED, DialogText([I'm doing very well. Thanks!]), null, null, null, null, null, null, null, null, null, null, null, null, null)], null, Intent(null, null, null, null, null, null, null, null, null, null, null, null, null, null), 1.0, null, null), null, null)

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.5.1, on macOS 11.5.2 20G95
darwin-arm, locale en-FR)
[!] Android toolchain - develop for Android devices (Android
SDK version 30.0.3)
✗ cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for
more details.
✗ Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK
licenses.
See
https://flutter.dev/docs/get-started/install/macos#androi
d-setup for more details.
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.60.2)
[✓] Connected device (4 available)

I am not targeting Android for now.

Any idea what's going on here?

Creating a message type to access in the library

I see you have your message types, and can also see you have the card showing in the example. But when using Dialogflow to create responses, what does the library Message components expect to see to set its Message type? For instance, using the Default response, you are given two options, Text and Payload. Action on Google has many more options, but the library doesn't seem to work well with it, not being able to read its response type.

What Dialogflow response's should we use to allow for the library to extract the message type. Do you have an example?

Google assistance suggestion chip

Can you help me to integrate google asistance suggestion chip also how to get the welcome intent. I have a default welcome intent which has some google assistance suggestion chip it's not working when I type manually it gives result.

How can I work with custom payload?

I have the following default custom payload in dialogflow:

{
  "some_response": {
        "something": "something",
        "array": [
          "This is text line 1.",
          "This is text line 2."
        ]
	}
}

but in my detectIntent I cant get the payload:

     DetectIntentResponse response = await dialogFlowtter.detectIntent(
          queryInput: QueryInput(text: TextInput(text: text)));

Text is working perfectly but how can I work with payload?

Send KnowledgeBase path with queryInput function

Is it possible somehow to send KnowledgeBase name/path through queryInput function? or is there any other way to get knowledgebase working. It is working fine in DialogFlow console. So will be helpful if any

Webhook payload

Hi! I am trying to receive the payload from the flask webhook. It gets stored in the webhook payload. But the library API response doesn't show that!

"webhookSource": "webhook",
    "webhookPayload": {
      "suggestions": [
        "chennai",
        "mumbai",
        "kolkata"
      ]

[FEATURE] Update http package dependency to version ^0.13.1

It is difficult to manage conflicting dependencies between dialog_flowtter and other packages (namely firebase_auth) as they both utilize different http versions.

Updating the http package dependency version to ^0.13.1 would bring this package up to date with other contemporary packages and would resolve many conflicts.

I've attempted to solve these conflicting dependencies by simply downgrading my http version to no avail, so this seems like a simple enough solution that would facilitate access to all future users.

Event input

When i try to raise event input from dialog_flowtter, it shows field input not set. Please help me.

DetectIntentResponse response = await dialogFlowtter.detectIntent(
      queryInput: QueryInput(
        eventInput: EventInput.fromJson(event),
      ),
      audioConfig: OutputAudioConfig(),
    );
E/flutter (17956): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Exception: INVALID_ARGUMENT: Field input not set., (400)
E/flutter (17956): #0      DialogFlowtter.detectIntent
package:dialog_flowtter/src/dialog.dart:209
E/flutter (17956): <asynchronous suspension>
E/flutter (17956): #1      _HomeScreenState.setDialog
package:email_password_login/screens/home_screen.dart:282
E/flutter (17956): <asynchronous suspension>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.