pub struct GemSessionBuilder(/* private fields */);
Expand description
Builder for creating a GemSession
with custom configurations.
Implementations§
Source§impl GemSessionBuilder
impl GemSessionBuilder
Sourcepub fn new() -> GemSessionBuilder
pub fn new() -> GemSessionBuilder
Creates a new GemSessionBuilder
with default settings.
Sourcepub fn default(api_key: String) -> GemSession
pub fn default(api_key: String) -> GemSession
Creates a default GemSession
with the provided API key.
Sourcepub fn timeout(self, timeout: Option<Duration>) -> Self
pub fn timeout(self, timeout: Option<Duration>) -> Self
Sets the timeout for API requests. By default, the timeout is none. When ‘timeout’ is set, ‘read_timeout’ is ignored according to the reqwest docs. Use for non-streaming requests. otherwise, the stream will be closed after the timeout even if the server is still responding.
Sourcepub fn custom_model(self, model: String) -> Self
pub fn custom_model(self, model: String) -> Self
Sets a custom model to use for the session.
Sourcepub fn connect_timeout(self, connect_timeout: Duration) -> Self
pub fn connect_timeout(self, connect_timeout: Duration) -> Self
Sets the connection timeout for API requests.
Sourcepub fn read_timeout(self, read_timeout: Duration) -> Self
pub fn read_timeout(self, read_timeout: Duration) -> Self
Sets the read timeout for API requests. When ‘timeout’ is set, ‘read_timeout’ is ignored according to the reqwest docs.
Sourcepub fn build(self) -> GemSession
pub fn build(self) -> GemSession
Builds a GemSession
with the configured settings and provided API key.
Auto Trait Implementations§
impl Freeze for GemSessionBuilder
impl RefUnwindSafe for GemSessionBuilder
impl Send for GemSessionBuilder
impl Sync for GemSessionBuilder
impl Unpin for GemSessionBuilder
impl UnwindSafe for GemSessionBuilder
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