Reference documentation and code samples for the Dialogflow V2 API class Google::Cloud::Dialogflow::V2::Environment.
You can create multiple versions of your agent and publish them to separate
environments.
When you edit an agent, you are editing the draft agent. At any point, you
can save the draft agent as an agent version, which is an immutable snapshot
of your agent.
When you save the draft agent, it is published to the default environment.
When you create agent versions, you can publish them to custom environments.
You can create a variety of custom environments for:
(::String) — Optional. The developer-provided description for this environment.
The maximum length is 500 characters. If exceeded, the request is rejected.
#description=
defdescription=(value)->::String
Parameter
value (::String) — Optional. The developer-provided description for this environment.
The maximum length is 500 characters. If exceeded, the request is rejected.
Returns
(::String) — Optional. The developer-provided description for this environment.
The maximum length is 500 characters. If exceeded, the request is rejected.
(::Google::Protobuf::Timestamp) — Output only. The last update time of this environment. This field is
read-only, i.e., it cannot be set by create and update methods.
[[["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-09 UTC."],[],[],null,["# Dialogflow V2 API - Class Google::Cloud::Dialogflow::V2::Environment (v1.10.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.10.1 (latest)](/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-Environment)\n- [1.10.0](/ruby/docs/reference/google-cloud-dialogflow-v2/1.10.0/Google-Cloud-Dialogflow-V2-Environment)\n- [1.9.1](/ruby/docs/reference/google-cloud-dialogflow-v2/1.9.1/Google-Cloud-Dialogflow-V2-Environment)\n- [1.8.0](/ruby/docs/reference/google-cloud-dialogflow-v2/1.8.0/Google-Cloud-Dialogflow-V2-Environment)\n- [1.7.0](/ruby/docs/reference/google-cloud-dialogflow-v2/1.7.0/Google-Cloud-Dialogflow-V2-Environment)\n- [1.6.0](/ruby/docs/reference/google-cloud-dialogflow-v2/1.6.0/Google-Cloud-Dialogflow-V2-Environment)\n- [1.5.0](/ruby/docs/reference/google-cloud-dialogflow-v2/1.5.0/Google-Cloud-Dialogflow-V2-Environment)\n- [1.4.1](/ruby/docs/reference/google-cloud-dialogflow-v2/1.4.1/Google-Cloud-Dialogflow-V2-Environment)\n- [1.3.0](/ruby/docs/reference/google-cloud-dialogflow-v2/1.3.0/Google-Cloud-Dialogflow-V2-Environment)\n- [1.2.0](/ruby/docs/reference/google-cloud-dialogflow-v2/1.2.0/Google-Cloud-Dialogflow-V2-Environment)\n- [1.1.1](/ruby/docs/reference/google-cloud-dialogflow-v2/1.1.1/Google-Cloud-Dialogflow-V2-Environment)\n- [1.0.0](/ruby/docs/reference/google-cloud-dialogflow-v2/1.0.0/Google-Cloud-Dialogflow-V2-Environment)\n- [0.34.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.34.0/Google-Cloud-Dialogflow-V2-Environment)\n- [0.33.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.33.0/Google-Cloud-Dialogflow-V2-Environment)\n- [0.32.2](/ruby/docs/reference/google-cloud-dialogflow-v2/0.32.2/Google-Cloud-Dialogflow-V2-Environment)\n- [0.31.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.31.0/Google-Cloud-Dialogflow-V2-Environment)\n- [0.30.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.30.0/Google-Cloud-Dialogflow-V2-Environment)\n- [0.29.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.29.0/Google-Cloud-Dialogflow-V2-Environment)\n- [0.28.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.28.0/Google-Cloud-Dialogflow-V2-Environment)\n- [0.27.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.27.0/Google-Cloud-Dialogflow-V2-Environment)\n- [0.26.2](/ruby/docs/reference/google-cloud-dialogflow-v2/0.26.2/Google-Cloud-Dialogflow-V2-Environment)\n- [0.25.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.25.0/Google-Cloud-Dialogflow-V2-Environment)\n- [0.24.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.24.0/Google-Cloud-Dialogflow-V2-Environment)\n- [0.23.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.23.0/Google-Cloud-Dialogflow-V2-Environment)\n- [0.22.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.22.0/Google-Cloud-Dialogflow-V2-Environment)\n- [0.21.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.21.0/Google-Cloud-Dialogflow-V2-Environment)\n- [0.20.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.20.0/Google-Cloud-Dialogflow-V2-Environment)\n- [0.19.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.19.0/Google-Cloud-Dialogflow-V2-Environment)\n- [0.18.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.18.0/Google-Cloud-Dialogflow-V2-Environment)\n- [0.17.1](/ruby/docs/reference/google-cloud-dialogflow-v2/0.17.1/Google-Cloud-Dialogflow-V2-Environment)\n- [0.16.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.16.0/Google-Cloud-Dialogflow-V2-Environment)\n- [0.15.2](/ruby/docs/reference/google-cloud-dialogflow-v2/0.15.2/Google-Cloud-Dialogflow-V2-Environment)\n- [0.14.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.14.0/Google-Cloud-Dialogflow-V2-Environment)\n- [0.13.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.13.0/Google-Cloud-Dialogflow-V2-Environment)\n- [0.12.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.12.0/Google-Cloud-Dialogflow-V2-Environment) \nReference documentation and code samples for the Dialogflow V2 API class Google::Cloud::Dialogflow::V2::Environment.\n\nYou can create multiple versions of your agent and publish them to separate\nenvironments.\n\n\nWhen you edit an agent, you are editing the draft agent. At any point, you\ncan save the draft agent as an agent version, which is an immutable snapshot\nof your agent.\n\nWhen you save the draft agent, it is published to the default environment.\nWhen you create agent versions, you can publish them to custom environments.\nYou can create a variety of custom environments for:\n\n- testing\n- development\n- production\n- etc.\n\n\u003cbr /\u003e\n\nFor more information, see the [versions and environments\nguide](https://cloud.google.com/dialogflow/docs/agents-versions). \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #agent_version\n\n def agent_version() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Optional. The agent version loaded into this environment.\n Supported formats:\n\n - `projects/\u003cProject ID\u003e/agent/versions/\u003cVersion ID\u003e`\n - `projects/\u003cProject ID\u003e/locations/\u003cLocation ID\u003e/agent/versions/\u003cVersion\n ID\u003e`\n\n### #agent_version=\n\n def agent_version=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) ---\n\n Optional. The agent version loaded into this environment.\n Supported formats:\n - `projects/\u003cProject ID\u003e/agent/versions/\u003cVersion ID\u003e`\n - `projects/\u003cProject ID\u003e/locations/\u003cLocation ID\u003e/agent/versions/\u003cVersion\nID\u003e` \n**Returns**\n\n- (::String) --- Optional. The agent version loaded into this environment.\n Supported formats:\n\n - `projects/\u003cProject ID\u003e/agent/versions/\u003cVersion ID\u003e`\n - `projects/\u003cProject ID\u003e/locations/\u003cLocation ID\u003e/agent/versions/\u003cVersion\n ID\u003e`\n\n### #description\n\n def description() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Optional. The developer-provided description for this environment. The maximum length is 500 characters. If exceeded, the request is rejected.\n\n### #description=\n\n def description=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Optional. The developer-provided description for this environment. The maximum length is 500 characters. If exceeded, the request is rejected. \n**Returns**\n\n- (::String) --- Optional. The developer-provided description for this environment. The maximum length is 500 characters. If exceeded, the request is rejected.\n\n### #fulfillment\n\n def fulfillment() -\u003e ::Google::Cloud::Dialogflow::V2::Fulfillment\n\n**Returns**\n\n- ([::Google::Cloud::Dialogflow::V2::Fulfillment](./Google-Cloud-Dialogflow-V2-Fulfillment)) --- Optional. The fulfillment settings to use for this environment.\n\n### #fulfillment=\n\n def fulfillment=(value) -\u003e ::Google::Cloud::Dialogflow::V2::Fulfillment\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Dialogflow::V2::Fulfillment](./Google-Cloud-Dialogflow-V2-Fulfillment)) --- Optional. The fulfillment settings to use for this environment. \n**Returns**\n\n- ([::Google::Cloud::Dialogflow::V2::Fulfillment](./Google-Cloud-Dialogflow-V2-Fulfillment)) --- Optional. The fulfillment settings to use for this environment.\n\n### #name\n\n def name() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Output only. The unique identifier of this agent environment. Supported formats:\n\n - `projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e`\n - `projects/\u003cProject ID\u003e/locations/\u003cLocation\n ID\u003e/agent/environments/\u003cEnvironment ID\u003e`\n\n The environment ID for the default environment is `-`.\n\n### #state\n\n def state() -\u003e ::Google::Cloud::Dialogflow::V2::Environment::State\n\n**Returns**\n\n- ([::Google::Cloud::Dialogflow::V2::Environment::State](./Google-Cloud-Dialogflow-V2-Environment-State)) --- Output only. The state of this environment. This field is read-only, i.e., it cannot be set by create and update methods.\n\n### #text_to_speech_settings\n\n def text_to_speech_settings() -\u003e ::Google::Cloud::Dialogflow::V2::TextToSpeechSettings\n\n**Returns**\n\n- ([::Google::Cloud::Dialogflow::V2::TextToSpeechSettings](./Google-Cloud-Dialogflow-V2-TextToSpeechSettings)) --- Optional. Text to speech settings for this environment.\n\n### #text_to_speech_settings=\n\n def text_to_speech_settings=(value) -\u003e ::Google::Cloud::Dialogflow::V2::TextToSpeechSettings\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Dialogflow::V2::TextToSpeechSettings](./Google-Cloud-Dialogflow-V2-TextToSpeechSettings)) --- Optional. Text to speech settings for this environment. \n**Returns**\n\n- ([::Google::Cloud::Dialogflow::V2::TextToSpeechSettings](./Google-Cloud-Dialogflow-V2-TextToSpeechSettings)) --- Optional. Text to speech settings for this environment.\n\n### #update_time\n\n def update_time() -\u003e ::Google::Protobuf::Timestamp\n\n**Returns**\n\n- ([::Google::Protobuf::Timestamp](./Google-Protobuf-Timestamp)) --- Output only. The last update time of this environment. This field is read-only, i.e., it cannot be set by create and update methods."]]