Migrating to Dialogflow Enterprise Edition

Migrating an agent to Dialogflow V2

If you have used a previous release of Dialogflow such as Dialogflow V1 (formerly known as API.AI), and you want to use an existing agent with Dialogflow Enterprise Edition, then you must migrate that agent to Dialogflow. You must also update any code that worked with a previous release of Dialogflow to the latest Dialogflow V2 API.

To migrate an agent from a previous version of Dialogflow to Dialogflow, you will create a new agent and import your previous agent into the new agent by following these steps:

  1. Go to console.dialogflow.com and select the settings for your previous agent.

  2. Select the Export and Import tab.

  3. Select EXPORT AS ZIP and save your previous agent configuration in a .zip file.

  4. Create a Dialogflow Standard or Enterprise agent.

  5. In console.dialogflow.com console, select the settings for your new Dialogflow Standard or Enterprise agent.

  6. Select the Export and Import tab.

  7. Select IMPORT FROM ZIP and import the .zip file that you created when you exported your agent from a previous version.

    For more information on importing and exporting agents, see Versioning with Import/Export in the dialogflow.com documentation.

  8. If you have written code for the previous version of Dialogflow, you must also migrate your code to the current version. This topic contains information on migrating code the latest version of Dialogflow from the Dialogflow V1 release.

Migrating code from Dialogflow V2beta1 to V2

