I want to raise a Dialogflow event from the flutter app using dialog flowtter. There is an exception. 400 field input not set. what can I do?
DetectIntentResponse response = await dialogFlowtter.detectIntent(
queryInput: QueryInput(
eventInput:
EventInput(name:"username",languageCode: "en", parameters:{username: user!.uid})),
audioConfig: OutputAudioConfig(),
);
Unhandled Exception: Exception: INVALID_ARGUMENT: Field input not set., (400)
I found out it was a bug from the dialog flowtter library. it is now changed in version 0.3.2
Related
I´m new in this site and in flutter, I´m trying to get connected to an API,and I have been running into issues with white spaces I´m using uri.https, and im currently using single and double quotes because that's the only way I found I can avoid the "+" from show in the white space ok the TOKEN. whithout that I receive this error.
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: FormatException: Unexpected character (at character 1)
Having say it that this is my code:
String _token='"Token 25e94e9fc7d38d6a10bb9328fb07546881602467"';
final Map<String, String> header={
'Authorization':_token
};
final response = await http.post(url,headers:header,body: json.encode(androidid));
final Map<String, dynamic> decodedResp = json.decode(response.body.toString());
print(decodedResp);
print(response.statusCode);
print(header);
and after that I get this:
I/flutter (24825): {detail: Authentification credentials were not provided.}
I/flutter (24825): 401
I/flutter (24825): {Authorization: "Token 25e94e9fc7d38d6a10bb9328fb07546881602467"}
it supose that the API is waiting for something as {Authorization: Token 25e9............
I have been trying to the request in that way, ´cause I´m working on a team and it´s like they´re waiting that I process the data, I´m not even sure if it´s possible do it in that way(using the word and the number)
I don't think that "Token" should be inside a token
Our project passed “Turn on” execution and query in the test
suite of the google action.
But “Turn off” execution and query failed and I couldn’t find in our part.
After “Turn off” execution, I responded “false” for “on” attribute but
error report was shown - actual state: {"on":true,"online":true}.
Below is the exchanged data and the error report.
Google action request for execution:
{"inputs":[{"context":{"locale_country":"US","locale_language":"en"},"intent":"action.devices.EXECUTE","payload":{"commands":[{"devices":[{"id":"eg_cam_87901"}],"execution":[{"command":"action.devices.commands.OnOff","params":{"on":false}}]}]}}],"requestId":"960820806239759768"}
Our Response for execution:
{"requestId":"960820806239759768","payload":{"commands":[{"ids":["eg_cam_87901"],"status":"SUCCESS","state":{"online":false,"on":false,"currentToggleSettings":null}}]}}
Google action error report
Turn off the bedroom
AssertionError: Expected state to include: {"on":false}, actual state: {"on":true,"online":true}: expected false to be true
Google action request for query:
{"inputs":[{"intent":"action.devices.QUERY","payload":{"devices":[{"id":"eg_cam_87901"}]}}],"requestId":"4409204964431192716"}
Our Response for query:
{"requestId":"4409204964431192716","payload":{"devices":{"eg_cam_87901":{"online":false,"status":"SUCCESS","on":false,"currentToggleSettings":null}}}}
Google action error report
Query after 'Turn off the bedroom'
Error: the string "Error from HA: deviceOffline" was thrown, throw an Error :) at new f (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18143:10) at Runner.fail (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:4491:11) at js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:4802:18 at done (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:4189:5) at js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:4236:11 at w.Ic (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18137:24) at r.run (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18129:169) at js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18171:310 at w.Jl (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18137:454) at r.Ms (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18130:301) at h (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18126:375) at y.Jl [as Ic] (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18139:326) at q (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18167:89) at e (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18158:235) at XMLHttpRequest.w (js/app_compiled.js?f77b3b67-f1c5-4a38-8a20-fe5eafbc2c40:18167:241)
You've got a couple issues here.
First, you need to verify that your sync response includes the appropriate device attributes - your execution/query responses both return NULL for your currentToggleSettings instead of the string of the availableToggles in your sync response. If you are just using OnOff for your device, you don't actually even need to implement any of the Toggle trait features. Again, verify what is in your initial sync response.
Second, you're returning online: false as well as on:false, which is why you're getting the following error:
Error: the string "Error from HA: deviceOffline" was thrown
online:false should only be used when you intend to return the TTS response of "the device is not available right now" when a user issues a command/query, and when the device cannot be controlled. This should also include status:ERRROR in your response. You can read more about handling errors and exceptions in the docs.
Returning online:true, on:false or online:true, on:true when responding to an execute/query request should fix the deviceOffline error.
I am sending a request which is erroring with dio library
When catching the error, I can print(e.response); and print(e.response.statusCode);
The runtimeType of the response is Response<dynamic>
And when printing the response I get something like this
{"message":"there is message from the api here"}
I cannot access this message to print it.
I tried
e.response.message and get errors.dart:167 Uncaught (in promise) Error: NoSuchMethodError: 'message'
e.response["message"] and get Uncaught (in promise) Error: NoSuchMethodError: '[]'
I tried json.encoding the e.response, and it doesn't work either, how can I access the data inside the type Response<dynamic>
Thank you
Use e.response.data['...'] instead in order to access the data you want,
I'm running one of the examples in my own project and running into the error.
Action Error: Missing result from request body
Github Sample Project: dialogflow-silly-name-maker-webhook-nodejs
Hookbin: Shows the webhook coming from the assistant.https://hookbin.com/bin/ZjPzJ1Yb
Might there be an error in the sample code or in my set-up?
I was getting this error. In my case it was because the request object I was passing to ActionsSdkApp() constructor had a body property which was a JSON string as opposed to data structure.
Adding this in before instantiating ActionsSdkApp fixed it for me...
request.body = JSON.parse(request.body);
Then I could carry on like this...
App = new ActionsSdkApp({'request': request, 'response': response});
That error message is printed by the Action on Google client library if the incoming request doesn't have the intent information, but your JSON looks good.
Make sure your action enables debug logging for the client library: process.env.DEBUG = 'actions-on-google:*';
Then study the complete log to understand your issue.
So I upgraded my IDE and SDK and now the following code doesn't work anymore. I am adding some text here to try to get around this sites fascist validation on posts it's pretty aggressive.
String URL = "http://www.google.com";
Future future = client.getUrl(Uri.parse(URL))
.then((HttpClientRequest request) {
return request.close();
}).then((HttpClientResponse response) {
print('Status code: ${response.statusCode}');
print('Headers\n${response.headers}');
});
});
I am getting the following exception now.
Uncaught Error: Bad state: No elements
Stack Trace:
Any ideas?
Works for me using Dart 0.6.3.3_r24898 on Windows.
Are you sure this is all the code you have? In the stack trace I see WebSocketImpl, are you using WebSockets?