pub struct FoundryClient { /* private fields */ }Expand description
Microsoft Foundry API client
Implementations§
Source§impl FoundryClient
impl FoundryClient
Sourcepub fn new(config: &FoundryServiceConfig) -> Result<Self, ClientError>
pub fn new(config: &FoundryServiceConfig) -> Result<Self, ClientError>
Create a new Foundry client from service configuration
Sourcepub fn with_auth(
base_url: String,
project: String,
api_version: String,
auth: Box<dyn AuthProvider>,
) -> Result<Self, ClientError>
pub fn with_auth( base_url: String, project: String, api_version: String, auth: Box<dyn AuthProvider>, ) -> Result<Self, ClientError>
Create with a custom auth provider (for testing)
Sourcepub async fn list_agents(&self) -> Result<Vec<Value>, ClientError>
pub async fn list_agents(&self) -> Result<Vec<Value>, ClientError>
List all agents in the project
Sourcepub async fn get_agent(&self, id: &str) -> Result<Value, ClientError>
pub async fn get_agent(&self, id: &str) -> Result<Value, ClientError>
Get a specific agent by ID
Sourcepub async fn create_agent(
&self,
definition: &Value,
) -> Result<Value, ClientError>
pub async fn create_agent( &self, definition: &Value, ) -> Result<Value, ClientError>
Create a new agent (creates first version)
Takes a flat agent definition and wraps it in the API format
before posting to /agents/{name}/versions.
Sourcepub async fn update_agent(
&self,
id: &str,
definition: &Value,
) -> Result<Value, ClientError>
pub async fn update_agent( &self, id: &str, definition: &Value, ) -> Result<Value, ClientError>
Update an existing agent (creates new version)
Takes a flat agent definition and wraps it in the API format
before posting to /agents/{name}/versions.
Sourcepub async fn delete_agent(&self, id: &str) -> Result<(), ClientError>
pub async fn delete_agent(&self, id: &str) -> Result<(), ClientError>
Delete an agent
Sourcepub fn auth_method(&self) -> &'static str
pub fn auth_method(&self) -> &'static str
Get the authentication method being used
Auto Trait Implementations§
impl Freeze for FoundryClient
impl !RefUnwindSafe for FoundryClient
impl Send for FoundryClient
impl Sync for FoundryClient
impl Unpin for FoundryClient
impl UnsafeUnpin for FoundryClient
impl !UnwindSafe for FoundryClient
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