pub struct ResponsesApi { /* private fields */ }Expand description
API for creating model responses.
Implementations§
Source§impl ResponsesApi
impl ResponsesApi
Sourcepub fn create(&self, model: impl Into<String>) -> CreateResponseBuilder
pub fn create(&self, model: impl Into<String>) -> CreateResponseBuilder
Create a new response request builder.
§Example
use xai_rust::{XaiClient, Role};
let client = XaiClient::from_env()?;
let response = client.responses()
.create("grok-4")
.message(Role::System, "You are a helpful assistant.")
.message(Role::User, "Hello!")
.temperature(0.7)
.send()
.await?;Sourcepub fn deferred(&self, response_id: impl Into<String>) -> DeferredResponsePoller
pub fn deferred(&self, response_id: impl Into<String>) -> DeferredResponsePoller
Create a deferred response poller.
Trait Implementations§
Source§impl Clone for ResponsesApi
impl Clone for ResponsesApi
Source§fn clone(&self) -> ResponsesApi
fn clone(&self) -> ResponsesApi
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ResponsesApi
impl !RefUnwindSafe for ResponsesApi
impl Send for ResponsesApi
impl Sync for ResponsesApi
impl Unpin for ResponsesApi
impl UnsafeUnpin for ResponsesApi
impl !UnwindSafe for ResponsesApi
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