Proto API Reference
The API is defined as a protobuf spec, so native bindings can be generated in any language with gRPC support. We recommend using buf to generate the bindings.
This section of the documentation is auto-generated from the protobuf spec. The service contains the methods that can be called, and the “messages” are the data structures (objects, classes or structs in the generated code, depending on the language) passed to and from the methods.
TrifidService
Service that implements the Cobalt Trifid Redaction Engine API.
Version
Version(VersionRequest) VersionResponse
Returns version information from the server.
ListModels
ListModels(ListModelsRequest) ListModelsResponse
ListModels returns information about the models the server can access.
RedactText
RedactText(RedactTextRequest) RedactTextResponse Redact text using a redaction engine that is configured with the provided redaction configuration.
RedactTranscript
RedactTranscript(RedactTranscriptRequest) RedactTranscriptResponse
redacts transcript using a redaction engine that is configured with the provided redaction configuration.
StreamingRedactTranscribedAudio
StreamingRedactTranscribedAudio(StreamingRedactTranscribedAudioRequest) StreamingRedactTranscribedAudioResponse
Performs bidirectional streaming redaction on transcribed audio. Receive redacted audio while sending audio. The transcription of audio data must be ready before sending the audio.
StreamingTranscribeAndRedact
StreamingTranscribeAndRedact(StreamingTranscribeAndRedactRequest) StreamingTranscribeAndRedactResponse
Performs bidirectional streaming speech recognition and redaction. Receive redacted audio and transcriptions while sending audio.
Messages
- If two or more fields in a message are labeled oneof, then each method call using that message must have exactly one of the fields populated
- If a field is labeled
repeated, then the generated code will accept an array (or struct, or list depending on the language).
ListModelsRequest
The top-level message sent by the client for the ListModels method.
ListModelsResponse
The message returned to the client by the ListModels method.
Fields
- models (ModelInfo repeated) List of models available for use on Trifid server.
ModelInfo
Description of a Trifid Model
Fields
-
id (string ) Unique identifier of the model. This identifier is used to choose the model that should be used for recognition, and is specified in the
RedactionConfigmessage. -
name (string ) Model name. This is a concise name describing the model, and may be presented to the end-user, for example, to help choose which model to use for their recognition task.
-
redaction_classes (string repeated) List of supported redaction classes.
RedactTextRequest
The top-level message sent by the client for the ListModels method.
Fields
- redaction_config (RedactionConfig)
- text (string )
Unique identifier of the model. This identifier is used to choose the model
that should be used for recognition, and is specified in the
RedactionConfigmessage.
RedactionConfig
Configuration for setting up a redaction engine.
Fields
- model_id (string)
Unique identifier of the model to use, as obtained from a
ModelInfomessage. - redaction_classes (string repeated) List of whitelisted redaction classes. If the list is empty, server default redaction class list will be considered.
- disable_streaming (bool )
This is an optional field. If this is set to
true, Cobalt Privacy Screen will redact entire transcript at once, by doing so, redaction accuracy will increase at the cost of higher latency. If set tofalse, Cobalt Privacy Screen will redact one utterance at a time and return the result as soon as possible. The default isfalse. - custom_classes (CustomClasses repeated) This is an optional field. If set, then provided list will be used to extend the list of redaction classes.
CustomClasses
CustomClass allows the client to define a new redaction class. Patterns defined here will override default redaction class for matching tokens.
Fields
- redaction_class string This is name of the new redaction class. For example, this could be “COMPANY_NAME”.
- pattern string Pattern defines a Python regex expression that would be used to identify tokens in text that get redacted to this new redaction class. For example, “COBALT|GOOGLE|MICROSOFT”, or more complex patterns such as “^COMPANY-[\d]{4}$”.
ListModelsResponse
The message returned to the client by the ListModels method.
Fields
- models (ModelInfo repeated) List of models available for use on Trifid server.
ModelInfo
Description of a Trifid Model
Fields
-
id (string ) Unique identifier of the model. This identifier is used to choose the model that should be used for recognition, and is specified in the
RedactionConfigmessage. -
name (string ) Model name. This is a concise name describing the model, and may be presented to the end-user, for example, to help choose which model to use for their recognition task.
-
redaction_classes (string repeated) List of supported redaction classes.
RedactTranscriptRequest
The top-level messages sent by the client for the RedactTranscript
method. Contains redaction config and a transcription to redact.
Fields
-
config (RedactionConfig ) redaction config
-
transcript (Transcript ) transcription to redact
RedactTranscriptResponse
The top-level message sent by the server for the RedactTranscript
method. Contains redacted transcript.
Fields
- transcript (Transcript )
RedactionConfig
Configuration for setting up a redaction engine.
Fields
-
model_id (string ) Unique identifier of the model to use, as obtained from a
ModelInfomessage. -
redaction_classes (string repeated) List of whitelisted redaction classes. If the list is empty, server default redaction class list will be considered.
-
disable_streaming (bool ) This is an optional field. If this is set to
true, Trifid will redact entire transcript at once, by doing so, redaction accuracy will increase at the cost of higher latency. If set tofalse, Trifid will redact one utterance at a time and return the result as soon as possible. The default isfalse.
Transcript
Transcript contains multiple utterance of the audio.
Fields
- utterances (Utterance repeated)
Utterance
Utterance of the audio
Fields
-
text (string ) Text representing the utterance of the audio.
-
audio_channel (uint32 ) Channel of the audio file associate with this utterance. Channels are 0-indexed, so the for mono audio data, this value will always be 0.
-
start_time_ms (uint64 ) Time offset in milliseconds relative to the beginning of audio corresponding to the start of this utterance.
-
duration_ms (uint64 ) Duration in milliseconds of the current utterance in the audio.
-
asr_confidence (double ) ASR confidence estimate between 0 and 1. A higher number represents a higher likelihood of the output being correct.
-
words_info (WordInfo repeated) Word-level information corresponding to the utterance. This field contains word-level timestamps, which are essential as input for audio redaction. This field is only available in an output utterance if
enable_word_infowas set totruein theRedactionConfig.
StreamingRedactTranscribedAudioRequest
The top-level messages sent by the client for the
StreamingRedactTranscribedAudio method. In this streaming call, multiple
StreamingRedactTranscribedAudioRequest messages should be sent. The first
message must contain a RedactTranscribedAudioConfig message only and all
subsequent messages must contain audio data only.
Fields
- oneof request.config (RedactTranscribedAudioConfig)
- oneof request.audio (bytes)
RedactTranscribedAudioConfig
Configuration for setting up a StreamingRedactTranscribedAudio method.
Fields
- redaction_config(RedactionConfig) Text redaction config.
- transcript(Trancript) Transcription of the entire audio. This must be ready before sending the audio.
StreamingRedactTranscribedAudioResponse
The top-level message sent by the server for the
StreamingRedactTranscribedAudio method. In this streaming call, multiple
StreamingRedactTranscribedAudioResponse messages contain either Utterance
or redacted audio data will be returned.
Fields
StreamingTranscribeAndRedactRequest
The top-level messages sent by the client for the
StreamingTranscribeAndRedact method. In this streaming call, multiple
StreamingTranscribeAndRedactRequest messages should be sent. The first
message must contain a TranscribeAndRedactConfig message only and all
subsequent messages must contain audio data only.
Fields
- oneof request.config (TranscribeAndRedactConfig)
- oneof request.audio (bytes)
TranscribeAndRedactConfig
Configuration for setting up a StreamingTranscribeAndRedact method.
Fields
- redaction_config(RedactionConfig) Text redaction config.
- enable_unredacted_transcript(bool)
This is an optional field. If this is set to
true, each utterance result will include unredacted utterance. If set tofalse, no unredacted utterance will be returned. The default isfalse.
StreamingTranscribeAndRedactResponse
The top-level message sent by the server for the
StreamingTranscribeAndRedact method. In this streaming call, multiple
StreamingTranscribeAndRedactResponse messages contain either
TranscribeAndRedactUtterance or redacted audio data will be returned.
Fields
VersionRequest
The top-level message sent by the client for the Version method.
VersionResponse
The top-level message sent by the server for the Version method.
Fields
- version (string ) Version of the server handling these requests.
WordInfo
Word level details for words in a utterance.
Fields
-
text (string ) The actual word corresponding to the utterance.
-
asr_confidence (double ) ASR confidence estimate between 0 and 1. A higher number represents a higher likelihood that the word was correctly recognized.
-
start_time_ms (uint64 ) Time offset in milliseconds relative to the beginning of audio received by the recognizer and corresponding to the start of this spoken word.
-
duration_ms (uint64 ) Duration in milliseconds of the current word in the spoken audio.
-
is_redacted (bool ) If this is set to true, it denotes that the curent word is redacted word or an original word of a redacted word.
-
redaction_class (string ) Recognized redaction class. This is available only if the current word is a redacted word.
-
redaction_confidence (double ) Redactio confidence estimate between 0 and 1. A higher number represents a higher likelihood that the word was correctly recognized. This is available only if the current word is a redacted word.