#[non_exhaustive]pub struct ChatCompletionMessage {
pub role: String,
pub content: Option<String>,
pub extra: BTreeMap<String, Value>,
}Expand description
EN: Chat completion message returned by the API. 中文:API 返回的 chat completion 消息。
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.role: StringEN: Message role. 中文:消息角色。
content: Option<String>EN: Text content, when returned. 中文:文本内容,如响应中存在。
extra: BTreeMap<String, Value>EN: Additional fields preserved for forward compatibility. 中文:为前向兼容保留的额外字段。
Trait Implementations§
Source§impl Clone for ChatCompletionMessage
impl Clone for ChatCompletionMessage
Source§fn clone(&self) -> ChatCompletionMessage
fn clone(&self) -> ChatCompletionMessage
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 ChatCompletionMessage
impl Debug for ChatCompletionMessage
Source§impl<'de> Deserialize<'de> for ChatCompletionMessage
impl<'de> Deserialize<'de> for ChatCompletionMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ChatCompletionMessage
impl PartialEq for ChatCompletionMessage
Source§fn eq(&self, other: &ChatCompletionMessage) -> bool
fn eq(&self, other: &ChatCompletionMessage) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ChatCompletionMessage
impl Serialize for ChatCompletionMessage
impl StructuralPartialEq for ChatCompletionMessage
Auto Trait Implementations§
impl Freeze for ChatCompletionMessage
impl RefUnwindSafe for ChatCompletionMessage
impl Send for ChatCompletionMessage
impl Sync for ChatCompletionMessage
impl Unpin for ChatCompletionMessage
impl UnsafeUnpin for ChatCompletionMessage
impl UnwindSafe for ChatCompletionMessage
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