pub struct DirectRequest {
pub model: String,
pub model_variant: Option<String>,
pub messages: Vec<DirectMessage>,
pub attachments: Vec<LlmAttachment>,
pub output: DirectOutputSpec,
pub generation: GenerationOptions,
pub stream_events: Option<LlmEventSender>,
pub session_id: Option<String>,
pub caused_by: Option<CausalRef>,
pub replay: Option<RuntimeReplay>,
}Fields§
§model: String§model_variant: Option<String>§messages: Vec<DirectMessage>§attachments: Vec<LlmAttachment>§output: DirectOutputSpec§generation: GenerationOptions§stream_events: Option<LlmEventSender>§session_id: Option<String>§caused_by: Option<CausalRef>§replay: Option<RuntimeReplay>Implementations§
Source§impl DirectRequest
impl DirectRequest
pub fn text( model: impl Into<String>, prompt: impl Into<String>, ) -> DirectRequest
pub fn json( model: impl Into<String>, prompt: impl Into<String>, ) -> DirectRequest
pub fn json_schema( model: impl Into<String>, prompt: impl Into<String>, schema: DirectJsonSchema, ) -> DirectRequest
pub fn with_replay_key(self, key: impl Into<String>) -> DirectRequest
pub fn with_caused_by(self, caused_by: CausalRef) -> DirectRequest
Trait Implementations§
Source§impl Clone for DirectRequest
impl Clone for DirectRequest
Source§fn clone(&self) -> DirectRequest
fn clone(&self) -> DirectRequest
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 DirectRequest
impl Debug for DirectRequest
Source§impl<'de> Deserialize<'de> for DirectRequest
impl<'de> Deserialize<'de> for DirectRequest
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DirectRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DirectRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for DirectRequest
impl Serialize for DirectRequest
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
Auto Trait Implementations§
impl !RefUnwindSafe for DirectRequest
impl !UnwindSafe for DirectRequest
impl Freeze for DirectRequest
impl Send for DirectRequest
impl Sync for DirectRequest
impl Unpin for DirectRequest
impl UnsafeUnpin for DirectRequest
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