Skip to main content

ScraperConfig

Struct ScraperConfig 

Source
pub struct ScraperConfig {
Show 13 fields pub fetcher: FetcherConfig, pub policy: PolicyConfig, pub browser: PoolConfig, pub store: Option<Store>, pub llm: Option<LlmConfig>, pub search: Option<Arc<dyn SearchBackend>>, pub egress: Vec<(String, String)>, pub egress_classes: HashMap<String, EgressClass>, pub audit: Option<Arc<Audit>>, pub hooks: Hooks, pub secrets: BTreeMap<String, ActionSecret>, pub ocr: Option<Arc<dyn PageOcr>>, pub interact: InteractLimits,
}

Fields§

§fetcher: FetcherConfig§policy: PolicyConfig§browser: PoolConfig§store: Option<Store>

抓取结果缓存(maxAge、minAge、storeInCache);不设时不缓存。

§llm: Option<LlmConfig>

summary、json 格式和 /v2/extract 用的 OpenAI 兼容服务。

§search: Option<Arc<dyn SearchBackend>>

/v2/search 用的搜索后端。

§egress: Vec<(String, String)>

命名出口(名字,代理地址):请求的 egress 选其中一个,其余抓取设置和默认出口相同; 两个及以上时,不指定 egress 的请求由出口池选。

§egress_classes: HashMap<String, EgressClass>

命名出口的类别(没列出的是 direct)。代理地址为空的 direct 出口与默认出口相同。

§audit: Option<Arc<Audit>>

审计日志:每次抓取一行元数据,可疑结果留 HTML 快照(见 crate::audit)。

§hooks: Hooks

扩展点(pagesift_hooks):代码注册的钩子和 [[rules]] 编译出的规则。空时不经过任何钩子。

§secrets: BTreeMap<String, ActionSecret>

[secrets]:act 动作里 {{secret:NAME}} 在本地替换成的值(不经过模型)。

§ocr: Option<Arc<dyn PageOcr>>

扫描页 OCR([ocr] enabled);不设时扫描页只有说明,并报 scanned_pages_without_ocr。

§interact: InteractLimits

/interact 保留会话的时长上限(默认 Firecrawl 文档的值)。

Trait Implementations§

Source§

impl Clone for ScraperConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for ScraperConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more