This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Proto API Reference

Detailed reference for API requests and types.

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 RedactionConfig message.

  • 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 RedactionConfig message.

RedactionConfig

Configuration for setting up a redaction engine.

Fields

  • model_id (string) Unique identifier of the model to use, as obtained from a ModelInfo message.
  • 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 to false, Cobalt Privacy Screen will redact one utterance at a time and return the result as soon as possible. The default is false.
  • 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 RedactionConfig message.

  • 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

RedactTranscriptResponse

The top-level message sent by the server for the RedactTranscript method. Contains redacted transcript.

Fields

RedactionConfig

Configuration for setting up a redaction engine.

Fields

  • model_id (string ) Unique identifier of the model to use, as obtained from a ModelInfo message.

  • 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 to false, Trifid will redact one utterance at a time and return the result as soon as possible. The default is false.

Transcript

Transcript contains multiple utterance of the audio.

Fields

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_info was set to true in the RedactionConfig.

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

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

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 to false, no unredacted utterance will be returned. The default is false.

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.

Enums

Scalar Value Types

.proto Type C++ Type C# Type Go Type Java Type PHP Type Python Type Ruby Type

double
double double float64 double float float Float

float
float float float32 float float float Float

int32
int32 int int32 int integer int Bignum or Fixnum (as required)

int64
int64 long int64 long integer/string int/long Bignum

uint32
uint32 uint uint32 int integer int/long Bignum or Fixnum (as required)

uint64
uint64 ulong uint64 long integer/string int/long Bignum or Fixnum (as required)

sint32
int32 int int32 int integer int Bignum or Fixnum (as required)

sint64
int64 long int64 long integer/string int/long Bignum

fixed32
uint32 uint uint32 int integer int Bignum or Fixnum (as required)

fixed64
uint64 ulong uint64 long integer/string int/long Bignum

sfixed32
int32 int int32 int integer int Bignum or Fixnum (as required)

sfixed64
int64 long int64 long integer/string int/long Bignum

bool
bool bool bool boolean boolean boolean TrueClass/FalseClass

string
string string string String string str/unicode String (UTF-8)

bytes
string ByteString []byte ByteString string str String (ASCII-8BIT)