pub struct VerbSpec {
pub name: String,
pub label: String,
pub description: String,
pub objects: Vec<ObjectKind>,
pub args: Value,
pub effect: EffectClass,
pub callers: Callers,
pub only_delays: bool,
pub reversible: bool,
pub voice_phrase: Option<String>,
}Expand description
One screen action, declared once for every caller (spec 3.3 §2 item 7, §6.1).
§Example
use adk_kernel::drivers::EffectClass;
use adk_surface::verbs::{Callers, ObjectKind, VerbSpec};
let snooze = VerbSpec::new("snooze", "Snooze", "Snooze something in Coming up", EffectClass::WriteLocal)
.with_objects([ObjectKind::ComingUp])
.with_callers(Callers::PersonAndAgents)
.only_delays()
.reversible()
.with_voice_phrase("snooze");
assert_eq!(snooze.tool_name(), "verb_snooze");
assert!(snooze.only_delays);Fields§
§name: StringThe name: ^[a-z][a-z0-9_]{0,58}$, never one of RESERVED.
label: StringThe button’s words: “Snooze”.
description: StringWhat it does, in plain words, for a person and for the model: “Snooze something in Coming up”. Also the chat heading of an agent’s card.
objects: Vec<ObjectKind>What it acts on; an allowlist, of ALLOWED_OBJECTS only.
args: ValueThe JSON Schema of its arguments, the tool’s parameters.
effect: EffectClassWhat it changes, as a driver tool’s manifest says it.
callers: CallersWho may take it.
only_delays: boolIt only delays work: a person may take it while everything is stopped (owner question 23).
reversible: boolIt can be changed back: its card says “You can change it back”.
voice_phrase: Option<String>The words that start it by voice, such as “snooze”; None: not by voice.
Implementations§
Source§impl VerbSpec
impl VerbSpec
Sourcepub fn new(
name: impl Into<String>,
label: impl Into<String>,
description: impl Into<String>,
effect: EffectClass,
) -> Self
pub fn new( name: impl Into<String>, label: impl Into<String>, description: impl Into<String>, effect: EffectClass, ) -> Self
An action name with no objects and no arguments, for a person only.
Sourcepub fn with_objects(self, objects: impl IntoIterator<Item = ObjectKind>) -> Self
pub fn with_objects(self, objects: impl IntoIterator<Item = ObjectKind>) -> Self
Acts on objects.
Sourcepub fn with_callers(self, callers: Callers) -> Self
pub fn with_callers(self, callers: Callers) -> Self
May be taken by callers.
Sourcepub fn only_delays(self) -> Self
pub fn only_delays(self) -> Self
Only delays work, so it still runs while everything is stopped.
Sourcepub fn reversible(self) -> Self
pub fn reversible(self) -> Self
Can be changed back.
Sourcepub fn with_voice_phrase(self, phrase: impl Into<String>) -> Self
pub fn with_voice_phrase(self, phrase: impl Into<String>) -> Self
Starts by voice with phrase.
Trait Implementations§
impl StructuralPartialEq for VerbSpec
Auto Trait Implementations§
impl Forget for VerbSpec
impl Freeze for VerbSpecwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<ObjectKind>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
impl Move for VerbSpec
impl RefUnwindSafe for VerbSpec
impl Send for VerbSpec
impl Sync for VerbSpec
impl Unpin for VerbSpec
impl UnsafeUnpin for VerbSpecwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<ObjectKind>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
impl UnwindSafe for VerbSpec
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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