pub struct TaskChat {
pub system: Option<String>,
pub history: Option<Vec<Interaction>>,
pub schema: Option<Value>,
pub prompt: String,
}Expand description
Chat inputs encoded in Task::contents.
Fields§
§system: Option<String>Optional system instruction prepended to the model’s messages.
history: Option<Vec<Interaction>>Previous turns; system entries are ignored by the API executor.
schema: Option<Value>Strict output schema requested from the endpoint, not checked locally.
prompt: StringCurrent prompt, sent as a user message after any prior history.
Implementations§
Source§impl TaskChat
impl TaskChat
Sourcepub fn new<P: ToString>(prompt: P) -> Self
pub fn new<P: ToString>(prompt: P) -> Self
Creates chat inputs with a prompt and no system, history, or schema.
Sourcepub fn with_system<S: ToString>(self, system: S) -> Self
pub fn with_system<S: ToString>(self, system: S) -> Self
Sets the system instruction, independently of any history entries.
Sourcepub fn with_schema<S: Serialize>(self, schema: S) -> Self
pub fn with_schema<S: Serialize>(self, schema: S) -> Self
Sets a strict output schema without checking its validity.
§Panics
Panics if the schema cannot be serialized as JSON.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TaskChat
impl<'de> Deserialize<'de> for TaskChat
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
impl Eq for TaskChat
impl StructuralPartialEq for TaskChat
Auto Trait Implementations§
impl Freeze for TaskChat
impl RefUnwindSafe for TaskChat
impl Send for TaskChat
impl Sync for TaskChat
impl Unpin for TaskChat
impl UnsafeUnpin for TaskChat
impl UnwindSafe for TaskChat
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