pub struct AgentApi { /* private fields */ }Implementations§
Source§impl AgentApi
impl AgentApi
pub fn new(controller: Arc<AgentController>) -> Self
Sourcepub fn with_resources(
controller: Arc<AgentController>,
default_resources: Vec<ResourceBinding>,
) -> Self
pub fn with_resources( controller: Arc<AgentController>, default_resources: Vec<ResourceBinding>, ) -> Self
Creates an API whose sessions inherit the same immutable resource bindings. Transports can therefore create sessions without knowing how a concrete Host discovered Skills or other resources.
Sourcepub fn with_default_extensions(self, extensions: Extensions) -> Self
pub fn with_default_extensions(self, extensions: Extensions) -> Self
Sets Host metadata inherited by sessions subsequently created here.
pub async fn create_session( &self, preferred_id: Option<AgentSessionId>, ) -> Result<AgentSessionId, AgentSdkError>
pub async fn start_text( &self, session_id: &AgentSessionId, run_id: Option<RunId>, input: impl Into<String>, ) -> Result<AgentRunHandle, AgentSdkError>
pub async fn start_content( &self, session_id: &AgentSessionId, run_id: Option<RunId>, input: Vec<Content>, ) -> Result<AgentRunHandle, AgentSdkError>
pub async fn start_content_with_extensions( &self, session_id: &AgentSessionId, run_id: Option<RunId>, input: Vec<Content>, extensions: Extensions, ) -> Result<AgentRunHandle, AgentSdkError>
pub async fn start_session_action( &self, session_id: &AgentSessionId, run_id: RunId, title: impl Into<String>, action: AgentSessionActionInvocation, ) -> Result<AgentRunHandle, AgentSdkError>
pub async fn inspect( &self, run_id: &RunId, ) -> Result<AgentRunView, AgentSdkError>
pub async fn initial_input( &self, run_id: &RunId, ) -> Result<Vec<Content>, AgentSdkError>
pub async fn run_extensions( &self, run_id: &RunId, ) -> Result<Extensions, AgentSdkError>
pub async fn catalog_runs( &self, ) -> Result<Vec<AgentRunCatalogEntry>, AgentSdkError>
pub async fn can_control_run( &self, run_id: &RunId, ) -> Result<bool, AgentSdkError>
pub async fn has_run(&self, run_id: &RunId) -> Result<bool, AgentSdkError>
pub async fn events( &self, run_id: &RunId, after_run_seq: u64, ) -> Result<Vec<AgentJournalRecord>, AgentSdkError>
Sourcepub async fn subscribe(
&self,
run_id: &RunId,
) -> Result<Receiver<AgentControlEvent>, AgentSdkError>
pub async fn subscribe( &self, run_id: &RunId, ) -> Result<Receiver<AgentControlEvent>, AgentSdkError>
Subscribes to best-effort live events. Durable consumers must combine
this with Self::events before rendering and after broadcast lag.
Sourcepub async fn recorded_command(
&self,
run_id: &RunId,
command_id: &CommandId,
) -> Result<Option<AgentCommandEnvelope>, AgentSdkError>
pub async fn recorded_command( &self, run_id: &RunId, command_id: &CommandId, ) -> Result<Option<AgentCommandEnvelope>, AgentSdkError>
Looks up a durable command without starting or recovering native work.
pub async fn command( &self, command: AgentCommandEnvelope, ) -> Result<CommandAck, AgentSdkError>
pub async fn cancel( &self, run_id: &RunId, reason: impl Into<String>, ) -> Result<CommandAck, AgentSdkError>
pub async fn recover( &self, run_id: &RunId, ) -> Result<AgentRunView, AgentSdkError>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AgentApi
impl !UnwindSafe for AgentApi
impl Freeze for AgentApi
impl Send for AgentApi
impl Sync for AgentApi
impl Unpin for AgentApi
impl UnsafeUnpin for AgentApi
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.