Documentation
¶
Overview ¶
This package contains the interface to manage the prerecorded and live/stream interfaces for the Deepgram API
Index ¶
- Variables
- func WithCustomHeaders(ctx context.Context, headers http.Header) context.Context
- func WithCustomParameters(ctx context.Context, params map[string][]string) context.Context
- func WithSigner(ctx context.Context, s Signer) context.Context
- type ClientOptions
- type HeadersContext
- type LiveTranscriptionOptions
- type ParametersContext
- type PreRecordedTranscriptionOptions
- type RawResponse
- type Signer
- type SignerContext
- type StatusError
Constants ¶
This section is empty.
Variables ¶
var DgAgent string = "@deepgram/sdk/" + sdkVersion + " go/" + goVersion()
connection agent
var ( // ErrNoApiKey no api key found ErrNoApiKey = errors.New("no api key found") )
errors
Functions ¶
func WithCustomHeaders ¶
WithCustomHeaders appends a header to the given context
func WithCustomParameters ¶
WithCustomParameters
Types ¶
type ClientOptions ¶ added in v1.0.4
type ClientOptions struct {
ApiKey string
Host string // override for the host endpoint
ApiVersion string // override for the version used
Path string // override for the endpoint path usually <version/listen> or <version/projects>
OnPrem bool // set to true if using on-prem
// live client options
SkipServerAuth bool // keeps the client from authenticating with the server
RedirectService bool // allows HTTP redirects to be followed
EnableKeepAlive bool // enables the keep alive feature
}
ClientOptions defines any options for the client
func (*ClientOptions) Parse ¶ added in v1.0.4
func (o *ClientOptions) Parse() error
type LiveTranscriptionOptions ¶
type LiveTranscriptionOptions struct {
Alternatives int `json:"alternatives,omitempty" url:"alternatives,omitempty"`
Callback string `json:"callback,omitempty" url:"callback,omitempty"`
CallbackMethod string `json:"callback_method,omitempty" url:"callback_method,omitempty"`
Channels int `json:"channels,omitempty" url:"channels,omitempty"`
Diarize bool `json:"diarize,omitempty" url:"diarize,omitempty"`
DiarizeVersion string `json:"diarize_version,omitempty" url:"diarize_version,omitempty"`
Encoding string `json:"encoding,omitempty" url:"encoding,omitempty"`
Endpointing string `json:"endpointing,omitempty" url:"endpointing,omitempty"`
Extra string `json:"extra,omitempty" url:"extra,omitempty"`
FillerWords bool `json:"filler_words,omitempty" url:"filler_words,omitempty"`
InterimResults bool `json:"interim_results,omitempty" url:"interim_results,omitempty"`
Keywords []string `json:"keywords,omitempty" url:"keywords,omitempty"`
Language string `json:"language,omitempty" url:"language,omitempty"`
Model string `json:"model,omitempty" url:"model,omitempty"`
Multichannel bool `json:"multichannel,omitempty" url:"multichannel,omitempty"`
ProfanityFilter bool `json:"profanity_filter,omitempty" url:"profanity_filter,omitempty"`
Punctuate bool `json:"punctuate,omitempty" url:"punctuate,omitempty"`
Redact []string `json:"redact,omitempty" url:"redact,omitempty"`
Replace []string `json:"replace,omitempty" url:"replace,omitempty"`
SampleRate int `json:"sample_rate,omitempty" url:"sample_rate,omitempty"`
Search []string `json:"search,omitempty" url:"search,omitempty"`
SmartFormat bool `json:"smart_format,omitempty" url:"smart_format,omitempty"`
Tag []string `json:"tag,omitempty" url:"tag,omitempty"`
UtteranceEndMs string `json:"utterance_end_ms,omitempty" url:"utterance_end_ms,omitempty"`
Version string `json:"version,omitempty" url:"version,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
func (*LiveTranscriptionOptions) Check ¶ added in v1.0.4
func (o *LiveTranscriptionOptions) Check() error
type PreRecordedTranscriptionOptions ¶
type PreRecordedTranscriptionOptions struct {
Alternatives int `json:"alternatives,omitempty" url:"alternatives,omitempty"`
Callback string `json:"callback,omitempty" url:"callback,omitempty"`
CallbackMethod string `json:"callback_method,omitempty" url:"callback_method,omitempty"`
DetectEntities bool `json:"detect_entities,omitempty" url:"detect_entities,omitempty"`
DetectLanguage bool `json:"detect_language,omitempty" url:"detect_language,omitempty"`
DetectTopics bool `json:"detect_topics,omitempty" url:"detect_topics,omitempty"`
Diarize bool `json:"diarize,omitempty" url:"diarize,omitempty"`
DiarizeVersion string `json:"diarize_version,omitempty" url:"diarize_version,omitempty"`
Dictation bool `json:"dictation,omitempty" url:"dictation,omitempty"`
Extra string `json:"extra,omitempty" url:"extra,omitempty"`
FillerWords bool `json:"filler_words,omitempty" url:"filler_words,omitempty"`
Keywords []string `json:"keywords,omitempty" url:"keywords,omitempty"`
Language string `json:"language,omitempty" url:"language,omitempty"`
Measurements bool `json:"measurements,omitempty" url:"measurements,omitempty"`
Model string `json:"model,omitempty" url:"model,omitempty"`
Multichannel bool `json:"multichannel,omitempty" url:"multichannel,omitempty"`
Paragraphs bool `json:"paragraphs,omitempty" url:"paragraphs,omitempty"`
ProfanityFilter bool `json:"profanity_filter,omitempty" url:"profanity_filter,omitempty"`
Punctuate bool `json:"punctuate,omitempty" url:"punctuate,omitempty"`
Redact []string `json:"redact,omitempty" url:"redact,omitempty"`
Replace []string `json:"replace,omitempty" url:"replace,omitempty"`
Search []string `json:"search,omitempty" url:"search,omitempty"`
SmartFormat bool `json:"smart_format,omitempty" url:"smart_format,omitempty"`
Summarize string `json:"summarize,omitempty" url:"summarize,omitempty"`
Tag []string `json:"tag,omitempty" url:"tag,omitempty"`
UttSplit float64 `json:"utt_split,omitempty" url:"utt_split,omitempty"`
Utterances bool `json:"utterances,omitempty" url:"utterances,omitempty"`
Version string `json:"version,omitempty" url:"version,omitempty"`
}
func (*PreRecordedTranscriptionOptions) Check ¶ added in v1.0.4
func (o *PreRecordedTranscriptionOptions) Check() error
type RawResponse ¶
RawResponse may be used with the Do method as the resBody argument in order to capture the raw response data.
type StatusError ¶
StatusError captures a REST error in the library
func (*StatusError) Error ¶
func (e *StatusError) Error() string
Error string representation for a given error