Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: documentation Update Request: Deprecation of loadAndSplit in NotionAPI Web Loader Example #7494

Closed
2 tasks done
amanbairagi30 opened this issue Jan 10, 2025 · 0 comments · Fixed by #7504
Closed
2 tasks done
Labels
auto:documentation Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder

Comments

@amanbairagi30
Copy link

Checklist

  • I added a very descriptive title to this issue.
  • I included a link to the documentation page I am referring to (if applicable).

Issue with current documentation:

Documentation Update Request: NotionAPI Web Loader Deprecation Notice

Summary

The loadAndSplit method in the NotionAPI Web Loader example is deprecated and needs to be updated to reflect current best practices.

Current Documentation

The NotionAPI Web Loader documentation currently shows:

const pageDocs = await pageLoader.loadAndSplit(splitter);

Issue

VSCode displays a deprecation warning for this method:

@deprecated
Use this.load() and splitter.splitDocuments() individually. Loads the documents 
and splits them using a specified text splitter.

Related Links

Idea or request for content:

Suggested Update

The example should be updated to use the two separate methods as recommended:

// Load the documents
const pageDocs = await pageLoader.load();

// Split the documents using the text splitter
const splitDocs = await splitter.splitDocuments(pageDocs);

// Log the results (if needed)
console.log({ splitDocs });

Benefits of Change

  • Follows current API best practices
  • More explicit and clearer code flow
  • Removes usage of deprecated method
  • Easier to debug and maintain

Additional Notes

This change maintains the same functionality while using the current recommended approach. The split operation is now more visible in the code, making it easier for developers to understand and modify the splitting behavior if needed.


@dosubot dosubot bot added the auto:documentation Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:documentation Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant