pub struct RunAgentConfig {
pub api_key: Option<String>,
pub base_url: Option<String>,
pub enable_logging: bool,
}Expand description
Configuration builder for the RunAgent SDK
Provides a fluent interface for configuring the SDK with various options including API keys, base URLs, and logging.
§Example
use runagent::RunAgentConfig;
let config = RunAgentConfig::new()
.with_api_key("your-api-key")
.with_base_url("https://api.runagent.ai")
.with_logging()
.build();Fields§
§api_key: Option<String>Optional API key for authentication
base_url: Option<String>Base URL for API endpoints
enable_logging: boolWhether to enable logging
Implementations§
Source§impl RunAgentConfig
impl RunAgentConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new configuration builder
§Example
use runagent::RunAgentConfig;
let config = RunAgentConfig::new();Sourcepub fn with_api_key<S: Into<String>>(self, api_key: S) -> Self
pub fn with_api_key<S: Into<String>>(self, api_key: S) -> Self
Sourcepub fn with_base_url<S: Into<String>>(self, base_url: S) -> Self
pub fn with_base_url<S: Into<String>>(self, base_url: S) -> Self
Sourcepub fn with_logging(self) -> Self
pub fn with_logging(self) -> Self
Enable logging initialization
When enabled, the build() method will automatically initialize
the logging system.
§Example
use runagent::RunAgentConfig;
let config = RunAgentConfig::new().with_logging();Trait Implementations§
Source§impl Default for RunAgentConfig
impl Default for RunAgentConfig
Source§fn default() -> RunAgentConfig
fn default() -> RunAgentConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RunAgentConfig
impl RefUnwindSafe for RunAgentConfig
impl Send for RunAgentConfig
impl Sync for RunAgentConfig
impl Unpin for RunAgentConfig
impl UnwindSafe for RunAgentConfig
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more