From 7d131e1ae478264a44ab34b1819975c50c26a9c6 Mon Sep 17 00:00:00 2001 From: thisislvca Date: Thu, 27 Mar 2025 10:23:08 +0100 Subject: [PATCH 1/5] feat: add nova-3 models and related docs --- src/common/options.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/common/options.rs b/src/common/options.rs index 79e35084..fdbd7c46 100644 --- a/src/common/options.rs +++ b/src/common/options.rs @@ -195,6 +195,19 @@ impl fmt::Display for Endpointing { #[derive(Debug, PartialEq, Eq, Clone, Hash)] #[non_exhaustive] pub enum Model { + /// Recommended for readability and Deepgram's lowest word error rates. + /// + /// Nova-3 represents a significant leap forward in speech AI technology, featuring + /// substantial improvements in accuracy and real-world application capabilities. + /// The model delivers industry-leading performance with a 54.2% reduction in word + /// error rate (WER) for streaming and 47.4% for batch processing compared to competitors. + /// + /// Nova-3 introduces groundbreaking features including real-time multilingual conversation + /// transcription, enhanced comprehension of domain-specific terminology, and optional + /// personal information redaction. It's the first voice AI model to offer self-serve + /// customization, enabling instant vocabulary adaptation without model retraining. + Nova3, + /// Recommended for readability and Deepgram's lowest word error rates. /// Recommended for most use cases. /// @@ -223,6 +236,11 @@ pub enum Model { /// timestamps. Base, + /// Nova-3 model specialized for the medical domain. + /// + /// Optimized for medical terminology and healthcare-specific speech patterns. + Nova3Medical, + #[allow(missing_docs)] Nova2Meeting, @@ -2189,10 +2207,12 @@ impl Serialize for SerializableOptions<'_> { impl AsRef for Model { fn as_ref(&self) -> &str { match self { + Self::Nova3 => "nova-3", Self::Nova2 => "nova-2", Self::Nova => "nova", Self::Enhanced => "enhanced", Self::Base => "base", + Self::Nova3Medical => "nova-3-medical", Self::Nova2Meeting => "nova-2-meeting", Self::Nova2Phonecall => "nova-2-phonecall", Self::Nova2Finance => "nova-2-finance", @@ -2235,10 +2255,12 @@ impl AsRef for Model { impl From for Model { fn from(value: String) -> Self { match &*value { + "nova-3" | "nova-3-general" => Self::Nova3, "nova-2" | "nova-2-general" => Self::Nova2, "nova" | "nova-general" => Self::Nova, "enhanced" | "enhanced-general" => Self::Enhanced, "base" | "base-general" => Self::Base, + "nova-3-medical" => Self::Nova3Medical, "nova-2-meeting" => Self::Nova2Meeting, "nova-2-phonecall" => Self::Nova2Phonecall, "nova-2-finance" => Self::Nova2Finance, From fb0cffccf51777a8da08cd3760df9339f9b88734 Mon Sep 17 00:00:00 2001 From: thisislvca Date: Thu, 27 Mar 2025 10:35:49 +0100 Subject: [PATCH 2/5] chore: add deprecation warnings to models listed as legacy --- src/common/options.rs | 96 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 90 insertions(+), 6 deletions(-) diff --git a/src/common/options.rs b/src/common/options.rs index fdbd7c46..b0552d8a 100644 --- a/src/common/options.rs +++ b/src/common/options.rs @@ -226,14 +226,26 @@ pub enum Model { /// automatic speech-to-text model to date. Nova doesn't just excel in one /// specific domain — it is ideal for a wide array of voice applications /// that require high accuracy in diverse contexts. See the benchmarks. + #[deprecated( + since = "0.6.7", + note = "Legacy model. Consider using Model::Nova3 instead for better performance." + )] Nova, /// Recommended for lower word error rates than Base, high accuracy /// timestamps, and use cases that require keyword boosting. + #[deprecated( + since = "0.6.7", + note = "Legacy model. Consider using Model::Nova3 instead for better performance." + )] Enhanced, /// Recommended for large transcription volumes and high accuracy /// timestamps. + #[deprecated( + since = "0.6.7", + note = "Legacy model. Consider using Model::Nova3 instead for better performance." + )] Base, /// Nova-3 model specialized for the medical domain. @@ -269,36 +281,80 @@ pub enum Model { Nova2Automotive, #[allow(missing_docs)] + #[deprecated( + since = "0.6.7", + note = "Legacy model. Consider using Model::Nova3 or a specialized Nova2 model instead." + )] NovaPhonecall, #[allow(missing_docs)] + #[deprecated( + since = "0.6.7", + note = "Legacy model. Consider using Model::Nova3Medical instead." + )] NovaMedical, #[allow(missing_docs)] + #[deprecated( + since = "0.6.7", + note = "Legacy model. Consider using Model::Nova2Meeting instead." + )] EnhancedMeeting, #[allow(missing_docs)] + #[deprecated( + since = "0.6.7", + note = "Legacy model. Consider using Model::Nova2Phonecall instead." + )] EnhancedPhonecall, #[allow(missing_docs)] + #[deprecated( + since = "0.6.7", + note = "Legacy model. Consider using Model::Nova2Finance instead." + )] EnhancedFinance, #[allow(missing_docs)] + #[deprecated( + since = "0.6.7", + note = "Legacy model. Consider using Model::Nova2Meeting instead." + )] BaseMeeting, #[allow(missing_docs)] + #[deprecated( + since = "0.6.7", + note = "Legacy model. Consider using Model::Nova2Phonecall instead." + )] BasePhonecall, #[allow(missing_docs)] + #[deprecated( + since = "0.6.7", + note = "Legacy model. Consider using Model::Nova2Voicemail instead." + )] BaseVoicemail, #[allow(missing_docs)] + #[deprecated( + since = "0.6.7", + note = "Legacy model. Consider using Model::Nova2Finance instead." + )] BaseFinance, #[allow(missing_docs)] + #[deprecated( + since = "0.6.7", + note = "Legacy model. Consider using Model::Nova2Conversationalai instead." + )] BaseConversationalai, #[allow(missing_docs)] + #[deprecated( + since = "0.6.7", + note = "Legacy model. Consider using Model::Nova2Video instead." + )] BaseVideo, #[deprecated( @@ -2209,9 +2265,6 @@ impl AsRef for Model { match self { Self::Nova3 => "nova-3", Self::Nova2 => "nova-2", - Self::Nova => "nova", - Self::Enhanced => "enhanced", - Self::Base => "base", Self::Nova3Medical => "nova-3-medical", Self::Nova2Meeting => "nova-2-meeting", Self::Nova2Phonecall => "nova-2-phonecall", @@ -2222,16 +2275,33 @@ impl AsRef for Model { Self::Nova2Medical => "nova-2-medical", Self::Nova2Drivethru => "nova-2-drivethru", Self::Nova2Automotive => "nova-2-automotive", + #[allow(deprecated)] + Self::Nova => "nova", + #[allow(deprecated)] + Self::Enhanced => "enhanced", + #[allow(deprecated)] + Self::Base => "base", + #[allow(deprecated)] Self::NovaPhonecall => "nova-phonecall", + #[allow(deprecated)] Self::NovaMedical => "nova-medical", + #[allow(deprecated)] Self::EnhancedMeeting => "enhanced-meeting", + #[allow(deprecated)] Self::EnhancedPhonecall => "enhanced-phonecall", + #[allow(deprecated)] Self::EnhancedFinance => "enhanced-finance", + #[allow(deprecated)] Self::BaseMeeting => "base-meeting", + #[allow(deprecated)] Self::BasePhonecall => "base-phonecall", + #[allow(deprecated)] Self::BaseVoicemail => "base-voicemail", + #[allow(deprecated)] Self::BaseFinance => "base-finance", + #[allow(deprecated)] Self::BaseConversationalai => "base-conversationalai", + #[allow(deprecated)] Self::BaseVideo => "base-video", #[allow(deprecated)] Self::General => "general", @@ -2257,9 +2327,6 @@ impl From for Model { match &*value { "nova-3" | "nova-3-general" => Self::Nova3, "nova-2" | "nova-2-general" => Self::Nova2, - "nova" | "nova-general" => Self::Nova, - "enhanced" | "enhanced-general" => Self::Enhanced, - "base" | "base-general" => Self::Base, "nova-3-medical" => Self::Nova3Medical, "nova-2-meeting" => Self::Nova2Meeting, "nova-2-phonecall" => Self::Nova2Phonecall, @@ -2270,16 +2337,33 @@ impl From for Model { "nova-2-medical" => Self::Nova2Medical, "nova-2-drivethru" => Self::Nova2Drivethru, "nova-2-automotive" => Self::Nova2Automotive, + #[allow(deprecated)] + "nova" | "nova-general" => Self::Nova, + #[allow(deprecated)] + "enhanced" | "enhanced-general" => Self::Enhanced, + #[allow(deprecated)] + "base" | "base-general" => Self::Base, + #[allow(deprecated)] "nova-phonecall" => Self::NovaPhonecall, + #[allow(deprecated)] "nova-medical" => Self::NovaMedical, + #[allow(deprecated)] "enhanced-meeting" => Self::EnhancedMeeting, + #[allow(deprecated)] "enhanced-phonecall" => Self::EnhancedPhonecall, + #[allow(deprecated)] "enhanced-finance" => Self::EnhancedFinance, + #[allow(deprecated)] "base-meeting" => Self::BaseMeeting, + #[allow(deprecated)] "base-phonecall" => Self::BasePhonecall, + #[allow(deprecated)] "base-voicemail" => Self::BaseVoicemail, + #[allow(deprecated)] "base-finance" => Self::BaseFinance, + #[allow(deprecated)] "base-conversationalai" => Self::BaseConversationalai, + #[allow(deprecated)] "base-video" => Self::BaseVideo, #[allow(deprecated)] "general" => Self::General, From da4c836a6187262c0e0d5efce066fb29e1b2172f Mon Sep 17 00:00:00 2001 From: thisislvca Date: Thu, 27 Mar 2025 10:37:49 +0100 Subject: [PATCH 3/5] chore(test): update model references in tests to non-legacy models --- src/common/options.rs | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/common/options.rs b/src/common/options.rs index b0552d8a..e5852425 100644 --- a/src/common/options.rs +++ b/src/common/options.rs @@ -2587,18 +2587,18 @@ mod models_to_string_tests { #[test] fn one() { - assert_eq!(models_to_string(&[Model::Base]), "base"); + assert_eq!(models_to_string(&[Model::Nova3]), "nova-3"); } #[test] fn many() { assert_eq!( models_to_string(&[ - Model::BasePhonecall, - Model::BaseMeeting, - Model::BaseVoicemail + Model::Nova2Phonecall, + Model::Nova2Meeting, + Model::Nova2Voicemail ]), - "base-phonecall:base-meeting:base-voicemail" + "nova-2-phonecall:nova-2-meeting:nova-2-voicemail" ); } @@ -2606,11 +2606,11 @@ mod models_to_string_tests { fn custom() { assert_eq!( models_to_string(&[ - Model::EnhancedFinance, + Model::Nova2Finance, Model::CustomId(String::from("extra_crispy")), Model::Nova2Conversationalai, ]), - "enhanced-finance:extra_crispy:nova-2-conversationalai" + "nova-2-finance:extra_crispy:nova-2-conversationalai" ); } } @@ -2672,7 +2672,7 @@ mod serialize_options_tests { #[test] fn all_options() { let options = Options::builder() - .model(Model::Base) + .model(Model::Nova3) .version("1.2.3") .language(Language::en) .detect_language(DetectLanguage::Restricted(vec![Language::en, Language::es])) @@ -2683,7 +2683,7 @@ mod serialize_options_tests { .diarize_version("2021-07-14.0") .ner(true) .multichannel_with_models([ - Model::EnhancedFinance, + Model::Nova2Finance, Model::CustomId(String::from("extra_crispy")), Model::Nova2Conversationalai, ]) @@ -2720,12 +2720,15 @@ mod serialize_options_tests { .callback_method(CallbackMethod::PUT) .build(); - check_serialization(&options, "model=enhanced-finance%3Aextra_crispy%3Anova-2-conversationalai&version=1.2.3&language=en&detect_language=en&detect_language=es&punctuate=true&profanity_filter=true&redact=pci&redact=ssn&diarize=true&diarize_version=2021-07-14.0&ner=true&multichannel=true&alternatives=4&numerals=true&search=Rust&search=Deepgram&replace=Aaron%3AErin&keywords=Ferris&keywords=Cargo%3A-1.5&utterances=true&utt_split=0.9&tag=Tag+1&encoding=linear16&smart_format=true&filler_words=true¶graphs=true&detect_entities=true&intents=true&custom_intent_mode=extended&custom_intent=Phone+repair&custom_intent=Phone+cancellation&sentiment=true&topics=true&custom_topic_mode=strict&custom_topic=Get+support&custom_topic=Complain&summarize=v2&dictation=true&measurements=true&extra=key%3Avalue&callback_method=put"); + check_serialization(&options, "model=nova-2-finance%3Aextra_crispy%3Anova-2-conversationalai&version=1.2.3&language=en&detect_language=en&detect_language=es&punctuate=true&profanity_filter=true&redact=pci&redact=ssn&diarize=true&diarize_version=2021-07-14.0&ner=true&multichannel=true&alternatives=4&numerals=true&search=Rust&search=Deepgram&replace=Aaron%3AErin&keywords=Ferris&keywords=Cargo%3A-1.5&utterances=true&utt_split=0.9&tag=Tag+1&encoding=linear16&smart_format=true&filler_words=true¶graphs=true&detect_entities=true&intents=true&custom_intent_mode=extended&custom_intent=Phone+repair&custom_intent=Phone+cancellation&sentiment=true&topics=true&custom_topic_mode=strict&custom_topic=Get+support&custom_topic=Complain&summarize=v2&dictation=true&measurements=true&extra=key%3Avalue&callback_method=put"); } #[test] fn model() { - check_serialization(&Options::builder().model(Model::Base).build(), "model=base"); + check_serialization( + &Options::builder().model(Model::Nova3).build(), + "model=nova-3", + ); check_serialization( &Options::builder() @@ -2842,12 +2845,12 @@ mod serialize_options_tests { check_serialization( &Options::builder() .multichannel_with_models([ - Model::EnhancedFinance, + Model::Nova2Finance, Model::CustomId(String::from("extra_crispy")), Model::Nova2Conversationalai, ]) .build(), - "model=enhanced-finance%3Aextra_crispy%3Anova-2-conversationalai&multichannel=true", + "model=nova-2-finance%3Aextra_crispy%3Anova-2-conversationalai&multichannel=true", ); } From 1375e178642818c90a40d70d78d9eecbec2f137d Mon Sep 17 00:00:00 2001 From: thisislvca Date: Tue, 15 Apr 2025 23:56:47 +0200 Subject: [PATCH 4/5] fix: remove duplicate nova3 (added by deepgram team directly) --- src/common/options.rs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/common/options.rs b/src/common/options.rs index 1aab85ba..8fead1b6 100644 --- a/src/common/options.rs +++ b/src/common/options.rs @@ -207,19 +207,6 @@ pub enum Model { /// punctuation, and capitalization and Keyterms. Nova3, - /// Recommended for readability and Deepgram's lowest word error rates. - /// - /// Nova-3 represents a significant leap forward in speech AI technology, featuring - /// substantial improvements in accuracy and real-world application capabilities. - /// The model delivers industry-leading performance with a 54.2% reduction in word - /// error rate (WER) for streaming and 47.4% for batch processing compared to competitors. - /// - /// Nova-3 introduces groundbreaking features including real-time multilingual conversation - /// transcription, enhanced comprehension of domain-specific terminology, and optional - /// personal information redaction. It's the first voice AI model to offer self-serve - /// customization, enabling instant vocabulary adaptation without model retraining. - Nova3, - /// Recommended for readability and Deepgram's lowest word error rates. /// Recommended for most use cases. /// From a0abaf4416249e79d506240a7a28cd60295f408c Mon Sep 17 00:00:00 2001 From: thisislvca Date: Tue, 15 Apr 2025 23:57:38 +0200 Subject: [PATCH 5/5] chore: change deprecated since to 0.6.8, the upcoming release number --- src/common/options.rs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/common/options.rs b/src/common/options.rs index 8fead1b6..50194299 100644 --- a/src/common/options.rs +++ b/src/common/options.rs @@ -226,7 +226,7 @@ pub enum Model { /// specific domain — it is ideal for a wide array of voice applications /// that require high accuracy in diverse contexts. See the benchmarks. #[deprecated( - since = "0.6.7", + since = "0.6.8", note = "Legacy model. Consider using Model::Nova3 instead for better performance." )] Nova, @@ -234,7 +234,7 @@ pub enum Model { /// Recommended for lower word error rates than Base, high accuracy /// timestamps, and use cases that require keyword boosting. #[deprecated( - since = "0.6.7", + since = "0.6.8", note = "Legacy model. Consider using Model::Nova3 instead for better performance." )] Enhanced, @@ -242,7 +242,7 @@ pub enum Model { /// Recommended for large transcription volumes and high accuracy /// timestamps. #[deprecated( - since = "0.6.7", + since = "0.6.8", note = "Legacy model. Consider using Model::Nova3 instead for better performance." )] Base, @@ -281,77 +281,77 @@ pub enum Model { #[allow(missing_docs)] #[deprecated( - since = "0.6.7", + since = "0.6.8", note = "Legacy model. Consider using Model::Nova3 or a specialized Nova2 model instead." )] NovaPhonecall, #[allow(missing_docs)] #[deprecated( - since = "0.6.7", + since = "0.6.8", note = "Legacy model. Consider using Model::Nova3Medical instead." )] NovaMedical, #[allow(missing_docs)] #[deprecated( - since = "0.6.7", + since = "0.6.8", note = "Legacy model. Consider using Model::Nova2Meeting instead." )] EnhancedMeeting, #[allow(missing_docs)] #[deprecated( - since = "0.6.7", + since = "0.6.8", note = "Legacy model. Consider using Model::Nova2Phonecall instead." )] EnhancedPhonecall, #[allow(missing_docs)] #[deprecated( - since = "0.6.7", + since = "0.6.8", note = "Legacy model. Consider using Model::Nova2Finance instead." )] EnhancedFinance, #[allow(missing_docs)] #[deprecated( - since = "0.6.7", + since = "0.6.8", note = "Legacy model. Consider using Model::Nova2Meeting instead." )] BaseMeeting, #[allow(missing_docs)] #[deprecated( - since = "0.6.7", + since = "0.6.8", note = "Legacy model. Consider using Model::Nova2Phonecall instead." )] BasePhonecall, #[allow(missing_docs)] #[deprecated( - since = "0.6.7", + since = "0.6.8", note = "Legacy model. Consider using Model::Nova2Voicemail instead." )] BaseVoicemail, #[allow(missing_docs)] #[deprecated( - since = "0.6.7", + since = "0.6.8", note = "Legacy model. Consider using Model::Nova2Finance instead." )] BaseFinance, #[allow(missing_docs)] #[deprecated( - since = "0.6.7", + since = "0.6.8", note = "Legacy model. Consider using Model::Nova2Conversationalai instead." )] BaseConversationalai, #[allow(missing_docs)] #[deprecated( - since = "0.6.7", + since = "0.6.8", note = "Legacy model. Consider using Model::Nova2Video instead." )] BaseVideo,