[英]Dialogflow INVALID_ARGUMENT error on followup intent update
When I call the API intents.patch ( https://dialogflow.com/docs/reference/api-v2/rest/v2/projects.agent.intents/patch ) on a followup intent using the Java SDK I receive the error: 当我使用Java SDK对后续意图调用API intents.patch( https://dialogflow.com/docs/reference/api-v2/rest/v2/projects.agent.intents/patch )时,收到错误消息:
INVALID_ARGUMENT: Read-only field 'root_followup_intent_name' cannot be set.
INVALID_ARGUMENT:无法设置只读字段'root_followup_intent_name'。
The update request I make contains only the update of the intent training phrases (I use the update mask "training_phrases"), I'm not modifying the root followup intent. 我发出的更新请求仅包含意图培训短语的更新(我使用更新掩码“ training_phrases”),我没有修改根跟踪意图。
Calling the same API on a root intent has a success response. 在根意图上调用相同的API会获得成功响应。 This problem has arised only in the last few days, before it worked correctly also on followup intents.
这个问题仅在最近几天才出现,在按照预期目的正确解决之前也是如此。
Have you got any idea of the cause? 你知道原因吗?
Thank you. 谢谢。
The name
attribute of the intent is a UUID defined by Dialogflow and cannot be changed (eg 718e3349-df8b-4d50-ac72-0de93198512a
). 意图的
name
属性是Dialogflow定义的UUID,无法更改(例如718e3349-df8b-4d50-ac72-0de93198512a
)。 To update a training phrase you need to use an existing training phrase ID from calls like dialogflow.projects.agent.intents.list
. 要更新训练短语,您需要使用来自诸如
dialogflow.projects.agent.intents.list
调用中的现有训练短语ID。 Here is an example of a valid dialogflow.projects.agent.intents.patch
call: 这是一个有效的
dialogflow.projects.agent.intents.patch
调用的示例:
PATCH https://dialogflow.googleapis.com/v2/projects/stagent-f2236/agent/intents/c757e598-c44b-485f-bcb4-01c1b0110856?intentView=INTENT_VIEW_FULL&updateMask=trainingPhrases&fields=trainingPhrases
{
"trainingPhrases": [
{
"name": "718e3349-df8b-4d50-ac72-0de93198512a",
"parts": [
{
"text": "updated training phrase text"
}
],
"type": "EXAMPLE"
}
]
}
Here is an API explorer example for the same dialogflow.projects.agent.intents.patch
call. 这是相同的
dialogflow.projects.agent.intents.patch
调用的API资源管理器示例 。 Note you'll need to change the value of the project ID ( stagent-f2236
) to your Dialogflow agent's project ID, the training phrase ID ( 718e3349-df8b-4d50-ac72-0de93198512a
) with the ID of the training phrase you'd like to change and the text ( updated training phrase text
) to the text you'd like to update the intent training phrase to. 请注意,您需要将项目ID(
stagent-f2236
)的值更改为Dialogflow代理的项目ID,即训练短语ID( 718e3349-df8b-4d50-ac72-0de93198512a
)和您想要的训练短语的ID想要更改,并将文本( updated training phrase text
)更改为您想要将意图训练短语更新为的文本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.