Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix unstructured example flow #2052

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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