pub struct GrammarInput {
pub property: String,
/* private fields */
}Expand description
A grammar tool call’s raw input as it streams, re-encoded as the JSON text of its arguments object.
Fields§
§property: StringThe argument that holds the raw input.
Implementations§
Source§impl GrammarInput
impl GrammarInput
Sourcepub fn for_call(
properties: &HashMap<String, String>,
name: &str,
) -> GrammarInput
pub fn for_call( properties: &HashMap<String, String>, name: &str, ) -> GrammarInput
The input of a custom tool call to name, held in the argument that
properties (from grammar_properties) gives for it. A call to a tool
sent without a grammar still keeps its input, as input.
Sourcepub fn input<'a>(&self, arguments: &'a Map<String, Value>) -> &'a str
pub fn input<'a>(&self, arguments: &'a Map<String, Value>) -> &'a str
The raw input arguments hold.
Sourcepub fn set(
&mut self,
arguments: &mut Map<String, Value>,
input: String,
close: bool,
) -> Result<Option<String>, String>
pub fn set( &mut self, arguments: &mut Map<String, Value>, input: String, close: bool, ) -> Result<Option<String>, String>
Sets arguments to hold input. Returns the JSON text that takes the
arguments streamed so far to it, closing the object when close, or
None when there is nothing to stream. Err, leaving arguments as
they are, when input does not extend the input streamed so far, or
changes once closed.
Trait Implementations§
Auto Trait Implementations§
impl Forget for GrammarInput
impl Freeze for GrammarInput
impl RefUnwindSafe for GrammarInput
impl Send for GrammarInput
impl Sync for GrammarInput
impl Unpin for GrammarInput
impl UnsafeUnpin for GrammarInput
impl UnwindSafe for GrammarInput
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