UNPKG

@inductiv/node-red-openai-api

Version:

Enhance your Node-RED projects with advanced AI capabilities.

160 lines (147 loc) 6.17 kB
<section> <details> <summary style="font-weight: bold;">🔉 Audio</summary> <a href="https://developers.openai.com/api/reference/typescript/resources/audio/" target="_blank">Official Documentation <i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <h4 style="font-weight: bolder;"> ⋙ Create Speech</h4> <p>Generates audio from the input text.</p> <dl class="message-properties"> <h4>msg.payload Properties</h4> <dt> input <span class="property-type">string</span> </dt> <dd>The text to generate audio for.</dd> <dt> model <span class="property-type">string</span> </dt> <dd>One of the available TTS models: <code>tts-1</code>, <code>tts-1-hd</code> or <code>gpt-4o-mini-tts</code>.</dd> <dt> voice <span class="property-type">string or object</span> </dt> <dd> The voice to use when generating the audio. You can send a built-in voice name such as <code>alloy</code>, <code>ash</code>, <code>ballad</code>, <code>coral</code>, <code>echo</code>, <code>fable</code>, <code>onyx</code>, <code>nova</code>, <code>sage</code>, <code>shimmer</code>, <code>verse</code>, <code>marin</code>, or <code>cedar</code>. You can also send a custom voice object with an id, for example <code>{ "id": "voice_1234" }</code>. </dd> <dt class="optional"> instructions <span class="property-type">string</span> </dt> <dd> Control the voice of your generated audio with additional instructions. Does not work with <code>tts-1</code> or <code>tts-1-hd</code>. </dd> <dt class="optional"> response_format <span class="property-type">string</span> </dt> <dd> The format to audio in. Supported formats are mp3, opus, aac, flac, wav, and pcm. </dd> <dt class="optional"> speed <span class="property-type">number</span> </dt> <dd> The speed of the generated audio. Select a value from 0.25 to 4.0. 1.0 is the default. </dd> </dl> <h4 style="font-weight: bolder;"> ⋙ Create Transcription</h4> <p>Transcribes audio into the input language.</p> <dl class="message-properties"> <h4>msg.payload Properties</h4> <dt> file <span class="property-type">file</span> </dt> <dd> Absolute path to the file that's being transcribed, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. </dd> <dt> model <span class="property-type">string</span> </dt> <dd>ID of the model to use.</dd> <dt class="optional"> language <span class="property-type">string</span> </dt> <dd>The language of the input audio.</dd> <dt class="optional"> prompt <span class="property-type">string</span> </dt> <dd> An optional text to guide the model's style or continue a previous audio segment. </dd> <dt class="optional"> response_format <span class="property-type">string</span> </dt> <dd> The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt. </dd> <dt class="optional"> temperature <span class="property-type">number</span> </dt> <dd>The sampling temperature, between 0 and 1.</dd> <dt class="optional"> timestamp_granularities <span class="property-type">array</span> </dt> <dd>The timestamp granularities to populate for this transcription. <code>response_format</code> must be set to <code>verbose_json</code> to use timestamp granularities. Either or both of these options are supported: <code>word</code>, or <code>segment</code>.</dd> </dl> <h4 style="font-weight: bolder;"> ⋙ Create Translation</h4> <p>Translates audio into English.</p> <dl class="message-properties"> <h4>msg.payload Properties</h4> <dt> file <span class="property-type">file</span> </dt> <dd> Absolute path to the file that's being translated, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. </dd> <dt> model <span class="property-type"></span> </dt> <dd>ID of the model to use.</dd> <dt class="optional"> prompt <span class="property-type">string</span> </dt> <dd> An optional text to guide the model's style or continue a previous audio segment. </dd> <dt class="optional"> response_format <span class="property-type">string</span> </dt> <dd> The format of the transcript output, in one of these options: json, text, srt, verbose_json, or vtt. </dd> <dt class="optional"> temperature <span class="property-type">number</span> </dt> <dd>The sampling temperature, between 0 and 1.</dd> </dl> </details> </section>