Users of the V2beta1 API are encouraged to migrate to the V2 API.

  • If you are using REST or RPC, update the endpoint from dialogflow.googleapis.com/v2beta1/... to dialogflow.googleapis.com/v2/...
  • If you are using a client library, update it:
    • Dynamic languages (Python, Node.js, Ruby): Upgrade the package, and your code will automatically use the latest stable version.
    • Static languages (Java, C#, PHP, Go): Install the new package and update all import statements to reference "v2" instead of "v2beta1".
  • The field that controls whether machine learning (ML) is enabled for an Intent has changed. The mlEnabled field has been removed and replaced by the mlDisabled field, and ML is enabled by default.
    Version REST RPC Default value Default behavior
    V2beta1 mlEnabled ml_enabled Before the week of April 23, 2018: false. After the week of April 23, 2018: true. Since the release of V2beta1 in November 2017, ML was not enabled. During the week of April 23, 2018, this default will change, and ML will be enabled by default. To control this behavior explicitly, use the new mlDisabled field.
    V2 mlDisabled ml_disabled false ML is enabled

Migrating code from Dialogflow V1 to V2

The Dialogflow V2 API replaces the Dialogflow V1 REST-like API. After migrating your agent to Dialogflow Enterprise Edition, you will also need to update your code that calls the Dialogflow V1 REST-like API. The following tables show which APIs replace the Dialogflow V1 APIs and which Dialogflow V1 APIs are no longer supported.

/query

Dialogflow V1 Dialogflow V2 API
/query detectIntent

Request

Dialogflow V1 Dialogflow V2 API
Request JSON Request Body
Fields
Dialogflow V1 Dialogflow V2 API
event (e) queryInput.event
event.name queryInput.event.name
event.data queryInput.event.parameters
v Not applicable.
sessionId session (Path parameter)
lang queryInput.text.languageCode (for text queries), queryInput.audioConfig.languageCode (for audio queries), queryInput.event.languageCode
contexts queryParams.contexts
contexts.name queryParams.contexts.name
contexts.parameters queryParams.contexts.parameters
contexts.lifespan queryParams.contexts.lifespanCount
resetContexts queryParams.resetContexts
entities queryParams.sessionEntityTypes
timezone queryParams.timeZone
location queryParams.geoLocation
location.latitude queryParams.geoLocation.latitude
location.longitude queryParams.geoLocation.longitude
originalRequest queryParams.payload

Response

Dialogflow V1 Dialogflow V2 API
Response JSON Response Body
Fields
Dialogflow V1 Dialogflow V2 API
id responseId
timestamp Not applicable.
lang languageCode
result queryResult
result.source queryResult.webhookSource
result.resolvedQuery queryResult.queryText
result.action queryResult.action
result.actionIncomplete queryResult.allRequiredParamsPresent
result.parameters queryResult.parameters
result.contexts queryResult.outputContexts
result.contexts.name queryResult.outputContexts.name
result.contexts.parameters queryResult.outputContexts.parameters
result.contexts.lifespan queryResult.outputContexts.lifespanCount
result.fulfillment Not applicable.
result.fulfillment.speech queryResult.fulfillmentText
result.fulfillment.messages queryResult.fulfillmentMessages
result.score queryResult.intentDetectionConfidence
result.metadata queryResult.intent
result.metadata.intentId queryResult.intent.name
result.metadata.webhookUsed queryResult.intent.webhookState
result.metadata.webhookForSlotFillingUsed queryResult.intent.webhookState
result.metadata.webhookResponseTime queryResult.diagnosticInfo
result.metadata.intentName queryResult.intent.displayName
status Status, queryResult.webhookState
sessionId Not applicable.

/entities

Dialogflow V1 Dialogflow V2 API
/entities entityTypes

Entity Object

Dialogflow V1 Dialogflow V2 API
Entity EntityType
Fields
Dialogflow V1 Dialogflow V2 API
id name
name displayName
entries entities
entries.value entities.value
entries.synonyms entities.synonyms
isEnum kind
automatedExpansion autoExpansionMode

/userEntities

Dialogflow V1 Dialogflow V2 API
/userEntities sessions.entityTypes

User Entity Object

Dialogflow V1 Dialogflow V2 API
User Entity SessionEntityType
Fields
Dialogflow V1 Dialogflow V2 API
sessionId Session Id (Path parameter)
name name
extend entityOverrideMode
entries entities

/intents

Dialogflow V1 Dialogflow V2 API
/intents intents

Intent Object

Dialogflow V1 Dialogflow V2 API
Intent Intent
Fields
Dialogflow V1 Dialogflow V2 API
id name
name displayName
auto mlDisabled
contexts inputContextNames
templates Not applicable.
userSays trainingPhrases
userSays.id trainingPhrases.name
userSays.data trainingPhrases.parts
userSays.data.text trainingPhrases.parts.text
userSays.data.meta trainingPhrases.parts.entityType
userSays.data.alias trainingPhrases.parts.alias
userSays.data.userDefined trainingPhrases.parts.userDefined
userSays.isTemplate trainingPhrases.type
userSays.count trainingPhrases.timesAddedCount
responses Not applicable.
responses.action action
responses.resetContexts resetContexts
responses.affectedContexts outputContexts
responses.affectedContexts.name outputContexts.name
responses.affectedContexts.lifespan outputContexts.lifespanCount
responses.parameters parameters
responses.parameters.name parameters.displayName
responses.parameters.value parameters.value
responses.parameters.defaultValue parameters.defaultValue
responses.parameters.required parameters.mandatory
responses.parameters.dataType parameters.entityTypeDisplayName
responses.parameters.prompts parameters.prompts
responses.parameters.isList parameters.isList
responses.messages messages
responses.defaultResponsePlatforms defaultResponsePlatforms
priority priority
webhookUsed webhookState
webhookForSlotFilling webhookState
fallbackIntent isFallback
cortanaCommand Not applicable.
events events
events.name Not applicable.

Message objects

Text message object
Dialogflow V1 Dialogflow V2 API
Text Text
Fields
Dialogflow V1 Dialogflow V2 API
type Not applicable
speech text
Image message object
Dialogflow V1 Dialogflow V2 API
Image Image
Fields
Dialogflow V1 Dialogflow V2 API
type Not applicable.
imageUrl imageUri
Card message object
Dialogflow V1 Dialogflow V2 API
Card Card
Fields
Dialogflow V1 Dialogflow V2 API
type Not applicable.
title title
subtitle subtitle
buttons buttons
buttons.text buttons.text
buttons.postback buttons.postback
Quick replies message object
Dialogflow V1 Dialogflow V2 API
Quick Replies QuickReplies
Fields
Dialogflow V1 Dialogflow V2 API
type Not applicable.
title title
replies quickReplies
Custom payload message objects

Custom payloads are used to send platform-specific responses to Actions on Google and other integrations when advanced webhook responses are needed. There are multiple fields that accept and describe custom payloads, and each of these are listed below for each version. For V2, either the WebhookResponse.payload or the Intent.Message.payload field may be used.

Dialogflow V1 Dialogflow V2 API
Default message object payload
One click integration payload
Actions on Google payload
WebhookResponse.payload
Intent.Message.payload
Intent.Message.Platform

/contexts

Dialogflow V1 Dialogflow V2 API
/contexts sessions.contexts

Context object

Dialogflow V1 Dialogflow V2 API
Context Context
Fields
Dialogflow V1 Dialogflow V2 API
name name
lifespan lifespanCount
parameters parameters
Was this page helpful? Let us know how we did:

Send feedback about...

Dialogflow Enterprise Edition Documentation