-
Notifications
You must be signed in to change notification settings - Fork 1
Generate llms-full.txt by using gitingest script
#1418
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
Generate llms-full.txt by using gitingest script
#1418
Conversation
Introduces `scripts/generate-llms-full.py` to generate `llms-full.txt` by leveraging the gitingest package instead of `docusaurus-plugin-llms`. The script handles installation of gitingest if missing, configures include/exclude patterns, and writes the output to the build directory.
Introduces a new npm script `generate-llms-full` that runs a Python script for generating LLMs data. The build process now includes this step to ensure LLMs data is generated during builds.
Set `generateLLMsFullTxt` to false in `docusaurus-plugin-llms` configuration. This change is made because gitingest is now used to generate a more detailed llms-full.txt file.
Introduces documentation explaining the purpose, usage, requirements, and configuration of the `generate-llms-full.py` script. The README details how the script uses gitingest to create an AI-friendly `llms-full.txt` file with enhanced context for documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @josh-wong, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
I've updated our Docusaurus site's build process to generate a more intelligent llms-full.txt file. Previously, the default plugin generated this file without sufficient context for AI models. My changes introduce a custom Python script that uses gitingest to include essential metadata and structural information, significantly improving how AI models can understand and utilize our documentation. This ensures that our documentation is better optimized for consumption by large language models, providing them with richer and more accurate context.
Highlights
- Custom LLM Text Generation: I've introduced a new Python script (
scripts/generate-llms-full.py) that leverages thegitingesttool to create a more comprehensivellms-full.txtfile. This new file includes crucial front-matter metadata and directory structure, providing AI models with richer context about our documentation. - Build Process Integration: I've updated
package.jsonto integrate the new Python script directly into our Docusaurus build process. This ensures that the enhancedllms-full.txtis automatically generated whenever the site is built, streamlining our documentation workflow. - Plugin Configuration Update: I've modified
docusaurus.config.jsto disable the defaultgenerateLLMsFullTxtoption within thedocusaurus-plugin-llms. This change explicitly signals our preference for the newgitingest-based generation method, avoiding redundant or less effective outputs. - Comprehensive Documentation: To ensure clarity and ease of use, I've added a detailed
scripts/README.md. This new documentation explains the rationale behind thegitingestworkflow, provides instructions on how to use thegenerate-llms-full.pyscript, lists its requirements, and outlines the significant benefits it offers over the previous method.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this 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 updates the process for generating llms-full.txt files by replacing the default plugin-based method with a custom Python script that leverages gitingest for enhanced documentation context and metadata inclusion.
- Introduces a Python script that automatically installs and uses gitingest to generate comprehensive
llms-full.txtfiles - Updates the build process to include the new script while disabling the plugin's built-in generation
- Adds comprehensive documentation explaining the motivation and workflow for the new approach
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| scripts/generate-llms-full.py | New Python script that uses gitingest to generate llms-full.txt with front-matter metadata and directory context |
| scripts/README.md | Documentation explaining the script's purpose, usage, and benefits over the plugin approach |
| package.json | Updated build script to include the new generate-llms-full step with fallback Python commands |
| docusaurus.config.js | Disabled plugin's generateLLMsFullTxt option with reference to new documentation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a new Python script to generate llms-full.txt using gitingest, which is a great improvement for including richer context in the documentation for AI models. The changes are well-structured, and the new README provides excellent documentation. My review includes a few suggestions to improve the robustness of the build script and the code quality of the new Python script.
Description
This PR updates the process for generating
llms-full.txtduring Docusaurus site builds, switching from the default plugin-based method to a custom script that leverages gitingest for richer documentation context. The main changes introduce a new Python script, update build tooling, and provide detailed documentation for this new workflow.Related issues and/or PRs
llms.txtfiles were previously added in Generate llms.txt files on build for LLM reference #1404.Changes made
scripts/generate-llms-full.py, a Python script that installs gitingest if necessary and generatesllms-full.txtwith improved metadata and context for AI models.package.jsonnow runs a newgenerate-llms-fullstep, which executes the Python script to generate a comprehensivellms-full.txtby using gitingest.docusaurus.config.jsto disable the plugin's built-ingenerateLLMsFullTxtoption, clarifying that the new method is preferred and referencing the documentation for details.scripts/README.md, which explains the motivation, usage, requirements, and benefits of the newgenerate-llms-full.pyscript and the gitingest-based workflow.Checklist
Additional notes (optional)
N/A