# 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).

import 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.config.from_file()


# Initialize service client with default config file
generative_ai_agent_client = oci.generative_ai_agent.GenerativeAiAgentClient(
    config)


# Send the request to service, some parameters are not required, see API
# doc for more info
update_knowledge_base_response = generative_ai_agent_client.update_knowledge_base(
    knowledge_base_id="ocid1.test.oc1..<unique_ID>EXAMPLE-knowledgeBaseId-Value",
    update_knowledge_base_details=oci.generative_ai_agent.models.UpdateKnowledgeBaseDetails(
        display_name="EXAMPLE-displayName-Value",
        description="EXAMPLE-description-Value",
        index_config=oci.generative_ai_agent.models.OciOpenSearchIndexConfig(
            index_config_type="OCI_OPEN_SEARCH_INDEX_CONFIG",
            cluster_id="ocid1.test.oc1..<unique_ID>EXAMPLE-clusterId-Value",
            secret_detail=oci.generative_ai_agent.models.IdcsSecret(
                type="IDCS_SECRET",
                idcs_url="EXAMPLE-idcsUrl-Value",
                client_id="ocid1.test.oc1..<unique_ID>EXAMPLE-clientId-Value",
                vault_secret_id="ocid1.test.oc1..<unique_ID>EXAMPLE-vaultSecretId-Value",
                scope_url="EXAMPLE-scopeUrl-Value"),
            indexes=[
                oci.generative_ai_agent.models.Index(
                    name="EXAMPLE-name-Value",
                    schema=oci.generative_ai_agent.models.IndexSchema(
                        body_key="EXAMPLE-bodyKey-Value",
                        url_key="EXAMPLE-urlKey-Value",
                        title_key="EXAMPLE-titleKey-Value",
                        embedding_body_key="EXAMPLE-embeddingBodyKey-Value"))]),
        freeform_tags={
            'EXAMPLE_KEY_M4Uxa': 'EXAMPLE_VALUE_l4Stw8tp5ylqM4rjcNK8'},
        defined_tags={
            'EXAMPLE_KEY_dlw6Q': {
                'EXAMPLE_KEY_T9Npw': 'EXAMPLE--Value'}}),
    if_match="EXAMPLE-ifMatch-Value",
    opc_request_id="ZN3WU7DXTIUHFZTIBBPL<unique_ID>")

# Get the data from response
print(update_knowledge_base_response.headers)