pub struct Prompt { /* private fields */ }Expand description
Send a single user string per request, or call Prompt::list_models.
For chat history or custom ResponseRequest bodies, use
Prompt::client or Prompt::into_client.
Implementations§
Source§impl Prompt
impl Prompt
pub fn model(self, model: impl Into<String>) -> Self
pub fn max_output_tokens(self, max: u32) -> Self
pub async fn send(&self, prompt: impl Into<String>) -> Result<Response>
pub async fn stream<F>( &self, prompt: impl Into<String>, on_event: F, ) -> Result<Response>
pub async fn list_models(&self) -> Result<Vec<ModelInfo>>
pub fn client(&self) -> &Client
pub fn into_client(self) -> Client
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Prompt
impl !RefUnwindSafe for Prompt
impl Send for Prompt
impl Sync for Prompt
impl Unpin for Prompt
impl UnsafeUnpin for Prompt
impl !UnwindSafe for Prompt
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