# 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).
require 'oci'
# Create a default config using DEFAULT profile in default location
# Refer to https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File for more info
config = OCI::ConfigFileLoader.load_config
# Initialize service client with default config file
generative_ai_agent_client =
OCI::GenerativeAiAgent::GenerativeAiAgentClient.new(config: config)
# Send the request to service, some parameters are not required, see API doc for more info
create_agent_endpoint_response =
generative_ai_agent_client.create_agent_endpoint(
OCI::GenerativeAiAgent::Models::CreateAgentEndpointDetails.new(
agent_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-agentId-Value',
compartment_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value',
display_name: 'EXAMPLE-displayName-Value',
description: 'EXAMPLE-description-Value',
content_moderation_config:
OCI::GenerativeAiAgent::Models::ContentModerationConfig.new(
should_enable_on_input: true, should_enable_on_output: true
),
guardrail_config:
OCI::GenerativeAiAgent::Models::GuardrailConfig.new(
content_moderation_config:
OCI::GenerativeAiAgent::Models::ContentModerationGuardrailConfig
.new(
input_guardrail_mode: 'DISABLE', output_guardrail_mode: 'DISABLE'
),
prompt_injection_config:
OCI::GenerativeAiAgent::Models::PromptInjectionGuardrailConfig.new(
input_guardrail_mode: 'BLOCK'
),
personally_identifiable_information_config:
OCI::GenerativeAiAgent::Models::PersonallyIdentifiableInformationGuardrailConfig
.new(
input_guardrail_mode: 'INFORM', output_guardrail_mode: 'DISABLE'
)
),
metadata: { 'EXAMPLE_KEY_g4Xjt' => 'EXAMPLE_VALUE_u2IKCKMmFS1JKPENHajn' },
human_input_config:
OCI::GenerativeAiAgent::Models::HumanInputConfig.new(
should_enable_human_input: false
),
output_config:
OCI::GenerativeAiAgent::Models::OutputConfig.new(
output_location:
OCI::GenerativeAiAgent::Models::ObjectStoragePrefixOutputLocation
.new(
output_location_type: 'OBJECT_STORAGE_PREFIX',
namespace_name: 'EXAMPLE-namespaceName-Value',
bucket_name: 'EXAMPLE-bucketName-Value',
prefix: 'EXAMPLE-prefix-Value'
),
retention_period_in_minutes: 70
),
should_enable_trace: false,
should_enable_citation: false,
should_enable_session: false,
should_enable_multi_language: true,
session_config:
OCI::GenerativeAiAgent::Models::SessionConfig.new(
idle_timeout_in_seconds: 557
),
provisioned_capacity_config:
OCI::GenerativeAiAgent::Models::ProvisionedCapacityConfig.new(
provisioned_capacity_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-provisionedCapacityId-Value',
platform_runtime_config:
OCI::GenerativeAiAgent::Models::PlatformRuntimeConfig.new(
platform_runtime_config_type: 'FUSION_REASONING',
version: 'EXAMPLE-version-Value'
),
tool_runtime_configs: [
OCI::GenerativeAiAgent::Models::ToolRuntimeConfig.new(
tool_runtime_config_type: 'SQL_LARGE',
version: 'EXAMPLE-version-Value'
)
]
),
freeform_tags: {
'EXAMPLE_KEY_pKdL4' => 'EXAMPLE_VALUE_Wp8Am8ydsLphp94OjznF'
},
defined_tags: {
'EXAMPLE_KEY_os8kQ' => { 'EXAMPLE_KEY_dd7RB' => 'EXAMPLE--Value' }
}
)
)
# Get the data from response
puts "#{create_agent_endpoint_response.data}"