// 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 * as aispeech from "oci-aispeech";
import common = require("oci-common");
// 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.
const provider: common.ConfigFileAuthenticationDetailsProvider = new common.ConfigFileAuthenticationDetailsProvider();
(async () => {
try {
// Create a service client
const client = new aispeech.AIServiceSpeechClient({ authenticationDetailsProvider: provider });
// Create a request and dependent object(s).
const createTranscriptionJobDetails = {
displayName: "EXAMPLE-displayName-Value",
compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
description: "EXAMPLE-description-Value",
additionalTranscriptionFormats: [aispeech.models.CreateTranscriptionJobDetails.AdditionalTranscriptionFormats.Srt ],
modelDetails: {
modelType: "EXAMPLE-modelType-Value",
domain: aispeech.models.TranscriptionModelDetails.Domain.Generic,
languageCode: aispeech.models.TranscriptionModelDetails.LanguageCode.Hr,
transcriptionSettings: {
diarization: {
isDiarizationEnabled: false,
numberOfSpeakers: 4,
}
,
additionalSettings: {
EXAMPLE_KEY_nM5IK :"EXAMPLE_VALUE_xuikBxtmWHWDNY30aVLm"
},
}
,
}
,
normalization: {
isPunctuationEnabled: true,
filters: [{
type: "PROFANITY", mode: aispeech.models.ProfanityTranscriptionFilter.Mode.Remove
}
],
}
,
inputLocation: {
locationType: "OBJECT_LIST_INLINE_INPUT_LOCATION", objectLocations: [{
namespaceName: "EXAMPLE-namespaceName-Value",
bucketName: "EXAMPLE-bucketName-Value",
objectNames: ["EXAMPLE--Value" ],
}
]
}
,
outputLocation: {
namespaceName: "EXAMPLE-namespaceName-Value",
bucketName: "EXAMPLE-bucketName-Value",
prefix: "EXAMPLE-prefix-Value",
}
,
freeformTags: {
EXAMPLE_KEY_NxDEZ :"EXAMPLE_VALUE_OICrJqF4aiCwJig6ZyNl"
},
definedTags: {
EXAMPLE_KEY_omZyk :{
EXAMPLE_KEY_FWJAu :"EXAMPLE--Value"
}
},
}
const createTranscriptionJobRequest: aispeech.requests.CreateTranscriptionJobRequest = {
createTranscriptionJobDetails: createTranscriptionJobDetails,
opcRetryToken: "EXAMPLE-opcRetryToken-Value",
opcRequestId: "IWTGYYKN3KLZBQHEYYAS<unique_ID>",
};
// Send request to the Client.
const createTranscriptionJobResponse = await client.createTranscriptionJob(createTranscriptionJobRequest);
}
catch (error) {
console.log("createTranscriptionJob Failed with error " + error);
}
})();