pub struct MapResult {
pub urls: Vec<DiscoveredUrl>,
pub relevance: f32,
pub summary: String,
pub suggested_next: Vec<String>,
pub screenshot: Option<String>,
pub usage: AutomationUsage,
}Expand description
Result of the map() API call for page discovery.
Fields§
§urls: Vec<DiscoveredUrl>The URLs discovered on the page.
relevance: f32Relevance score of the page to the prompt (0.0 - 1.0).
summary: StringSummary of what the page contains.
suggested_next: Vec<String>Suggested next URLs to explore based on the prompt.
screenshot: Option<String>Optional screenshot if captured.
usage: AutomationUsageToken usage statistics.
Implementations§
Source§impl MapResult
impl MapResult
Sourcepub fn with_summary(summary: impl Into<String>) -> Self
pub fn with_summary(summary: impl Into<String>) -> Self
Create with a summary.
Sourcepub fn add_url(&mut self, url: DiscoveredUrl)
pub fn add_url(&mut self, url: DiscoveredUrl)
Add a discovered URL.
Sourcepub fn add_suggested(&mut self, url: impl Into<String>)
pub fn add_suggested(&mut self, url: impl Into<String>)
Add a suggested next URL.
Sourcepub fn with_relevance(self, relevance: f32) -> Self
pub fn with_relevance(self, relevance: f32) -> Self
Set the relevance score.
Sourcepub fn with_screenshot(self, screenshot: impl Into<String>) -> Self
pub fn with_screenshot(self, screenshot: impl Into<String>) -> Self
Set the screenshot.
Sourcepub fn with_usage(self, usage: AutomationUsage) -> Self
pub fn with_usage(self, usage: AutomationUsage) -> Self
Set the usage statistics.
Sourcepub fn urls_by_relevance(&self) -> Vec<&DiscoveredUrl>
pub fn urls_by_relevance(&self) -> Vec<&DiscoveredUrl>
Get URLs sorted by relevance (highest first).
Sourcepub fn recommended_urls(&self) -> Vec<&DiscoveredUrl>
pub fn recommended_urls(&self) -> Vec<&DiscoveredUrl>
Get only recommended URLs.
Sourcepub fn urls_by_category(&self, category: &str) -> Vec<&DiscoveredUrl>
pub fn urls_by_category(&self, category: &str) -> Vec<&DiscoveredUrl>
Get URLs by category.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MapResult
impl<'de> Deserialize<'de> for MapResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MapResult
impl RefUnwindSafe for MapResult
impl Send for MapResult
impl Sync for MapResult
impl Unpin for MapResult
impl UnwindSafe for MapResult
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