Skip to content

Conversation

@pyaf
Copy link
Contributor

@pyaf pyaf commented Nov 1, 2025

Overview

Fixed a typo in Context Edit Middleware docs.

Type of change

Type: typofix

Related issues/PRs

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

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
  • I have gotten approval from the relevant reviewers
  • (Internal team members only / optional) I have created a preview deployment using the Create Preview Branch workflow

Additional notes

@pyaf pyaf requested a review from lnhsingh as a code owner November 1, 2025 18:10
Copilot AI review requested due to automatic review settings November 1, 2025 18:10
@github-actions github-actions bot added langchain For docs changes to LangChain oss labels Nov 1, 2025
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 corrects a parameter name in a Python code example for ClearToolUsesEdit. The example was using max_tokens instead of the correct parameter name trigger, which is documented in the configuration options section.

Key Changes

  • Updated Python code example to use the correct parameter name trigger instead of max_tokens
Comments suppressed due to low confidence (1)

src/oss/langchain/middleware.mdx:1098

  • The JavaScript example uses maxTokens while the Python example uses trigger. According to the documentation (line 1119 for Python and line 1151 for JavaScript), these are the correct parameter names for their respective languages. However, consider verifying that the JavaScript documentation at line 1151 is complete - it only shows maxTokens while the Python documentation shows additional parameters like clear_at_least, keep, clear_tool_inputs, exclude_tools, and placeholder. The JavaScript section should document all available parameters for consistency.
        new ClearToolUsesEdit({ maxTokens: 1000 }), // Clear old tool uses

Copy link
Collaborator

@mdrxy mdrxy left a comment

Choose a reason for hiding this comment

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

TY!

@mdrxy mdrxy merged commit 7a6bdac into langchain-ai:main Nov 3, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

langchain For docs changes to LangChain oss

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants