Skip to main content

AgentAvailabilityProbe

Trait AgentAvailabilityProbe 

Source
pub trait AgentAvailabilityProbe: Send + Sync {
    // Required method
    fn available_agent_kinds(&self) -> Vec<AgentKind>;

    // Provided methods
    fn available_agent_clis(&self) -> Vec<AgentCliInfo> { ... }
    fn native_harness_models<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Vec<HarnessModelOption>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn sign_in_chatgpt<'life0, 'async_trait>(
        &'life0 self,
        _on_url: ChatGptSignInUrlHandler,
    ) -> Pin<Box<dyn Future<Output = Result<ChatGptSignInOutcome, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn save_harness_api_key<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _provider: &'life1 str,
        _api_key: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}
Expand description

Detects which provider CLIs and harness models are runnable on the current machine.

Required Methods§

Source

fn available_agent_kinds(&self) -> Vec<AgentKind>

Returns the agent kinds whose backing CLI executable is available.

Provided Methods§

Source

fn available_agent_clis(&self) -> Vec<AgentCliInfo>

Returns available agent CLI executables and their refreshed versions.

Source

fn native_harness_models<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Vec<HarnessModelOption>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the AgentKind::Harness models a user can choose: models the local OpenAI-compatible server serves, then the hosted catalog models with their configuration status. Implementations bound every network probe with short timeouts. Probes without harness discovery report none.

Source

fn sign_in_chatgpt<'life0, 'async_trait>( &'life0 self, _on_url: ChatGptSignInUrlHandler, ) -> Pin<Box<dyn Future<Output = Result<ChatGptSignInOutcome, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Runs the browser sign-in that lets chatgpt/… harness models use the user’s ChatGPT plan, passing its URL to on_url before waiting for the browser callback. Probes without harness discovery do not support it.

§Errors

Returns a user-facing message when the sign-in cannot start, is denied, or cannot be stored.

Source

fn save_harness_api_key<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _provider: &'life1 str, _api_key: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Stores api_key as the key harness models of provider, such as kimi, use from now on, replacing a stored one. Probes without harness discovery do not support it.

§Errors

Returns a user-facing message when the provider takes no API key or the key cannot be stored.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§