Skip to content

Conversation

@yanglikun
Copy link
Contributor

@yanglikun yanglikun commented Dec 3, 2025

  • Switch model from gpt-4 to gpt-5-nano because gpt-4 could not reliably return valid JSON, causing classify_intent to fail.
  • Update logging to avoid printing draft_response before it exists, which previously caused an error in:
    print(f"Draft ready for review: {result['draft_response'][:100]}...")

Overview

This PR updates the example to use gpt-5-nano instead of gpt-4 for the classify_intent step and fixes a logging statement that could raise an exception when draft_response is not yet available.

Type of change

Type: Update existing documentation

Related issues/PRs

  • GitHub issue:
  • Feature PR:
  • Linear issue:
  • Slack thread:

Checklist

  • I have read the [contributing guidelines](README.md)
  • I have tested my changes locally using docs dev
  • All code examples have been tested and work correctly
  • I have used root relative paths for internal links
  • I have updated navigation in src/docs.json if needed

(Internal team members only / optional): Create a preview deployment as necessary using the [Create Preview Branch workflow](https://github.com/langchain-ai/docs/actions/workflows/create-preview-branch.yml)

Additional notes

  • The switch to gpt-5-nano ensures structured JSON output for the classify_intent node.
  • The updated print statement prevents runtime errors when draft_response is missing.

- Switch model from gpt-4 to gpt-5-nano because gpt-4 could not reliably return valid JSON, causing classify_intent to fail.
- Update logging to avoid printing draft_response before it exists, which previously caused an error in:
  print(f"Draft ready for review: {result['draft_response'][:100]}...")
@yanglikun yanglikun requested a review from lnhsingh as a code owner December 3, 2025 08:51
@github-actions github-actions bot added langgraph For docs changes to LangGraph oss labels Dec 3, 2025
result = app.invoke(initial_state, config)
# The graph will pause at human_review
print(f"Draft ready for review: {result['draft_response'][:100]}...")
print(f"human review interrupt:{result['__interrupt__']}")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update logging to avoid printing draft_response before it exists, which previously caused an error in:
print(f"Draft ready for review: {result['draft_response'][:100]}...")

from langchain.messages import HumanMessage

llm = ChatOpenAI(model="gpt-4")
llm = ChatOpenAI(model="gpt-5-nano")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

gpt-4 could not reliably return valid JSON, causing classify_intent to fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

langgraph For docs changes to LangGraph oss

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant