pub enum Value {
Show 13 variants
String(String),
Number(f64),
Boolean(bool),
Null,
Agent(AgentValue),
Array(Vec<Value>),
Object(HashMap<String, Value>),
Tool(UserToolValue),
Function(FnValue),
Lambda(LambdaValue),
Enum(EnumValue),
EnumConstructor(EnumConstructor),
Parallel(ParallelValue),
}Expand description
Runtime values in GENT
Variants§
String(String)
String value
Number(f64)
Numeric value (f64)
Boolean(bool)
Boolean value
Null
Null/none value
Agent(AgentValue)
Agent value
Array(Vec<Value>)
Array value
Object(HashMap<String, Value>)
Object value (key-value map)
Tool(UserToolValue)
User-defined tool
Function(FnValue)
User-defined function (pure, no agent access)
Lambda(LambdaValue)
Lambda/closure value
Enum(EnumValue)
Enum value
EnumConstructor(EnumConstructor)
Enum constructor (intermediate value before calling with args)
Parallel(ParallelValue)
Parallel execution block
Implementations§
Source§impl Value
impl Value
Sourcepub fn as_agent(&self) -> Option<&AgentValue>
pub fn as_agent(&self) -> Option<&AgentValue>
Try to get as agent
Sourcepub fn as_tool(&self) -> Option<&UserToolValue>
pub fn as_tool(&self) -> Option<&UserToolValue>
Try to get as tool
Sourcepub fn as_function(&self) -> Option<&FnValue>
pub fn as_function(&self) -> Option<&FnValue>
Try to get as function
Trait Implementations§
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.