aparavi-dtc-node-sdk
v1.3.3
Published
This is the Aparavi Data Toolchain SDK.
Readme
Aparavi DTC Node SDK
The Aparavi Data Toolchain (DTC) Node SDK provides a convenient way to interact with the Aparavi DTC API.
Installation
npm install aparavi-dtc-node-sdkUsage
First, you need to import and instantiate the AparaviDTC client with your API key.
const { AparaviDTC } = require('aparavi-dtc-node-sdk');
const util = require('util');
const apiKey = 'YOUR_API_KEY'; // Replace with your actual API key
const client = new AparaviDTC(apiKey);Example
Here's an example of how to use the available methods:
(async () => {
// Execute Audio to Summary Pipeline
const GEMINI_API_KEY = 'YOUR_GEMINI_API_KEY'; // Replace with your actual Gemini API key
const audioSummaryResult = await client.executeAudioToSummaryPipeline(GEMINI_API_KEY, './path/to/your/audio.mp3');
console.log('Audio to Summary result:', util.inspect(audioSummaryResult, {depth: null}));
await client.tearDownPipeline();
// Execute Simple OCR Pipeline
const simpleOCRResults = await client.executeSimpleOCR('./path/to/your/*.png');
console.log('Simple OCR results:', util.inspect(simpleOCRResults, {depth: null}));
// Execute Simple Parse Pipeline
const simpleParseResults = await client.executeSimpleParse('./path/to/your/*.pdf');
console.log('Simple Parse results:', util.inspect(simpleParseResults, {depth: null}));
// Execute Simple Audio Transcribe Pipeline
const simpleAudioResults = await client.executeSimpleAudioTranscribe('./path/to/your/*.mp3');
console.log('Simple Audio Transcribe results:', util.inspect(simpleAudioResults, {depth: null}));
// Execute Anonymize PII Pipeline (file-based)
const anonymizePiiResults = await client.executeAnonymizePii('Text with PII like SSN 123-45-6789');
console.log('Anonymize PII results:', util.inspect(anonymizePiiResults, {depth: null}));
// Execute Anonymize PII Pipeline (direct text input)
const anonymizePiiDirectResults = await client.executeAnonymizePiiDirect('Text with PII like SSN 123-45-6789');
console.log('Anonymize PII Direct results:', util.inspect(anonymizePiiDirectResults, {depth: null}));
})();API Reference
new AparaviDTC(apiKey)
Creates a new instance of the AparaviDTC client.
apiKey(string, required): Your Aparavi DTC API key.
executeAudioToSummaryPipeline(GEMINI_API_KEY, fileGlob)
Executes a pipeline that transcribes audio files and generates a summary using Gemini.
GEMINI_API_KEY(string, required): Your Gemini API key.fileGlob(string, required): A glob pattern to select the audio files to process.
executeSimpleOCR(fileGlob)
Executes a pipeline that performs Optical Character Recognition (OCR) on image files.
fileGlob(string, required): A glob pattern to select the image files to process.
executeSimpleParse(fileGlob)
Executes a pipeline that parses document files.
fileGlob(string, required): A glob pattern to select the document files to process.
executeSimpleAudioTranscribe(fileGlob)
Executes a pipeline that transcribes audio files.
fileGlob(string, required): A glob pattern to select the audio files to process.
executeAnonymizePii(textInput)
Executes a pipeline that anonymizes Personally Identifiable Information (PII) in text. This method creates a temporary file and processes it through the webhook.
textInput(string, required): The text containing PII to be anonymized.
executeAnonymizePiiDirect(textInput)
Executes a pipeline that anonymizes Personally Identifiable Information (PII) in text. This method sends the text directly to the webhook without creating temporary files.
textInput(string, required): The text containing PII to be anonymized.
tearDownPipeline()
Tears down the currently running pipeline. This should be called after a pipeline execution is complete.
