Flutter对话流不接受查询中的空间。给dialogflow客户端的查询不接受空间。例如,允许“ Hi”,但不允许“ Hi”,因为它有空间。同样,它只接受一个单词,而不接受句子(因为它带有带空格的单词)。需要帮助。
import 'package:flutter_dialogflow/flutter_dialogflow.dart';
void Response(query) async {
_textController.clear();
print("BLB calling $query= ${query.toString().trim()}");
Dialogflow dialogflow =Dialogflow(token: "**api_key**");
AIResponse response = await dialogflow.sendQuery(query).catchError((error){print("BLB $error ");});
print("BLB called ${response.getStatus.getCode}");
ChatMessage message = new ChatMessage(
text: response.getMessageResponse(),
name: "Eva the Bot",
type: false,
);
//Tts.speak(response.getMessageResponse());
setState(() {
_messages.insert(0, message);
});
}
错误消息:FormatException: Context name should contain only Latin letters (a-z A-Z), digits (0-9), underscore (_), and hyphen (-). Code: 400
对话框流在控制台中运行完美(右侧的“立即尝试”)。:(