Skip to content

Conversation

@EstoesMoises
Copy link

@EstoesMoises EstoesMoises commented Dec 14, 2025

Overview

Fixed TypeScript type errors and deprecated API usage in the LangGraph quickstart tutorial.

Graph API (main changes):

  • Migrated state definition from Zod to Annotation API to resolve type incompatibilities
  • Replaced deprecated isAIMessage() with AIMessage.isInstance()
  • Replaced deprecated .getType() with .type property

Functional API:

  • Updated to use AIMessage.isInstance() and .type property for consistency
  • Removed unused import from "Step 4: Define agent"

These changes eliminate typecheck errors while keeping the example clear and easy to follow.

Type of change

Type: Update existing documentation

Related issues/PRs

It resolves - langchain-ai/langgraph#6517

Checklist

  • I have read the contributing guidelines
  • 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

@github-actions github-actions bot added langgraph For docs changes to LangGraph oss external User is not a member of langchain-ai labels Dec 14, 2025
Copy link
Collaborator

@lnhsingh lnhsingh left a comment

Choose a reason for hiding this comment

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

Thank you!

Copilot AI review requested due to automatic review settings December 15, 2025 14:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes TypeScript type errors in the LangGraph quickstart tutorial by migrating from Zod-based state definitions to the Annotation API, replacing deprecated message API methods, and removing unused imports. The changes eliminate typecheck errors while maintaining clarity and consistency across both the Graph API and Functional API examples.

Key changes:

  • Migrated state definition from Zod (z.object()) to Annotation API (Annotation.Root()) with proper reducer functions
  • Replaced deprecated isAIMessage() with AIMessage.isInstance() for type checking
  • Replaced deprecated .getType() method with .type property for accessing message types
  • Added language-specific documentation tips explaining state management differences

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

Labels

external User is not a member of langchain-ai langgraph For docs changes to LangGraph oss

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants