pub struct ImagesApi { /* private fields */ }Expand description
Images API for generating images.
Implementations§
Source§impl ImagesApi
impl ImagesApi
Sourcepub fn generate(
&self,
model: impl Into<String>,
prompt: impl Into<String>,
) -> ImageGenerationBuilder
pub fn generate( &self, model: impl Into<String>, prompt: impl Into<String>, ) -> ImageGenerationBuilder
Create an image generation request.
§Example
use xai_rust::XaiClient;
let client = XaiClient::from_env()?;
let response = client.images()
.generate("grok-2-image", "A cat in a tree")
.send()
.await?;
if let Some(url) = response.first_url() {
println!("Image URL: {}", url);
}Trait Implementations§
Auto Trait Implementations§
impl Freeze for ImagesApi
impl !RefUnwindSafe for ImagesApi
impl Send for ImagesApi
impl Sync for ImagesApi
impl Unpin for ImagesApi
impl UnsafeUnpin for ImagesApi
impl !UnwindSafe for ImagesApi
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