Fix the Graph API example on the applications concepts page - #894
Open
Excelius-Wang wants to merge 1 commit into
Open
Fix the Graph API example on the applications concepts page#894Excelius-Wang wants to merge 1 commit into
Excelius-Wang wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
Graph/Applicationsplit example on the applications page cannot be copy-pasted: it raises aSyntaxErrorbefore 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.from burr.core import ApplicationBuilder, default, expr, which brings in two names the snippet never uses while leavingGraphBuilderundefined. Changed tofrom burr.core import ApplicationBuilder, GraphBuilder.How I tested this
Ran the corrected snippet with a
human_input/ai_responseaction pair defined as in the surrounding docs. It builds the graph and the application without error. The original raisesSyntaxErrorat thewith_stateline, 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.rstbut not the same lines, so there is no conflict either way round.Checklist
Made with Cursor