[英]How to specify agent ID when calling Dialogflow API?
我正在使用以下 NodeJS 代碼對 Dialogflow 進行 API 調用以發送消息“你好”,我能夠指定項目 ID,session ID,但我不確定在哪里可以指定代理 ID。
let projectId = 'DEMO PROJECT';
let message ='Hello there';
// A unique identifier for the given session
const sessionId = uuid.v4();
// Create a new session
const sessionClient = new dialogflow.SessionsClient();
const sessionPath = sessionClient.sessionPath(projectId, sessionId);
// The text query request.
const request = {
session: sessionPath,
queryInput: {
text: {
// The query to send to the dialogflow agent
text: message,
// The language used by the client (en-US)
languageCode: 'en-US',
},
},
};
// Send request and log result
const responses = await sessionClient.detectIntent(request);
問題是我在項目 DEMO 下實用地創建代理,因此,我需要指定此對話將發送給哪個代理。 目前我只能指定項目 ID 和 session ID,但是,我的問題是如何指定代理 ID ?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.