Skip to content

Update sample code for: LangGraph Tutorial: Build Stateful AI Agents in Python#784

Open
martin-martin wants to merge 2 commits into
masterfrom
python-langgraph-update
Open

Update sample code for: LangGraph Tutorial: Build Stateful AI Agents in Python#784
martin-martin wants to merge 2 commits into
masterfrom
python-langgraph-update

Conversation

@martin-martin

Copy link
Copy Markdown
Contributor

Where to put new files:

  • New files should go into a top-level subfolder, named after the article slug. For example: my-awesome-article

How to merge your changes:

  1. Make sure the CI code style tests all pass (+ run the automatic code formatter if necessary).
  2. Find an RP Team member on Slack and ask them to review & approve your PR.
  3. Once the PR has one positive ("approved") review, GitHub lets you merge the PR.
  4. 🎉

Updates the existing python-langgraph/ companion code for the LangGraph Tutorial: Build Stateful AI Agents in Python tutorial refresh.

Changes

  • Bump to langgraph 1.2.5, langchain-openai 1.3.2, langchain-core 1.4.7, pydantic 2.13.4 (regenerated requirements.txt; raised pyproject.toml floors)
  • Switch the model to gpt-5.4-nano
  • Fix check_escalation_status_node to fall back to 0 when no fine is extracted (avoids a TypeError on notices without a max potential fine)
  • Store the boolean answer.is_true in follow_ups (was storing the model object, violating the dict[str, bool] type)
  • Drop the unused critical_fields_missing key from the agent's initial state
  • Point the README API-key link at platform.openai.com/api-keys and align the README title

Verified end-to-end against OpenAI on Python 3.12 and 3.14 with the pinned requirements.txt (structured output, the escalation/no-fine path, the follow-up cycle, and the agent). ruff format/ruff check (v0.14.1) pass.

martin-martin and others added 2 commits June 16, 2026 20:21
…in Python

Refresh the LangGraph companion code for the tutorial update:
- Bump to langgraph 1.2.5, langchain-openai 1.3.2, langchain-core 1.4.7,
  pydantic 2.13.4 (regenerated requirements.txt; pyproject floors raised)
- Switch the model to gpt-5.4-nano
- Fix check_escalation_status_node to fall back to 0 when no fine is
  extracted (avoids a TypeError on notices without a max potential fine)
- Store the boolean answer.is_true in follow_ups (was storing the model object)
- Drop the unused critical_fields_missing key from the agent's initial state
- Point the README API-key link at platform.openai.com/api-keys and match
  the new tutorial title

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The companion emails still used 2024/2025 dates while the tutorial's
examples and REPL transcripts use 2026. Update Email 0 (May 15 / June 10,
2026) and Email 3 (June 10 / August 5, 2026) so extracted dates match the
tutorial output.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant