Open abbas-25 opened 4 years ago
same here. I found that whenever I type the query string with " ' " single quote that will trigger this error.
same here. I found that whenever I type the query string with " ' " single quote that will trigger this error.
You mean the query string should be in double quotes instead of single quotes? Like "hii" and not 'hi'?? Also my code uses double quotes but still it manages to find that error
same here. I found that whenever I type the query string with " ' " single quote that will trigger this error.
You mean the query string should be in double quotes instead of single quotes? Like "hii" and not 'hi'?? Also my code uses double quotes but still it manages to find that error
I mean that the query string includes single quote like [ I'm fine ] or [ thanks' ] that will trigger this error.
same here. I found that whenever I type the query string with " ' " single quote that will trigger this error.
You mean the query string should be in double quotes instead of single quotes? Like "hii" and not 'hi'?? Also my code uses double quotes but still it manages to find that error
I mean that the query string includes single quote like [ I'm fine ] or [ thanks' ] that will trigger this error.
Oh alright. I get it. However, my query string doesn't have any apostrophe or single quotes. Did you verify your OAuth screen? Just trying to know if it's needed.
same here. I found that whenever I type the query string with " ' " single quote that will trigger this error.
You mean the query string should be in double quotes instead of single quotes? Like "hii" and not 'hi'?? Also my code uses double quotes but still it manages to find that error
I mean that the query string includes single quote like [ I'm fine ] or [ thanks' ] that will trigger this error.
Oh alright. I get it. However, my query string doesn't have any apostrophe or single quotes. Did you verify your OAuth screen? Just trying to know if it's needed.
i have't verify my OAuth screen yet.
same here. I found that whenever I type the query string with " ' " single quote that will trigger this error.
You mean the query string should be in double quotes instead of single quotes? Like "hii" and not 'hi'?? Also my code uses double quotes but still it manages to find that error
I mean that the query string includes single quote like [ I'm fine ] or [ thanks' ] that will trigger this error.
Oh alright. I get it. However, my query string doesn't have any apostrophe or single quotes. Did you verify your OAuth screen? Just trying to know if it's needed.
i have't verify my OAuth screen yet.
I'll give it another try.
I have the same issue. Any solutions?
I have the same issue. Any solutions?
No. Can't even find anything on the internet.
You may get error response from dialogflow. Can you edit the library file
lib/v2/dialogflow_v2.dart (Line No: 134)
print the response. You will get what is the error (Notes: try flutter clean cache and reinstall it).
Any Solutions guys? I want to know what is the API used here so that I can manually get the response here. I tried in the Dialogflow docs but was unable to find anything on how to fetch the response using the API in v2.
Any Solutions guys? I want to know what is the API used here so that I can manually get the response here. I tried in the Dialogflow docs but was unable to find anything on how to fetch the response using the API in v2.
Dialogflow detectIntent API Doc
Check the following code, take it as an example. Here I added payload, inputAudio and outputAudioConfig in body Params. Also I added extra attribute(_audioOutput) in AIResponse class and get attribute value in a function.
class AIResponse {
// Attribute Initialization
...
String _audioOutput;
AIResponse({Map body}) {
...
_audioOutput=body['outputAudio'];
}
String getOutputAudio() {
return _audioOutput;
}
}
...
Future<AIResponse> detectIntent(Map data) async {
String queryInput = "";
String queryData = "";
String outputAudioConfig = "'outputAudioConfig':{'audioEncoding':'OUTPUT_AUDIO_ENCODING_LINEAR_16','synthesizeSpeechConfig':{'voice':{'ssmlGender':'SSML_VOICE_GENDER_FEMALE'}}}";
if(data["audioData"] != null){
queryData = "'audioConfig':{'languageCode':'en-US'}";
}else{
queryData = "'text':{'text':'${data["query"]}','language_code':'$language'}";
}
queryInput = "'queryInput':{$queryData}" + (data["audioData"] != null ? (",'inputAudio': ${data["audioData"]}" ): "");
String body = "{'queryParams':{'payload':{'userId':'${data["authUserId"]}'}},$queryInput,$outputAudioConfig}";
var response = await authGoogle.post(_getUrl(),
headers: {
HttpHeaders.authorizationHeader: "Bearer ${authGoogle.getToken}"
},
body: body
);
return AIResponse(body: json.decode(response.body));
}
...
Any Solutions guys? I want to know what is the API used here so that I can manually get the response here. I tried in the Dialogflow docs but was unable to find anything on how to fetch the response using the API in v2.
If you get error like ERROR: Tried calling: [ ] ( " queryText " ) this, You may get an error in the response. you can also see the error to print response.body in that code.
I'm having the same issue. Did you find any solution?
I'm having the same issue. Did you find any solution?
No
I found out I didn't saved Service account details in the https://console.cloud.google.com/iam-admin/serviceaccounts with the created JSON key.
Double-check if your account has the key saved.
Hey i solved it by using Dialogflow v1 just import v1 lib and use it like this
import 'package:flutter_dialogflow/flutter_dialogflow.dart';
Dialogflow dialogflow = Dialogflow(token: "Your Token");
AIResponse response = await dialogflow.sendQuery("Your Query");
print('thing ${response.getMessageResponse()}');
your token can be found here https://dialogflow.cloud.google.com/#/editAgent/{your project id}/
Hey i solved it by using Dialogflow v1 just import v1 lib and use it like this
import 'package:flutter_dialogflow/flutter_dialogflow.dart';
Dialogflow dialogflow = Dialogflow(token: "Your Token");
AIResponse response = await dialogflow.sendQuery("Your Query");
print('thing ${response.getMessageResponse()}');
your token can be found here https://dialogflow.cloud.google.com/#/editAgent/{your project id}/
At that link you get 'Project ID' and 'Service Account'. Where is the token? And if it has to do with the service account, which field is it?
The docs for this package are not exactly right in the current version of Dialogflow as far as I can tell.
He advises to create a NEW service account and key in the docs, but with the current release of Dialogflow, you actually have to use the EXISTING service account which you can find in the settings for your Agent. That's under the General tab. Click that gear in the top left of dialog flow to get to settings and just under the project id you should see the service account it is actually using. Note what it is called!
From there, you need to go into Service Accounts in the GCP and find that same service account email and click it, then add a key, choose JSON, and download and link as described. This worked for me....
The docs for this package are not exactly right in the current version of Dialogflow as far as I can tell.
He advises to create a NEW service account and key in the docs, but with the current release of Dialogflow, you actually have to use the EXISTING service account which you can find in the settings for your Agent. That's under the General tab. Click that gear in the top left of dialog flow to get to settings and just under the project id you should see the service account it is actually using. Note what it is called!
From there, you need to go into Service Accounts in the GCP and find that same service account email and click it, then add a key, choose JSON, and download and link as described. This worked for me....
Yarhem waldin waldik <3
The docs for this package are not exactly right in the current version of Dialogflow as far as I can tell.
He advises to create a NEW service account and key in the docs, but with the current release of Dialogflow, you actually have to use the EXISTING service account which you can find in the settings for your Agent. That's under the General tab. Click that gear in the top left of dialog flow to get to settings and just under the project id you should see the service account it is actually using. Note what it is called!
From there, you need to go into Service Accounts in the GCP and find that same service account email and click it, then add a key, choose JSON, and download and link as described. This worked for me....
Thank you man you're a life saver
Guys help i follow all instruction but i have complain ...
E/flutter ( 1598): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: NoSuchMethodError: The method '[]' was called on null.
E/flutter ( 1598): Receiver: null
E/flutter ( 1598): Tried calling:
E/flutter ( 1598): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
E/flutter ( 1598): #1 new QueryResult (package:flutter_dialogflow/v2/dialogflow_v2.dart:26:21)
E/flutter ( 1598): #2 new AIResponse (package:flutter_dialogflow/v2/dialogflow_v2.dart:64:24)
E/flutter ( 1598): #3 Dialogflow.detectIntent (package:flutter_dialogflow/v2/dialogflow_v2.dart:124:12)
E/flutter ( 1598):
Had the same issue. For my error happened I downloaded another project service key file. downloaded correct file and issue fixed. make sure to enable dialog flow API and download the correct Service Account JSON file
Nothing still problem i create new key with admin dialogflow
but still have problem... help! i created key in json from dialog flow api enabled
The docs for this package are not exactly right in the current version of Dialogflow as far as I can tell.
He advises to create a NEW service account and key in the docs, but with the current release of Dialogflow, you actually have to use the EXISTING service account which you can find in the settings for your Agent. That's under the General tab. Click that gear in the top left of dialog flow to get to settings and just under the project id you should see the service account it is actually using. Note what it is called!
From there, you need to go into Service Accounts in the GCP and find that same service account email and click it, then add a key, choose JSON, and download and link as described. This worked for me.
You're a life saver man. Spent around 4-5 hours on this issue. But finally resolved it. For me though, creating a new project with just 1 service account worked. Earlier I was trying to create a service account for an older project.
ERROR LOG -
I've taken all the necessary steps in my view. Is there anything missing out? in the code or in the process of GCP Json file downloading. I've not verified the OAuth screen though. And my GCP account is NOT payment verified.