我将相同的源代码部署到了AWS EC2 Linux实例,但是它无法显示来自dialogflow的响应文本。 我在Dialogflow控制台中检查了对话历史记录,它正确显示了请求和响应。但是,在调用函数“ detectIntent”之后,dialogflow client(PHP)似乎崩溃了。 不幸的是,无法找到任何日志。
重新安装的Dialogflow客户端库
$formattedSession = $sessionsClient->sessionName($agent,$agentSession->session_id);
// Set Text Input
$textInput = new TextInput();
$textInput->setText($text);
$textInput->setLanguagecode($lang);
// Set Parameters
$optionalArgs = array();
$queryInput = new QueryInput();
$queryInput->setText($textInput);
$response = $sessionsClient->detectIntent($formattedSession,$queryInput,$optionalArgs);
$action = $response->getQueryResult()->getaction(); //The action name from the matched intent.