I'm trying to restore the contents of a Dialogflow CX agent into a new different agent. Basically trying to clone an agent. The original agent has a data store associated with it in order to make LLM responses. The agent was originally exported in the JSON Package format, not raw bytes.
The idea is being able to do it from the python Dialogflow CX library in order to automate the process. But the same error happens when I try to do it from the web UI.
The error in the web UI is:
Cannot restore data store references into an agent that is not associated with a Vertex AI Search and Conversation app. Code: FAILED_PRECONDITION
In the python library, using this function (https://cloud.google.com/python/docs/reference/dialogflow-cx/latest/google.cloud.dialogflowcx_v3.services.agents.AgentsClient#google_cloud_dialogflowcx_v3_services_agents_AgentsClient_restore_agent) throws this pretty similar error:
google.api_core.exceptions.FailedPrecondition: 400 com.google.apps.framework.request.FailedPreconditionException: Cannot restore data store references into an agent that is not associated with a Vertex AI Search and Conversation app. Code: FAILED_PRECONDITION 9: com.google.apps.framework.request.FailedPreconditionException: Cannot restore data store references into an agent that is not associated with a Vertex AI Search and Conversation app. Code: FAILED_PRECONDITION
I get the fact that I need to associate a “Vertex AI Search and Conversation app” to this new agent, and add the same data store to the agent as well. The new agent is in the same account and same Dialogflow CX project than the original one, so the data store shouldn't be a problem.
But I don't know how to do that programmatically. Wasn't able to find a function in the python library to associate to the app: https://cloud.google.com/python/docs/reference/dialogflow-cx/latest
Also tried to look at the Vertex AI SDK for python: https://cloud.google.com/vertex-ai/docs/python-sdk/use-vertex-ai-python-sdk But don't know how to do it there either.
Can anyone help me please? Thanks in advance.
It looks like nothing can be done via the Python Client for now, but check out this link. The REST API is available for use.
A quick sketch of something that should get close to you need within Python: