Reference documentation and code samples for the Google Cloud Dialogflow V2 Client class Conversation.
Represents a conversation.
A conversation is an interaction between an agent, including live agents
and Dialogflow agents, and a support customer. Conversations can
include phone calls and text-based chat sessions.
Generated from protobuf messagegoogle.cloud.dialogflow.v2.Conversation
Namespace
Google \ Cloud \ Dialogflow \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
Output only. Identifier. The unique identifier of this conversation. Format:projects/<Project ID>/locations/<Location ID>/conversations/<Conversation ID>.
↳ lifecycle_state
int
Output only. The current state of the Conversation.
↳ conversation_profile
string
Required. The Conversation Profile to be used to configure this Conversation. This field cannot be updated. Format:projects/<Project ID>/locations/<Location ID>/conversationProfiles/<Conversation Profile ID>.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Dialogflow V2 Client - Class Conversation (2.1.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.2 (latest)](/php/docs/reference/cloud-dialogflow/latest/V2.Conversation)\n- [2.1.1](/php/docs/reference/cloud-dialogflow/2.1.1/V2.Conversation)\n- [2.0.1](/php/docs/reference/cloud-dialogflow/2.0.1/V2.Conversation)\n- [1.17.2](/php/docs/reference/cloud-dialogflow/1.17.2/V2.Conversation)\n- [1.16.0](/php/docs/reference/cloud-dialogflow/1.16.0/V2.Conversation)\n- [1.15.1](/php/docs/reference/cloud-dialogflow/1.15.1/V2.Conversation)\n- [1.14.0](/php/docs/reference/cloud-dialogflow/1.14.0/V2.Conversation)\n- [1.13.0](/php/docs/reference/cloud-dialogflow/1.13.0/V2.Conversation)\n- [1.12.3](/php/docs/reference/cloud-dialogflow/1.12.3/V2.Conversation)\n- [1.11.0](/php/docs/reference/cloud-dialogflow/1.11.0/V2.Conversation)\n- [1.10.2](/php/docs/reference/cloud-dialogflow/1.10.2/V2.Conversation)\n- [1.9.0](/php/docs/reference/cloud-dialogflow/1.9.0/V2.Conversation)\n- [1.8.0](/php/docs/reference/cloud-dialogflow/1.8.0/V2.Conversation)\n- [1.7.2](/php/docs/reference/cloud-dialogflow/1.7.2/V2.Conversation)\n- [1.6.0](/php/docs/reference/cloud-dialogflow/1.6.0/V2.Conversation)\n- [1.5.0](/php/docs/reference/cloud-dialogflow/1.5.0/V2.Conversation)\n- [1.4.0](/php/docs/reference/cloud-dialogflow/1.4.0/V2.Conversation)\n- [1.3.2](/php/docs/reference/cloud-dialogflow/1.3.2/V2.Conversation)\n- [1.2.0](/php/docs/reference/cloud-dialogflow/1.2.0/V2.Conversation)\n- [1.1.1](/php/docs/reference/cloud-dialogflow/1.1.1/V2.Conversation)\n- [1.0.1](/php/docs/reference/cloud-dialogflow/1.0.1/V2.Conversation) \nReference documentation and code samples for the Google Cloud Dialogflow V2 Client class Conversation.\n\nRepresents a conversation.\n\nA conversation is an interaction between an agent, including live agents\nand Dialogflow agents, and a support customer. Conversations can\ninclude phone calls and text-based chat sessions.\n\nGenerated from protobuf message `google.cloud.dialogflow.v2.Conversation`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Dialogflow \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nOutput only. Identifier. The unique identifier of this conversation.\n\nFormat: `projects/\u003cProject ID\u003e/locations/\u003cLocation\nID\u003e/conversations/\u003cConversation ID\u003e`.\n\n### setName\n\nOutput only. Identifier. The unique identifier of this conversation.\n\nFormat: `projects/\u003cProject ID\u003e/locations/\u003cLocation\nID\u003e/conversations/\u003cConversation ID\u003e`.\n\n### getLifecycleState\n\nOutput only. The current state of the Conversation.\n\n### setLifecycleState\n\nOutput only. The current state of the Conversation.\n\n### getConversationProfile\n\nRequired. The Conversation Profile to be used to configure this\nConversation. This field cannot be updated.\n\nFormat: `projects/\u003cProject ID\u003e/locations/\u003cLocation\nID\u003e/conversationProfiles/\u003cConversation Profile ID\u003e`.\n\n### setConversationProfile\n\nRequired. The Conversation Profile to be used to configure this\nConversation. This field cannot be updated.\n\nFormat: `projects/\u003cProject ID\u003e/locations/\u003cLocation\nID\u003e/conversationProfiles/\u003cConversation Profile ID\u003e`.\n\n### getPhoneNumber\n\nOutput only. It will not be empty if the conversation is to be connected\nover telephony.\n\n### hasPhoneNumber\n\n### clearPhoneNumber\n\n### setPhoneNumber\n\nOutput only. It will not be empty if the conversation is to be connected\nover telephony.\n\n### getStartTime\n\nOutput only. The time the conversation was started.\n\n### hasStartTime\n\n### clearStartTime\n\n### setStartTime\n\nOutput only. The time the conversation was started.\n\n### getEndTime\n\nOutput only. The time the conversation was finished.\n\n### hasEndTime\n\n### clearEndTime\n\n### setEndTime\n\nOutput only. The time the conversation was finished.\n\n### getConversationStage\n\nOptional. The stage of a conversation. It indicates whether the virtual\nagent or a human agent is handling the conversation.\n\nIf the conversation is created with the conversation profile that has\nDialogflow config set, defaults to\n[ConversationStage.VIRTUAL_AGENT_STAGE](/php/docs/reference/cloud-dialogflow/latest/V2.Conversation.ConversationStage#_Google_Cloud_Dialogflow_V2_Conversation_ConversationStage__VIRTUAL_AGENT_STAGE);\nOtherwise, defaults to\n[ConversationStage.HUMAN_ASSIST_STAGE](/php/docs/reference/cloud-dialogflow/latest/V2.Conversation.ConversationStage#_Google_Cloud_Dialogflow_V2_Conversation_ConversationStage__HUMAN_ASSIST_STAGE).\nIf the conversation is created with the conversation profile that has\nDialogflow config set but explicitly sets conversation_stage to\n[ConversationStage.HUMAN_ASSIST_STAGE](/php/docs/reference/cloud-dialogflow/latest/V2.Conversation.ConversationStage#_Google_Cloud_Dialogflow_V2_Conversation_ConversationStage__HUMAN_ASSIST_STAGE),\nit skips\n[ConversationStage.VIRTUAL_AGENT_STAGE](/php/docs/reference/cloud-dialogflow/latest/V2.Conversation.ConversationStage#_Google_Cloud_Dialogflow_V2_Conversation_ConversationStage__VIRTUAL_AGENT_STAGE)\nstage and directly goes to\n[ConversationStage.HUMAN_ASSIST_STAGE](/php/docs/reference/cloud-dialogflow/latest/V2.Conversation.ConversationStage#_Google_Cloud_Dialogflow_V2_Conversation_ConversationStage__HUMAN_ASSIST_STAGE).\n\n### setConversationStage\n\nOptional. The stage of a conversation. It indicates whether the virtual\nagent or a human agent is handling the conversation.\n\nIf the conversation is created with the conversation profile that has\nDialogflow config set, defaults to\n[ConversationStage.VIRTUAL_AGENT_STAGE](/php/docs/reference/cloud-dialogflow/latest/V2.Conversation.ConversationStage#_Google_Cloud_Dialogflow_V2_Conversation_ConversationStage__VIRTUAL_AGENT_STAGE);\nOtherwise, defaults to\n[ConversationStage.HUMAN_ASSIST_STAGE](/php/docs/reference/cloud-dialogflow/latest/V2.Conversation.ConversationStage#_Google_Cloud_Dialogflow_V2_Conversation_ConversationStage__HUMAN_ASSIST_STAGE).\nIf the conversation is created with the conversation profile that has\nDialogflow config set but explicitly sets conversation_stage to\n[ConversationStage.HUMAN_ASSIST_STAGE](/php/docs/reference/cloud-dialogflow/latest/V2.Conversation.ConversationStage#_Google_Cloud_Dialogflow_V2_Conversation_ConversationStage__HUMAN_ASSIST_STAGE),\nit skips\n[ConversationStage.VIRTUAL_AGENT_STAGE](/php/docs/reference/cloud-dialogflow/latest/V2.Conversation.ConversationStage#_Google_Cloud_Dialogflow_V2_Conversation_ConversationStage__VIRTUAL_AGENT_STAGE)\nstage and directly goes to\n[ConversationStage.HUMAN_ASSIST_STAGE](/php/docs/reference/cloud-dialogflow/latest/V2.Conversation.ConversationStage#_Google_Cloud_Dialogflow_V2_Conversation_ConversationStage__HUMAN_ASSIST_STAGE).\n\n### getTelephonyConnectionInfo\n\nOutput only. The telephony connection information.\n\n### hasTelephonyConnectionInfo\n\n### clearTelephonyConnectionInfo\n\n### setTelephonyConnectionInfo\n\nOutput only. The telephony connection information.\n\n### getIngestedContextReferences\n\nOutput only. The context reference updates provided by external systems.\n\n### setIngestedContextReferences\n\nOutput only. The context reference updates provided by external systems."]]