// This is an automatically generated code sample. 
// To make this code sample work in your Oracle Cloud tenancy, 
// please replace the values for any parameters whose current values do not fit
// your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and 
// boolean, number, and enum parameters with values not fitting your use case).

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Oci.GenerativeaiagentService;
using Oci.Common;
using Oci.Common.Auth;

namespace Oci.Sdk.DotNet.Example.Generativeaiagent
{
    public class UpdateAgentEndpointExample
    {
        public static async Task Main()
        {
            // Create a request and dependent object(s).
			var updateAgentEndpointDetails = new Oci.GenerativeaiagentService.Models.UpdateAgentEndpointDetails
			{
				DisplayName = "EXAMPLE-displayName-Value",
				Description = "EXAMPLE-description-Value",
				ContentModerationConfig = new Oci.GenerativeaiagentService.Models.ContentModerationConfig
				{
					ShouldEnableOnInput = true,
					ShouldEnableOnOutput = true
				},
				GuardrailConfig = new Oci.GenerativeaiagentService.Models.GuardrailConfig
				{
					ContentModerationConfig = new Oci.GenerativeaiagentService.Models.ContentModerationGuardrailConfig
					{
						InputGuardrailMode = Oci.GenerativeaiagentService.Models.GuardrailMode.Disable,
						OutputGuardrailMode = Oci.GenerativeaiagentService.Models.GuardrailMode.Inform
					},
					PromptInjectionConfig = new Oci.GenerativeaiagentService.Models.PromptInjectionGuardrailConfig
					{
						InputGuardrailMode = Oci.GenerativeaiagentService.Models.GuardrailMode.Disable
					},
					PersonallyIdentifiableInformationConfig = new Oci.GenerativeaiagentService.Models.PersonallyIdentifiableInformationGuardrailConfig
					{
						InputGuardrailMode = Oci.GenerativeaiagentService.Models.GuardrailMode.Inform,
						OutputGuardrailMode = Oci.GenerativeaiagentService.Models.GuardrailMode.Inform
					}
				},
				Metadata = new Dictionary<string, string>()
				{
					{
						"EXAMPLE_KEY_axZoe", 
						"EXAMPLE_VALUE_vOazJqVIBnaMRigoGaZD"
					}
				},
				HumanInputConfig = new Oci.GenerativeaiagentService.Models.HumanInputConfig
				{
					ShouldEnableHumanInput = false
				},
				OutputConfig = new Oci.GenerativeaiagentService.Models.OutputConfig
				{
					OutputLocation = new Oci.GenerativeaiagentService.Models.ObjectStoragePrefixOutputLocation
					{
						NamespaceName = "EXAMPLE-namespaceName-Value",
						BucketName = "EXAMPLE-bucketName-Value",
						Prefix = "EXAMPLE-prefix-Value"
					},
					RetentionPeriodInMinutes = 186
				},
				ShouldEnableTrace = false,
				ShouldEnableCitation = true,
				ShouldEnableMultiLanguage = true,
				SessionConfig = new Oci.GenerativeaiagentService.Models.SessionConfig
				{
					IdleTimeoutInSeconds = 223
				},
				FreeformTags = new Dictionary<string, string>()
				{
					{
						"EXAMPLE_KEY_LkXJl", 
						"EXAMPLE_VALUE_RIMOCJidT7yGMlT4k3mR"
					}
				},
				DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
				{
					{
						"EXAMPLE_KEY_c2dDb", 
						new Dictionary<string, Object>()
						{
							{
								"EXAMPLE_KEY_3P8u4", 
								"EXAMPLE--Value"
							}
						}
					}
				}
			};
			var updateAgentEndpointRequest = new Oci.GenerativeaiagentService.Requests.UpdateAgentEndpointRequest
			{
				AgentEndpointId = "ocid1.test.oc1..<unique_ID>EXAMPLE-agentEndpointId-Value",
				UpdateAgentEndpointDetails = updateAgentEndpointDetails,
				IfMatch = "EXAMPLE-ifMatch-Value",
				OpcRequestId = "57KRJ7OK4NGDFCLC02OF<unique_ID>"
			};

            // Create a default authentication provider that uses the DEFAULT
            // profile in the configuration file.
            // Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file. 
            var provider = new ConfigFileAuthenticationDetailsProvider("DEFAULT");
            try
            {
                // Create a service client and send the request.
				using (var client = new GenerativeAiAgentClient(provider, new ClientConfiguration()))
				{
					var response = await client.UpdateAgentEndpoint(updateAgentEndpointRequest);
					// Retrieve value from the response.
					var versionValue = response.httpResponseMessage.Version;
				}
            }
            catch (Exception e)
            {
                Console.WriteLine($"UpdateAgentEndpoint Failed with {e.Message}");
                throw e;
            }
        }

    }
}

Was this article helpful?