Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cmd/transcribe.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ var transcribeCmd = &cobra.Command{
}
params.SummaryModel = summaryModel
}

speechModel, _ := cmd.Flags().GetString("speech_model")
params.SpeechModel = &speechModel
}

if params.RedactPii {
Expand Down Expand Up @@ -278,6 +281,7 @@ func init() {
transcribeCmd.PersistentFlags().StringP("webhook_url", "w", "", "Receive a webhook once your transcript is complete.")
transcribeCmd.PersistentFlags().StringP("word_boost", "k", "", "The value of this flag MUST be used surrounded by quotes. Any term included will have its likelihood of being transcribed boosted.")
transcribeCmd.PersistentFlags().StringP("summary_model", "q", "informative", "The model used to generate the summary.")
transcribeCmd.PersistentFlags().StringP("speech_model", "", "", "The speech model to use for the transcription. Allowed values: see https://www.assemblyai.com/docs/api-reference/transcripts/submit#request.body.speech_model")

transcribeCmd.Flags().Bool("test", false, "Flag for test executing purpose")
transcribeCmd.Flags().MarkHidden("test")
Expand Down
4 changes: 4 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func TestTranscribeWithFlags(t *testing.T) {
"--speaker_labels",
"--summarization",
"--topic_detection",
"--speech_model=nano",
"-p=false",
"-j",
"--test",
Expand Down Expand Up @@ -147,6 +148,9 @@ func TestTranscribeWithFlags(t *testing.T) {
if *result.IabCategories != true {
t.Errorf("Expected IAB Categories(Topic detection) true, got false.")
}
if result.SpeechModel == nil || *result.SpeechModel != "nano" {
t.Errorf("Expected speech_model to be 'nano', got '%v'.", result.SpeechModel)
}
}

func TestTranscribeRestrictions(t *testing.T) {
Expand Down
2 changes: 2 additions & 0 deletions schemas/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ type TranscriptResponse struct {
SentimentAnalysis *bool `json:"sentiment_analysis,omitempty"`
SentimentAnalysisResults *[]SentimentAnalysisResult `json:"sentiment_analysis_results,omitempty"`
SpeakerLabels bool `json:"speaker_labels,omitempty"`
SpeechModel *string `json:"speech_model,omitempty"`
SpeedBoost *bool `json:"speed_boost,omitempty"`
Status *string `json:"status,omitempty"`
Summarization *bool `json:"summarization,omitempty"`
Expand Down Expand Up @@ -208,6 +209,7 @@ type TranscribeParams struct {
WebhookAuthHeaderValue string `json:"webhook_auth_header_value,omitempty"`
WebhookURL string `json:"webhook_url,omitempty"`
WordBoost []string `json:"word_boost,omitempty"`
SpeechModel *string `json:"speech_model,omitempty"`
}

type CustomSpelling struct {
Expand Down