Skip to content

Fix the Graph API example on the applications concepts page - #894

Merged
jernejfrank merged 1 commit into
apache:mainfrom
Excelius-Wang:docs/fix-graph-api-example
Aug 29, 2026
Merged

jernejfrank merged 1 commit into
apache:mainfrom
Excelius-Wang:docs/fix-graph-api-example

Conversation

@Excelius-Wang

Copy link
Copy Markdown
Contributor

The Graph / Application split example on the applications page cannot be copy-pasted: it raises a SyntaxError before it gets anywhere.

Changes

Two lines in docs/concepts/state-machine.rst:

  • with_state(chat_history=[]) was missing its leading dot, so the builder chain broke mid-expression.
  • The import read from burr.core import ApplicationBuilder, default, expr, which brings in two names the snippet never uses while leaving GraphBuilder undefined. Changed to from burr.core import ApplicationBuilder, GraphBuilder.

How I tested this

Ran the corrected snippet with a human_input / ai_response action pair defined as in the surrounding docs. It builds the graph and the application without error. The original raises SyntaxError at the with_state line, and after fixing only that, NameError: name 'GraphBuilder' is not defined.

Notes

Docs only, and deliberately separate from #893 so this one can go in on its own. Both branches touch state-machine.rst but not the same lines, so there is no conflict either way round.

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality.

Made with Cursor

The snippet was missing a dot on .with_state, so it raised a SyntaxError
when copied, and it imported default/expr while leaving GraphBuilder
undefined.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot added the area/website burr.apache.org website label Aug 18, 2026

@jernejfrank jernejfrank left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jernejfrank
jernejfrank merged commit b75c01d into apache:main Aug 29, 2026
27 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/website burr.apache.org website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants