Skip to main content

UrlFetchBackend

Trait UrlFetchBackend 

Source
pub trait UrlFetchBackend: Send + Sync {
    // Required method
    fn fetch<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<FetchedPage, ActionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Optional backend for fetching the body of a URL the user (or an upstream search hit) handed us. Kept separate from WebSearchBackend so a deployment can have search without fetch (or vice versa) and so the two contracts can evolve independently.

Required Methods§

Source

fn fetch<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<FetchedPage, ActionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch a single URL. The backend is responsible for timeouts, body size caps, and HTML-to-text reduction so the returned page is safe to pass straight into an LLM context window.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§