diff --git a/CHANGELOG.md b/CHANGELOG.md index 41159171..f158fe65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,90 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.6.0] - 2024-07-23 + +### Migrating from 0.4.0 -> 0.6.0 + +Module Imports + +``` +use deepgram::{ +--- transcription::prerecorded::{ ++++ common::{ + audio_source::AudioSource, + options::{Language, Options}, + }, + Deepgram, DeepgramError, +}; +``` + +Streaming Changes + +Now you can pass Options using stream_request_with_options +``` +let options = Options::builder() + .smart_format(true) + .language(Language::en_US) + .build(); + +let mut results = dg + .transcription() + .stream_request_with_options(Some(&options)) + .file(PATH_TO_FILE, AUDIO_CHUNK_SIZE, Duration::from_millis(16)) + .await? + .start() + .await?; +``` + +### Changed + +- Add streaming features +- Add support for pre-recorded features when streaming +- Add Speech to Text +- Refactor Code + +Note that this modifies some public enum's which are used internally but might need to be taken into account +- Bumped the minor version but it might need a major bump? +- Maybe a 1.0.0 release? + +### Streaming Features +- endpointing +- utterance_end_ms +- interim_results +- no_delay +- vad_events + +### Streaming Functions +- keep_alive + +### New Streaming Message Types +- Utterance End +- Speech Started + +### Pre-Recorded Features +- encoding +- smart_format +- callback +- callback_method +- filler_words +- paragraphs +- diarize_version +- dictation +- measurements +- extra + +### Pre-Recorded Audio Intelligence Features +- detect_entities +- sentiment +- topics +- summarize +- intents +- custom_intents +- custom_intent_mode +- topics +- custom_topics +- custom_topic_mode + ## [Unreleased] - Deprecate tiers and add explicit support for all currently available models. - Expand language enum to include all currently-supported languages. diff --git a/src/common/options.rs b/src/common/options.rs index a826f1e8..f9fc296e 100644 --- a/src/common/options.rs +++ b/src/common/options.rs @@ -603,13 +603,17 @@ pub struct Keyword { #[non_exhaustive] pub enum Utterances { #[allow(missing_docs)] - Enabled { - #[allow(missing_docs)] - utt_split: Option, - }, + Enabled, #[allow(missing_docs)] Disabled, + + + #[allow(missing_docs)] + CustomSplit { + #[allow(missing_docs)] + utt_split: Option, + }, } /// Used as a parameter for [`OptionsBuilder::multichannel`]. @@ -1385,7 +1389,7 @@ impl OptionsBuilder { /// ``` pub fn utterances(mut self, utterances: bool) -> Self { self.0.utterances = Some(if utterances { - Utterances::Enabled { utt_split: None } + Utterances::Enabled } else { Utterances::Disabled }); @@ -1413,7 +1417,7 @@ impl OptionsBuilder { /// .build(); /// ``` pub fn utterances_with_utt_split(mut self, utt_split: f64) -> Self { - self.0.utterances = Some(Utterances::Enabled { + self.0.utterances = Some(Utterances::CustomSplit { utt_split: Some(utt_split), }); self @@ -2061,7 +2065,8 @@ impl Serialize for SerializableOptions<'_> { match utterances { Some(Utterances::Disabled) => seq.serialize_element(&("utterances", false))?, - Some(Utterances::Enabled { utt_split }) => { + Some(Utterances::Enabled) => seq.serialize_element(&("utterances", true))?, + Some(Utterances::CustomSplit { utt_split }) => { seq.serialize_element(&("utterances", true))?; if let Some(utt_split) = utt_split {