pub struct Client { /* private fields */ }Expand description
A synchronous client for a Marbots server. Cheap to clone; safe to share between threads.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(base_url: impl Into<String>) -> Self
pub fn new(base_url: impl Into<String>) -> Self
A client for base_url (e.g. http://localhost:5170).
Sourcepub fn with_api_key(self, key: impl Into<String>) -> Self
pub fn with_api_key(self, key: impl Into<String>) -> Self
The credential: a tenant key (mbk_…), the platform key (Marbots:ApiKey) or an OIDC access token.
Sourcepub fn with_tenant(self, tenant: impl Into<String>) -> Self
pub fn with_tenant(self, tenant: impl Into<String>) -> Self
Tenant to act in with the platform key or a token (or end the base URL in /t/<tenant>).
pub fn base_url(&self) -> &str
Sourcepub fn system(&self) -> Result<SystemInfo>
pub fn system(&self) -> Result<SystemInfo>
Server information.
Sourcepub fn chat(&self, bot: &str, text: &str) -> Result<String>
pub fn chat(&self, bot: &str, text: &str) -> Result<String>
Creates a thread with bot, sends text, waits, and returns the reply text.
pub fn bots(&self) -> Bots<'_>
pub fn templates(&self) -> Templates<'_>
pub fn models(&self) -> Models<'_>
pub fn threads(&self) -> Threads<'_>
pub fn tasks(&self) -> Tasks<'_>
pub fn approvals(&self) -> Approvals<'_>
pub fn skills(&self) -> Skills<'_>
pub fn mcp(&self) -> Mcp<'_>
pub fn schedules(&self) -> Schedules<'_>
pub fn memory(&self) -> Memory<'_>
Sourcepub fn agent_hosts(&self) -> AgentHosts<'_>
pub fn agent_hosts(&self) -> AgentHosts<'_>
Computers that run bots’ tools.
Sourcepub fn tenancy(&self) -> Tenancy<'_>
pub fn tenancy(&self) -> Tenancy<'_>
Who am I, tenants (platform admins), this tenant’s API keys and members (owners).
pub fn events(&self) -> Events<'_>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Freeze for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
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