-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tree_of_Thought_mini_pseudo
33 lines (30 loc) · 1.69 KB
/
Tree_of_Thought_mini_pseudo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Define the root node
root := Node("Root", children=[
// Define the first level nodes
Node("Thought Generation"),
Node("State Evaluation"),
Node("Thought Decomposition"),
Node("Thought Voting"),
Node("DFS Pruning"),
Node("Self Reflection Mechanisms"),
Node("Review and Adapt")
]);
// Define the relationships between nodes
relationships := [
Relationship("is_parent_of", root, "Thought Generation"),
Relationship("is_parent_of", root, "State Evaluation"),
Relationship("is_parent_of", root, "Thought Decomposition"),
Relationship("is_parent_of", root, "Thought Voting"),
Relationship("is_parent_of", root, "DFS Pruning"),
Relationship("is_parent_of", root, "Self Reflection Mechanisms"),
Relationship("is_parent_of", root, "Review and Adapt"),
Relationship("has_child", "Thought Generation", "Generate multiple thoughts or plans, prioritizing if urgent."),
Relationship("has_child", "State Evaluation", "Evaluate the state or quality of each thought using specified metrics."),
Relationship("has_child", "Thought Decomposition", "Decompose complex thoughts into simpler sub-thoughts, providing examples."),
Relationship("has_child", "Thought Voting", "Select the most promising thought or plan, using a tie-breaker if needed."),
Relationship("has_child", "DFS Pruning", "Eliminate less promising thoughts, revisiting if conditions change."),
Relationship("has_child", "Self Reflection Mechanisms", "Enable self-assessment using defined criteria."),
Relationship("has_child", "Review and Adapt", "Iteratively review outcomes and adapt for the next iteration.")
];
// Return the graph
return Graph(nodes=root, edges=relationships);