[LUIS] Errorcode 414 (Request URL is too long)
Our Bot throws the following Error while sending an Message with length bigger than 500 characters.
Sorry, my bot code is having an issue
The code is in the LuiseService.cs file:
async Task<LuisResult> ILuisService.QueryAsync(Uri uri, CancellationToken token)
{
string json;
using (var client = new HttpClient())
using (var response = await client.GetAsync(uri, HttpCompletionOption.ResponseContentRead, token))
{
response.EnsureSuccessStatusCode();
json = await response.Content.ReadAsStringAsync();
}
}
The bot message is transfered by an url parameter, which is the reason for the error.......
Is there a way to transfer the message not as an url parameter or change the error text to signal the user that the message is too long?
You could catch the exception from LUIS and translate it to a message for the user - for example, you might override the MessageReceived method of LuisDialog, and if it throws that exception, swallow it and post a message back to the user.
We are using the structure of the Alarmbot Sample. Few weeks ago the alarm bot uses the LuisDialog but now the Sample uses the DispatchDialog class, but there is no MessageReceived Method to override...
But this doesn't solve the problem, that the messages are restricted to about 500 characters...
Moreover i think this error should be handled by the framework or must be communicated to the framework users (developer).
Bump. I'm getting the same issue with the node.js sdk.
In this case the string body passed to JSON.parse() is an empty string due to the issue mentioned above.
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at Request._callback (/Users/tarikourchane/Development/JSDev/gameon-bot/node_modules/botbuilder/lib/dialogs/LuisRecognizer.js:80:39)
at Request.init.self.callback (/Users/tarikourchane/Development/JSDev/gameon-bot/node_modules/request/request.js:188:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:194:7)
at Request.<anonymous> (/Users/tarikourchane/Development/JSDev/gameon-bot/node_modules/request/request.js:1171:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:191:7)
at IncomingMessage.<anonymous> (/Users/tarikourchane/Development/JSDev/gameon-bot/node_modules/request/request.js:1091:12)
at Object.onceWrapper (events.js:293:19)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:188:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)
@xitij This issue is specific to the .NET SDK, please open a new issue so the Node SDK team can track it. Thx
@kevinport Are you still experiencing the issue after upgrading to BotBuilder 3.8.1?