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 AnalyzeOptions
- type ClientOptions
- type HeadersContext
- type LiveTranscriptionOptions
- type ParametersContext
- type PreRecordedTranscriptionOptions
- type RawResponse
- type Signer
- type SignerContext
- type SpeakOptions
- 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 AnalyzeOptions ¶
type AnalyzeOptions struct {
Callback string `json:"callback,omitempty" url:"callback,omitempty"`
CallbackMethod string `json:"callback_method,omitempty" url:"callback_method,omitempty"`
CustomIntent []string `json:"custom_intent,omitempty" url:"custom_intent,omitempty"`
CustomIntentMode string `json:"custom_intent_mode,omitempty" url:"custom_intent_mode,omitempty"`
CustomTopic []string `json:"custom_topic,omitempty" url:"custom_topic,omitempty"`
CustomTopicMode string `json:"custom_topic_mode,omitempty" url:"custom_topic_mode,omitempty"`
Intents bool `json:"intents,omitempty" url:"intents,omitempty"`
Language string `json:"language,omitempty" url:"language,omitempty"`
Summarize bool `json:"summarize,omitempty" url:"summarize,omitempty"`
Sentiment bool `json:"sentiment,omitempty" url:"sentiment,omitempty"`
Topics bool `json:"topics,omitempty" url:"topics,omitempty"`
}
func (*AnalyzeOptions) Check ¶
func (o *AnalyzeOptions) Check() error
type ClientOptions ¶
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 ¶
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"`
Dictation bool `json:"dictation" url:"dictation,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"`
Numerals bool `json:"numerals,omitempty" url:"numerals,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"`
VadEvents bool `json:"vad_events,omitempty" url:"vad_events,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 live/streaming documentation for more details: https://developers.deepgram.com/reference/streaming
func (*LiveTranscriptionOptions) Check ¶
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"`
Channels int `json:"channels,omitempty" url:"channels,omitempty"`
CustomIntent []string `json:"custom_intent,omitempty" url:"custom_intent,omitempty"`
CustomIntentMode string `json:"custom_intent_mode,omitempty" url:"custom_intent_mode,omitempty"`
CustomTopic []string `json:"custom_topic,omitempty" url:"custom_topic,omitempty"`
CustomTopicMode string `json:"custom_topic_mode,omitempty" url:"custom_topic_mode,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"`
Encoding string `json:"encoding,omitempty" url:"encoding,omitempty"`
Extra []string `json:"extra,omitempty" url:"extra,omitempty"`
FillerWords bool `json:"filler_words,omitempty" url:"filler_words,omitempty"`
Intents bool `json:"intents,omitempty" url:"intents,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"`
Numerals bool `json:"numerals,omitempty" url:"numerals,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"`
SampleRate int `json:"sample_rate,omitempty" url:"sample_rate,omitempty"`
Search []string `json:"search,omitempty" url:"search,omitempty"`
Sentiment bool `json:"sentiment,omitempty" url:"sentiment,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"`
Topics bool `json:"topics,omitempty" url:"topics,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"`
}
PreRecordedTranscriptionOptions contain all of the knobs and dials to control a Prerecorded transcription from the Deepgram API
Please see the prerecorded audio documentation for more details: https://developers.deepgram.com/reference/pre-recorded
func (*PreRecordedTranscriptionOptions) Check ¶
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 SpeakOptions ¶
type SpeakOptions struct {
Model string `json:"model,omitempty" url:"model,omitempty"`
Encoding string `json:"encoding,omitempty" url:"encoding,omitempty"`
Container string `json:"container,omitempty" url:"container,omitempty"`
SampleRate int `json:"sample_rate,omitempty" url:"sample_rate,omitempty"`
BitRate int `json:"bit_rate,omitempty" url:"bit_rate,omitempty"`
}
SpeakOptions contain all of the knobs and dials to transform text into speech using the Deepgram API
Please see the text-to-speech documentation for more details: https://developers.deepgram.com/reference/text-to-speech-preview-api
func (*SpeakOptions) Check ¶
func (o *SpeakOptions) Check() error
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