Skip to content

Commit

Permalink
fix: keyterms to keyterm
Browse files Browse the repository at this point in the history
  • Loading branch information
naomi-lgbt committed Feb 13, 2025
1 parent 1d2dcd2 commit be6bbcf
Show file tree
Hide file tree
Showing 21 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion examples/agent/websocket/simple/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ func main() {
tOptions.Agent.Think.Model = "gpt-4o-mini"
tOptions.Agent.Think.Instructions = "You are a helpful AI assistant."
tOptions.Agent.Listen.Model = "nova-3"
tOptions.Agent.Listen.Keyterms = []string{"Bueller"}
tOptions.Agent.Listen.Keyterm = []string{"Bueller"}

// implement your own callback
callback := msginterfaces.AgentMessageChan(*NewMyHandler())
Expand Down
2 changes: 1 addition & 1 deletion examples/speech-to-text/rest/callback/callback/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func main() {
url,
&interfaces.PreRecordedTranscriptionOptions{
Model: "nova-3",
Keyterms: []string{"deepgram"},
Keyterm: []string{"deepgram"},
Punctuate: true,
Diarize: true,
Language: "en-US",
Expand Down
2 changes: 1 addition & 1 deletion examples/speech-to-text/rest/file/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func main() {
// set the Transcription options
options := &interfaces.PreRecordedTranscriptionOptions{
Model: "nova-3",
Keyterms: []string{"Bueller"},
Keyterm: []string{"Bueller"},
Punctuate: true,
Paragraphs: true,
SmartFormat: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/speech-to-text/rest/intent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func main() {
// set the Transcription options
options := &interfaces.PreRecordedTranscriptionOptions{
Model: "nova-3",
Keyterms: []string{"deepgram"},
Keyterm: []string{"deepgram"},
Punctuate: true,
Language: "en-US",
SmartFormat: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/speech-to-text/rest/sentiment/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func main() {
// set the Transcription options
options := &interfaces.PreRecordedTranscriptionOptions{
Model: "nova-3",
Keyterms: []string{"deepgram"},
Keyterm: []string{"deepgram"},
Punctuate: true,
Language: "en-US",
SmartFormat: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/speech-to-text/rest/stream/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func main() {
// set the Transcription options
options := &interfaces.PreRecordedTranscriptionOptions{
Model: "nova-3",
Keyterms: []string{"Bueller"},
Keyterm: []string{"Bueller"},
Punctuate: true,
Diarize: true,
Language: "en-US",
Expand Down
2 changes: 1 addition & 1 deletion examples/speech-to-text/rest/summary/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func main() {
// set the Transcription options
options := &interfaces.PreRecordedTranscriptionOptions{
Model: "nova-3",
Keyterms: []string{"deepgram"},
Keyterm: []string{"deepgram"},
Punctuate: true,
Language: "en-US",
SmartFormat: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/speech-to-text/rest/topic/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func main() {
// set the Transcription options
options := &interfaces.PreRecordedTranscriptionOptions{
Model: "nova-3",
Keyterms: []string{"deepgram"},
Keyterm: []string{"deepgram"},
Punctuate: true,
Language: "en-US",
SmartFormat: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/speech-to-text/rest/url/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func main() {
// send stream to Deepgram
options := &interfaces.PreRecordedTranscriptionOptions{
Model: "nova-3",
Keyterms: []string{"deepgram"},
Keyterm: []string{"deepgram"},
Punctuate: true,
Diarize: true,
Language: "en-US",
Expand Down
2 changes: 1 addition & 1 deletion examples/speech-to-text/websocket/http_callback/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func main() {
// set the Transcription options
transcriptOptions := &interfaces.LiveTranscriptionOptions{
Model: "nova-3",
Keyterms: []string{"deepgram"},
Keyterm: []string{"deepgram"},
Language: "en-US",
Punctuate: true,
}
Expand Down
2 changes: 1 addition & 1 deletion examples/speech-to-text/websocket/http_channel/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func main() {
// set the Transcription options
transcriptOptions := &interfaces.LiveTranscriptionOptions{
Model: "nova-3",
Keyterms: []string{"deepgram"},
Keyterm: []string{"deepgram"},
Language: "en-US",
Punctuate: true,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func main() {
// set the Transcription options
tOptions := &interfaces.LiveTranscriptionOptions{
Model: "nova-3",
Keyterms: []string{"deepgram"},
Keyterm: []string{"deepgram"},
Language: "en-US",
Punctuate: true,
Encoding: "linear16",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func main() {
// set the Transcription options
tOptions := &interfaces.LiveTranscriptionOptions{
Model: "nova-3",
Keyterms: []string{"deepgram"},
Keyterm: []string{"deepgram"},
Language: "en-US",
Punctuate: true,
Encoding: "linear16",
Expand Down
2 changes: 1 addition & 1 deletion examples/speech-to-text/websocket/replay/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func main() {
// set the Transcription options
options := &interfaces.LiveTranscriptionOptions{
Model: "nova-3",
Keyterms: []string{"deepgram"},
Keyterm: []string{"deepgram"},
Language: "en-US",
Punctuate: true,
Encoding: "mulaw",
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/agent/v1/websocket/new_using_chan.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func NewUsingChanWithCancel(ctx context.Context, ctxCancel context.CancelFunc, a
if apiKey != "" {
cOptions.APIKey = apiKey
}
if len(tOptions.Agent.Listen.Keyterms) > 0 && !strings.HasPrefix(tOptions.Agent.Listen.Model, "nova-3") {
if len(tOptions.Agent.Listen.Keyterm) > 0 && !strings.HasPrefix(tOptions.Agent.Listen.Model, "nova-3") {
klog.V(1).Info("Keyterms are only supported with nova-3 models.")
return nil, nil
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/client/interfaces/v1/types-agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ type Audio struct {
Output *Output `json:"output,omitempty"`
}
type Listen struct {
Model string `json:"model,omitempty"`
Keyterms []string `json:"keyterms,omitempty"`
Model string `json:"model,omitempty"`
Keyterm []string `json:"keyterm,omitempty"`
}
type Provider struct {
Type string `json:"type,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/interfaces/v1/types-prerecorded.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type PreRecordedTranscriptionOptions struct {
FillerWords bool `json:"filler_words,omitempty" schema:"filler_words,omitempty"`
Intents bool `json:"intents,omitempty" schema:"intents,omitempty"`
Keywords []string `json:"keywords,omitempty" schema:"keywords,omitempty"`
Keyterms []string `json:"keyterms,omitempty" schema:"keyterms,omitempty"`
Keyterm []string `json:"keyterm,omitempty" schema:"keyterm,omitempty"`
Language string `json:"language,omitempty" schema:"language,omitempty"`
Measurements bool `json:"measurements,omitempty" schema:"measurements,omitempty"`
Model string `json:"model,omitempty" schema:"model,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/interfaces/v1/types-stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type LiveTranscriptionOptions struct {
FillerWords bool `json:"filler_words,omitempty" schema:"filler_words,omitempty"`
InterimResults bool `json:"interim_results,omitempty" schema:"interim_results,omitempty"`
Keywords []string `json:"keywords,omitempty" schema:"keywords,omitempty"`
Keyterms []string `json:"keyterms,omitempty" schema:"keyterms,omitempty"`
Keyterm []string `json:"keyterm,omitempty" schema:"keyterm,omitempty"`
Language string `json:"language,omitempty" schema:"language,omitempty"`
Model string `json:"model,omitempty" schema:"model,omitempty"`
Multichannel bool `json:"multichannel,omitempty" schema:"multichannel,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions pkg/client/listen/v1/rest/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Output parameters:
func (c *Client) DoFile(ctx context.Context, filePath string, req *interfaces.PreRecordedTranscriptionOptions, resBody interface{}) error {
klog.V(6).Infof("prerecorded.DoFile() ENTER\n")

if len(req.Keyterms) > 0 && !strings.HasPrefix(req.Model, "nova-3") {
if len(req.Keyterm) > 0 && !strings.HasPrefix(req.Model, "nova-3") {
klog.V(1).Info("Keyterms are only supported with nova-3 models.")
return nil
}
Expand Down Expand Up @@ -122,7 +122,7 @@ Output parameters:
func (c *Client) DoStream(ctx context.Context, src io.Reader, options *interfaces.PreRecordedTranscriptionOptions, resBody interface{}) error {
klog.V(6).Infof("prerecorded.DoStream() ENTER\n")

if len(options.Keyterms) > 0 && !strings.HasPrefix(options.Model, "nova-3") {
if len(options.Keyterm) > 0 && !strings.HasPrefix(options.Model, "nova-3") {
klog.V(1).Info("Keyterms are only supported with nova-3 models.")
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/listen/v1/websocket/new_using_callbacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func NewUsingCallbackWithCancel(ctx context.Context, ctxCancel context.CancelFun
if apiKey != "" {
cOptions.APIKey = apiKey
}
if len(tOptions.Keyterms) > 0 && !strings.HasPrefix(tOptions.Model, "nova-3") {
if len(tOptions.Keyterm) > 0 && !strings.HasPrefix(tOptions.Model, "nova-3") {
klog.V(1).Info("Keyterms are only supported with nova-3 models.")
return nil, nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/listen/v1/websocket/new_using_chan.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func NewUsingChanWithCancel(ctx context.Context, ctxCancel context.CancelFunc, a
if apiKey != "" {
cOptions.APIKey = apiKey
}
if len(tOptions.Keyterms) > 0 && !strings.HasPrefix(tOptions.Model, "nova-3") {
if len(tOptions.Keyterm) > 0 && !strings.HasPrefix(tOptions.Model, "nova-3") {
klog.V(1).Info("Keyterms are only supported with nova-3 models.")
return nil, nil
}
Expand Down

0 comments on commit be6bbcf

Please sign in to comment.