apo*_*ski 4 node.js dialogflow-es
如何使用Dialogflow nodejs SDK(nodejs-dialogflow)调用detectIntent但具有指定的环境(测试版功能)?
您必须使用dialogflow.v2beta1.SessionsClient&.environmentSessionPath而不是.sessionPath生成发送的会话detectIntent
const client = new dialogflow.v2beta1.SessionsClient({});
const sessionPath = client.environmentSessionPath(project, environment, user, session);
// The text query request.
const request = {
session: sessionPath,
queryInput: {
text: {
text: 'hello'
}
}
};
Run Code Online (Sandbox Code Playgroud)
这是会话环境路径的模板:
projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}
Run Code Online (Sandbox Code Playgroud)
您可以在https://github.com/googleapis/nodejs-dialogflow/blob/master/src/v2beta1/sessions_client.js#L353阅读有关此答案的库代码
更多信息请访问:https : //dialogflow.com/docs/agents/versions-environments
| 归档时间: |
|
| 查看次数: |
659 次 |
| 最近记录: |