Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Kittensx authored Dec 10, 2024
1 parent 5696f91 commit 37d339f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions 02_ Or Functionality/prompt_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ def collect_steps(steps, tree):
#print("Invalid tree structure:", tree)
#return []
res = [steps] # Always include the final step
def resolve_tree(tree):
"""Recursively resolve a tree node to its final string representation."""
if isinstance(tree, lark.Tree):
# Recursively resolve each child
return "".join(resolve_tree(child) for child in tree.children)
return str(tree)

class CollectSteps(lark.Visitor):
def alternate1(self, tree):
Expand Down

0 comments on commit 37d339f

Please sign in to comment.