Skip to main content

Create transcription

Creates a text transcription for the selected audio file

Function CreateTranscription(Val URL, Val Token, Val Model, Val Audio, Val MIME = "audio/mpeg", Val AdditionalParameters = "", Val AdditionalHeaders = "") Export

ParameterCLI optionTypeRequiredDescription
URL--urlStringOpenAI server URL
Token--tokenStringOpenAI authorization token
Model--modelStringModels name
Audio--audioString, BinaryDataAudio file
MIME--typeStringMIME type of audio file
AdditionalParameters--optionsStructure Of KeyAndValueAdditional request parameters, if necessary
AdditionalHeaders--headersMap Of KeyAndValueAdditional request headers, if necessary

Returns: Map Of KeyAndValue - Processing result


tip

Method at API documentation: Create transcription

Parameters with Binary data type can also accept file paths on disk and URLs


1C:Enterprise/OneScript code example
    URL   = "https://hut.openintegrations.dev/localai/";
Token = "12We...";

Audio = "C:\Users\bayse\AppData\Local\Temp\v8_ADA2_1e.wav";
Model = "whisper-1";

Result = OPI_OpenAI.CreateTranscription(URL, Token, Model, Audio, "audio/wav");
    oint openai CreateTranscription \
--url "https://hut.openintegrations.dev/localai/" \
--token "***" \
--model "whisper-1" \
--audio "/tmp/pypyif03.np5.wav" \
--type "audio/wav"
Result
{
"segments": [
{
"id": 0,
"start": 0,
"end": 4400000000,
"text": "attack ships on fire off the shoulder of Orion Bright as magnesium.",
"tokens": [
50364,
2690,
11434,
322,
2610,
766,
264,
7948,
295,
41028,
24271,
382,
32950,
13,
50584
]
}
],
"text": "attack ships on fire off the shoulder of Orion Bright as magnesium."
}