pub struct ExtractBuilder { /* private fields */ }Expand description
Builder for an Extract record.
Implementations§
Source§impl ExtractBuilder
impl ExtractBuilder
Sourcepub fn field(self, name: impl Into<String>, recognizer: Recognizer) -> Self
pub fn field(self, name: impl Into<String>, recognizer: Recognizer) -> Self
Add a field filled by recognizer, promoted to a state key of the same name.
Sourcepub fn field_to(
self,
name: impl Into<String>,
state_key: impl Into<String>,
recognizer: Recognizer,
) -> Self
pub fn field_to( self, name: impl Into<String>, state_key: impl Into<String>, recognizer: Recognizer, ) -> Self
Add a field promoted to a custom state key.
Sourcepub fn field_resolve<I, S, F, Fut>(
self,
name: impl Into<String>,
args: I,
ttl: Option<Duration>,
fetch: F,
) -> Self
pub fn field_resolve<I, S, F, Fut>( self, name: impl Into<String>, args: I, ttl: Option<Duration>, fetch: F, ) -> Self
Add a field filled by an async resolver — a tool call, HTTP fetch, or
MCP request. args names the State keys bound into the JSON object
passed to fetch; the returned value becomes the field. With a ttl,
results are memoized by (field, canonical args) for that duration.
Sourcepub fn validate<F>(self, predicate: F) -> Self
pub fn validate<F>(self, predicate: F) -> Self
Attach a validator to the most recently added field: a recognized
value is promoted only when predicate returns true (else it is
rejected, as if no value was recognized this turn).
Sourcepub fn trigger(self, trigger: ExtractionTrigger) -> Self
pub fn trigger(self, trigger: ExtractionTrigger) -> Self
When the record runs (default EveryTurn).
Sourcepub fn on_complete(self, agent: Arc<dyn TextAgent>, mode: AgentMode) -> Self
pub fn on_complete(self, agent: Arc<dyn TextAgent>, mode: AgentMode) -> Self
Run agent (in mode) when this record lands fields in state — the
on_complete(dispatch(agent)) effect. Its result lands in {name}:result.
Auto Trait Implementations§
impl Freeze for ExtractBuilder
impl !RefUnwindSafe for ExtractBuilder
impl Send for ExtractBuilder
impl Sync for ExtractBuilder
impl Unpin for ExtractBuilder
impl !UnwindSafe for ExtractBuilder
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].