interfaces

package
v1.0.0-alpha.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2023 License: MIT Imports: 6 Imported by: 42

Documentation

Overview

This package contains the interface to manage the prerecorded interfaces for the Deepgram API

This package contains the interface to manage the live/streaming interfaces for the Deepgram API

Index

Constants

This section is empty.

Variables

View Source
var DgAgent string = "@deepgram/sdk/" + sdkVersion + " go/" + goVersion()

connection agent

Functions

func WithCustomHeaders

func WithCustomHeaders(ctx context.Context, headers http.Header) context.Context

WithCustomHeaders appends a header to the given context

func WithCustomParameters

func WithCustomParameters(ctx context.Context, params map[string][]string) context.Context

WithCustomParameters

func WithSigner

func WithSigner(ctx context.Context, s Signer) context.Context

WithSigner appends a signer to the given context

Types

type HeadersContext

type HeadersContext struct{}

HeadersContext blackbox of data

type LiveTranscriptionOptions

type LiveTranscriptionOptions struct {
	Alternatives     int      `json:"alternatives" url:"alternatives,omitempty" `
	Callback         string   `json:"callback" url:"callback,omitempty" `
	Channels         int      `json:"channels" url:"channels,omitempty" `
	Diarize          bool     `json:"diarize" url:"diarize,omitempty" `
	Diarize_version  string   `json:"diarize_version" url:"diarize_version,omitempty" `
	Encoding         string   `json:"encoding" url:"encoding,omitempty" `
	Endpointing      string   `json:"endpointing" url:"endpointing,omitempty" ` // Can be "false" to disable endpointing, or can be the milliseconds of silence to wait before returning a transcript. Default is 10 milliseconds. Is string here so it can accept "false" as a value.
	Interim_results  bool     `json:"interim_results" url:"interim_results,omitempty" `
	Keywords         []string `json:"keywords" url:"keywords,omitempty" `
	Language         string   `json:"language" url:"language,omitempty" `
	Model            string   `json:"model" url:"model,omitempty" `
	Multichannel     bool     `json:"multichannel" url:"multichannel,omitempty" `
	Numerals         bool     `json:"numerals" url:"numerals,omitempty" `
	Profanity_filter bool     `json:"profanity_filter" url:"profanity_filter,omitempty" `
	Punctuate        bool     `json:"punctuate" url:"punctuate,omitempty" `
	Redact           []string `json:"redact" url:"redact,omitempty" `
	Replace          string   `json:"replace" url:"replace,omitempty" `
	Sample_rate      int      `json:"sample_rate" url:"sample_rate,omitempty" `
	Search           []string `json:"search" url:"search,omitempty" `
	Smart_format     bool     `json:"smart_format" url:"smart_format,omitempty" `
	Tag              []string `json:"tag" url:"tag,omitempty" `
	Tier             string   `json:"tier" url:"tier,omitempty" `
	Version          string   `json:"version" url:"version,omitempty" `
	FillerWords      string   `json:"filler_words" url:"filler_words,omitempty" `
}

LiveTranscriptionOptions contain all of the knobs and dials to control the live transcription from the Deepgram API

Please see the documentation for live/streaming for more details: https://developers.deepgram.com/reference/streaming

type ParametersContext

type ParametersContext struct{}

ParametersContext blackbox of data

type PreRecordedTranscriptionOptions

type PreRecordedTranscriptionOptions struct {
	Alternatives       int         `json:"alternatives" url:"alternatives,omitempty" `
	Callback           string      `json:"callback" url:"callback,omitempty" `
	DetectEntities     bool        `json:"detect_entities" url:"detect_entities,omitempty"`
	DetectLanguage     bool        `json:"detect_language" url:"detect_language,omitempty" `
	DetectTopics       bool        `json:"detect_topics" url:"detect_topics,omitempty" `
	Diarize            bool        `json:"diarize" url:"diarize,omitempty" `
	Diarize_version    string      `json:"diarize_version" url:"diarize_version,omitempty" `
	Keywords           []string    `json:"keywords" url:"keywords,omitempty" `
	Language           string      `json:"language" url:"language,omitempty" `
	Model              string      `json:"model" url:"model,omitempty" `
	Multichannel       bool        `json:"multichannel" url:"multichannel,omitempty" `
	Numerals           bool        `json:"numerals" url:"numerals,omitempty" ` // Same as Numbers, old name for same option
	Paragraphs         bool        `json:"paragraphs" url:"paragraphs,omitempty" `
	Profanity_filter   bool        `json:"profanity_filter" url:"profanity_filter,omitempty" `
	Punctuate          bool        `json:"punctuate" url:"punctuate,omitempty" `
	Redact             []string    `json:"redact" url:"redact,omitempty" `
	Replace            []string    `json:"replace" url:"replace,omitempty" `
	Search             []string    `json:"search" url:"search,omitempty" `
	Sentiment          bool        `json:"sentiment" url:"sentiment,omitempty" `
	SentimentThreshold float64     `json:"sentiment_threshold" url:"sentiment_threshold,omitempty" `
	SmartFormat        bool        `json:"smart_format" url:"smart_format,omitempty" `
	Summarize          interface{} `json:"summarize" url:"summarize,omitempty" ` // bool | string
	Tag                []string    `json:"tag" url:"tag,omitempty"`
	Tier               string      `json:"tier" url:"tier,omitempty" `
	Utterances         bool        `json:"utterances" url:"utterances,omitempty" `
	Utt_split          float64     `json:"utt_split" url:"utt_split,omitempty" `
	Version            string      `json:"version" url:"version,omitempty" `
	FillerWords        string      `json:"filler_words" url:"filler_words,omitempty" `
}

PreRecordedTranscriptionOptions contain all of the knobs and dials to control a Prerecorded transcription from the Deepgram API

Please see the documentation for live/streaming for more details: https://developers.deepgram.com/reference/pre-recorded

type RawResponse

type RawResponse struct {
	bytes.Buffer
}

RawResponse may be used with the Do method as the resBody argument in order to capture the raw response data.

type Signer

type Signer interface {
	SignRequest(*http.Request) error
}
custom headers and configuration options

Signer callback for the certificant signer

type SignerContext

type SignerContext struct{}

SignerContext blackbox of data

type StatusError

type StatusError struct {
	Resp *http.Response
}

StatusError captures a REST error in the library

func (*StatusError) Error

func (e *StatusError) Error() string

Error string representation for a given error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL