#[non_exhaustive]pub enum SpeechTranslationStreamPart {
StreamStart {
warnings: Vec<Warning>,
},
Audio {
id: Option<String>,
audio: Bytes,
provider_metadata: Option<BTreeMap<String, Map<String, Value>>>,
},
OutputTextDelta {
id: Option<String>,
delta: String,
provider_metadata: Option<BTreeMap<String, Map<String, Value>>>,
},
OutputTextFinal {
id: Option<String>,
text: String,
provider_metadata: Option<BTreeMap<String, Map<String, Value>>>,
},
SourceTranscriptDelta {
id: Option<String>,
delta: String,
provider_metadata: Option<BTreeMap<String, Map<String, Value>>>,
},
SourceTranscriptPartial {
id: Option<String>,
text: String,
start_second: Option<f64>,
end_second: Option<f64>,
channel_index: Option<u32>,
provider_metadata: Option<BTreeMap<String, Map<String, Value>>>,
},
SourceTranscriptFinal {
id: Option<String>,
text: String,
start_second: Option<f64>,
end_second: Option<f64>,
channel_index: Option<u32>,
provider_metadata: Option<BTreeMap<String, Map<String, Value>>>,
},
ResponseMetadata {
timestamp: Option<DateTime<Utc>>,
model_id: Option<ModelId>,
headers: Option<Headers>,
body: Option<Value>,
},
Finish {
source_text: String,
output_text: String,
duration_in_seconds: Option<f64>,
usage: Option<SpeechTranslationUsage>,
provider_metadata: Option<BTreeMap<String, Map<String, Value>>>,
},
Raw {
raw_value: Value,
},
Error {
error: StreamError,
},
}Expand description
A part of a speech translation stream, tagged by type.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
StreamStart
First part of every stream.
Audio
Translated audio chunk.
Fields
OutputTextDelta
Translated text increment.
Fields
OutputTextFinal
Final translated text for a part.
Fields
SourceTranscriptDelta
Source transcript increment.
Fields
SourceTranscriptPartial
Interim source transcript.
Fields
SourceTranscriptFinal
Final source transcript segment.
Fields
ResponseMetadata
Response metadata.
Fields
Finish
Last part of a successful stream.
Fields
§
usage: Option<SpeechTranslationUsage>Usage.
Raw
A raw provider chunk.
Error
An error; the stream ends after this part.
Fields
§
error: StreamErrorThe error.
Trait Implementations§
Source§impl Clone for SpeechTranslationStreamPart
impl Clone for SpeechTranslationStreamPart
Source§fn clone(&self) -> SpeechTranslationStreamPart
fn clone(&self) -> SpeechTranslationStreamPart
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SpeechTranslationStreamPart
impl Debug for SpeechTranslationStreamPart
Source§impl<'de> Deserialize<'de> for SpeechTranslationStreamPart
impl<'de> Deserialize<'de> for SpeechTranslationStreamPart
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SpeechTranslationStreamPart, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SpeechTranslationStreamPart, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for SpeechTranslationStreamPart
impl Serialize for SpeechTranslationStreamPart
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for SpeechTranslationStreamPart
Auto Trait Implementations§
impl !Freeze for SpeechTranslationStreamPart
impl RefUnwindSafe for SpeechTranslationStreamPart
impl Send for SpeechTranslationStreamPart
impl Sync for SpeechTranslationStreamPart
impl Unpin for SpeechTranslationStreamPart
impl UnsafeUnpin for SpeechTranslationStreamPart
impl UnwindSafe for SpeechTranslationStreamPart
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more