pub struct GraphNode {
pub id: String,
pub session_id: String,
pub content: String,
pub node_type: NodeType,
pub score: Option<f64>,
pub depth: i32,
pub is_terminal: bool,
pub is_root: bool,
pub is_active: bool,
pub created_at: DateTime<Utc>,
pub metadata: Option<Value>,
}Expand description
Graph node for Graph-of-Thoughts reasoning.
Fields§
§id: StringUnique node identifier.
session_id: StringParent session ID.
content: StringNode content/thought text.
node_type: NodeTypeType of node in the reasoning graph.
score: Option<f64>Quality score from evaluation (0.0-1.0).
depth: i32Depth level in the graph (0 = root).
is_terminal: boolWhether this is a terminal/conclusion node.
is_root: boolWhether this is a root/starting node.
is_active: boolWhether this node is active (not pruned).
created_at: DateTime<Utc>When the node was created.
metadata: Option<Value>Optional metadata.
Implementations§
Source§impl GraphNode
impl GraphNode
Sourcepub fn new(session_id: impl Into<String>, content: impl Into<String>) -> Self
pub fn new(session_id: impl Into<String>, content: impl Into<String>) -> Self
Create a new graph node
Sourcepub fn with_score(self, score: f64) -> Self
pub fn with_score(self, score: f64) -> Self
Set score
Sourcepub fn with_depth(self, depth: i32) -> Self
pub fn with_depth(self, depth: i32) -> Self
Set depth
Sourcepub fn as_terminal(self) -> Self
pub fn as_terminal(self) -> Self
Mark as terminal
Sourcepub fn as_inactive(self) -> Self
pub fn as_inactive(self) -> Self
Mark as inactive (pruned)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GraphNode
impl<'de> Deserialize<'de> for GraphNode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GraphNode
impl RefUnwindSafe for GraphNode
impl Send for GraphNode
impl Sync for GraphNode
impl Unpin for GraphNode
impl UnwindSafe for GraphNode
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> 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>
Converts
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>
Converts
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