Skip to content

textsplitter: correct documented defaults of NewRecursiveCharacter - #1577

Open
Priya-9 wants to merge 1 commit into
tmc:mainfrom
Priya-9:textsplitter-fix-recursive-doc
Open

Priya-9 wants to merge 1 commit into
tmc:mainfrom
Priya-9:textsplitter-fix-recursive-doc

Conversation

@Priya-9

@Priya-9 Priya-9 commented Nov 22, 2026 •

Copy link
Copy Markdown

The doc comment on NewRecursiveCharacter says the default chunk size is 4000 and the default overlap is 200. The function uses DefaultOptions(), which sets 512 and 100 (_defaultTokenChunkSize / _defaultTokenChunkOverlap in token_splitter.go). This corrects the comment, which also fixes the pkg.go.dev page mentioned in the issue.

Same fix as #1189, which was closed without review.

Fixes #1188

PR Checklist

  • Read the Contributing documentation.
  • Read the Code of conduct documentation.
  • Name your Pull Request title clearly, concisely, and prefixed with the name of the primarily affected package you changed according to Good commit messages (such as memory: add interfaces for X, Y or util: add whizzbang helpers).
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. Fixes #123).
  • N/A Describes the source of new concepts.
  • N/A References existing implementations as appropriate.
  • N/A Contains test coverage for new functions.
  • Passes all golangci-lint checks.

The govulncheck failure is unrelated to this change. It reports GO-2026-6865 (klauspost/compress), GO-2026-6860 (golang.org/x/net) and GO-2026-6859 (Go standard library). Happy to rebase once main is updated.

This branch has not been deployed

No deployments
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.

Incorrect documentation in recursive textsplitter/NewRecursiveCharacter

1 participant