Skip to content

Commit

Permalink
fix unstructured example flow
Browse files Browse the repository at this point in the history
  • Loading branch information
hyjbrave authored Feb 7, 2025
1 parent e6100de commit aee9bb8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/concepts/flows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -232,18 +232,18 @@ class UnstructuredExampleFlow(Flow):
def first_method(self):
# The state automatically includes an 'id' field
print(f"State ID: {self.state['id']}")
self.state.message = "Hello from structured flow"
self.state.counter = 0
self.state['counter'] = 0
self.state['message'] = "Hello from structured flow"

@listen(first_method)
def second_method(self):
self.state.counter += 1
self.state.message += " - updated"
self.state['counter'] += 1
self.state['message'] += " - updated"

@listen(second_method)
def third_method(self):
self.state.counter += 1
self.state.message += " - updated again"
self.state['counter'] += 1
self.state['message'] += " - updated again"

print(f"State after third_method: {self.state}")

Expand Down

0 comments on commit aee9bb8

Please sign in to comment.