pub struct ComposioConfig {
pub api_key: String,
pub base_url: String,
pub timeout: Duration,
pub retry_policy: RetryPolicy,
pub toolkit_versions: Option<ToolkitVersionParam>,
pub file_download_dir: Option<PathBuf>,
pub auto_upload_download_files: bool,
pub telemetry_enabled: bool,
}Expand description
Configuration for Composio client
Fields§
§api_key: StringAPI key for authenticating with the Composio API
base_url: StringBase URL for the Composio API (default: https://backend.composio.dev/api/v3)
timeout: DurationTimeout duration for HTTP requests (default: 30 seconds)
retry_policy: RetryPolicyRetry policy for handling transient failures
toolkit_versions: Option<ToolkitVersionParam>Toolkit version configuration (default: None, uses “latest”)
file_download_dir: Option<PathBuf>Directory for downloading files (optional)
auto_upload_download_files: boolWhether to automatically upload and download files (default: true)
telemetry_enabled: boolWhether to enable telemetry tracking (opt-in, default: false for privacy)
Implementations§
Source§impl ComposioConfig
impl ComposioConfig
Sourcepub fn new(api_key: impl Into<String>) -> Self
pub fn new(api_key: impl Into<String>) -> Self
Create a new configuration with the given API key
§Arguments
api_key- The Composio API key
§Defaults
base_url: https://backend.composio.dev/api/v3timeout: 30 secondsretry_policy: 3 retries, 1s initial delay, 10s max delay
§Example
use composio_sdk::config::ComposioConfig;
let config = ComposioConfig::new("my_api_key");
assert_eq!(config.api_key, "my_api_key");
assert_eq!(config.base_url, "https://backend.composio.dev/api/v3");Sourcepub fn validate(&self) -> Result<(), ComposioError>
pub fn validate(&self) -> Result<(), ComposioError>
Validate the configuration
§Errors
Returns an error if:
- API key is empty
- Base URL doesn’t start with http:// or https://
§Example
use composio_sdk::config::ComposioConfig;
let config = ComposioConfig::new("my_api_key");
assert!(config.validate().is_ok());
let invalid_config = ComposioConfig::new("");
assert!(invalid_config.validate().is_err());Trait Implementations§
Source§impl Clone for ComposioConfig
impl Clone for ComposioConfig
Source§fn clone(&self) -> ComposioConfig
fn clone(&self) -> ComposioConfig
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 ComposioConfig
impl RefUnwindSafe for ComposioConfig
impl Send for ComposioConfig
impl Sync for ComposioConfig
impl Unpin for ComposioConfig
impl UnsafeUnpin for ComposioConfig
impl UnwindSafe for ComposioConfig
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