pub struct Message {
pub role: String,
pub content: Option<String>,
pub name: Option<String>,
pub function_call: Option<Value>,
}
Fields§
§role: String
The role of the messages author. One of system
, user
, assistant
or function
.
content: Option<String>
The contents of the message. content
is required for
all messages except assistant messages with function calls.
name: Option<String>
The name of the author of this message. name
is required if role is function
,
and it should be the name of the function whose response is in the content
.
May contain a-z, A-Z, 0-9, and underscores, with a maximum length of 64 characters.
function_call: Option<Value>
The name and arguments of a function that should be called, as generated by the model.
Now this optional field dont support in this crate.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
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
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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