pub struct AIRequest { /* private fields */ }Expand description
Request builder for AI operations
Implementations§
Source§impl AIRequest
impl AIRequest
Sourcepub fn with_model(self, model: ModelType) -> Self
pub fn with_model(self, model: ModelType) -> Self
Set the AI model to use
Sourcepub fn with_temperature(self, temperature: f32) -> Self
pub fn with_temperature(self, temperature: f32) -> Self
Set the temperature for generation
Sourcepub fn with_max_tokens(self, max_tokens: u32) -> Self
pub fn with_max_tokens(self, max_tokens: u32) -> Self
Set maximum tokens to generate
Sourcepub fn with_context<S: Into<String>>(self, context: S) -> Self
pub fn with_context<S: Into<String>>(self, context: S) -> Self
Add context to the request
Sourcepub fn with_system_prompt<S: Into<String>>(self, system_prompt: S) -> Self
pub fn with_system_prompt<S: Into<String>>(self, system_prompt: S) -> Self
Set system prompt
Sourcepub async fn execute(self) -> Result<AIResponse>
pub async fn execute(self) -> Result<AIResponse>
Execute the AI request
Auto Trait Implementations§
impl Freeze for AIRequest
impl !RefUnwindSafe for AIRequest
impl Send for AIRequest
impl Sync for AIRequest
impl Unpin for AIRequest
impl !UnwindSafe for AIRequest
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