Conversation
This commit refactors the README files to align with the project's new monorepo structure. The root README.md has been made more concise, providing a high-level overview of the project and linking to the package-specific READMEs for more detailed information. The README.md files for the `pdf-anonymizer-core` and `pdf-anonymizer-cli` packages have been updated to provide more focused installation and usage instructions relevant to their respective packages within the monorepo.
Summary of ChangesHello @leo-gan, 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! This pull request focuses on a comprehensive refactor and update of the project's documentation across its main README and the READMEs for the Highlights
Using Gemini Code AssistThe 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 by creating a comment using either
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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. 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
|
There was a problem hiding this comment.
Code Review
This pull request refactors the documentation to better align with the project's monorepo structure. The changes significantly improve the organization by moving detailed information from the root README.md to the respective package READMEs. While this is a good direction, the simplification has led to the omission of some critical user information and introduced an error in a code example. My review focuses on restoring the missing details regarding output files and logging, correcting the inaccurate environment setup instructions, and fixing the broken code example in the core library's documentation.
| # Example of programmatic usage | ||
| text, mapping = anonymize_file( | ||
| file_path="/path/to/file.pdf", | ||
| characters_to_anonymize=100_000, | ||
| prompt_template=detailed.prompt_template, | ||
| model_name="gemini-2.5-flash", # or local models like "gemma:7b", "phi4-mini" | ||
| anonymized_entities=None, # or list like ["PERSON", "EMAIL"] | ||
| model_name="gemini-2.5-flash" | ||
| ) | ||
|
|
||
| if text and mapping: | ||
| print("Anonymized Text:", text) | ||
| print("Mapping:", mapping) |
There was a problem hiding this comment.
This code example for anonymize_file is incorrect and will raise a TypeError because the required characters_to_anonymize argument is missing.
Additionally, the example doesn't clarify the structure of the returned mapping dictionary (original -> placeholder), which is crucial for developers using this function. The previous README version contained this information, and it should be restored.
| # Example of programmatic usage | |
| text, mapping = anonymize_file( | |
| file_path="/path/to/file.pdf", | |
| characters_to_anonymize=100_000, | |
| prompt_template=detailed.prompt_template, | |
| model_name="gemini-2.5-flash", # or local models like "gemma:7b", "phi4-mini" | |
| anonymized_entities=None, # or list like ["PERSON", "EMAIL"] | |
| model_name="gemini-2.5-flash" | |
| ) | |
| if text and mapping: | |
| print("Anonymized Text:", text) | |
| print("Mapping:", mapping) | |
| # Example of programmatic usage | |
| text, mapping = anonymize_file( | |
| file_path="/path/to/file.pdf", | |
| characters_to_anonymize=100_000, # This argument is required | |
| prompt_template=detailed.prompt_template, | |
| model_name="gemini-2.5-flash" | |
| ) | |
| if text and mapping: | |
| print("Anonymized Text:", text) | |
| # Note: mapping is original -> placeholder | |
| print("Mapping:", mapping) |
| ## Environment Variables | ||
|
|
||
| - `packages/pdf-anonymizer-cli/.env` | ||
| The CLI will automatically load a `.env` file from the current directory or any parent directory. For consistency, it's recommended to place a single `.env` file at the root of the repository. |
There was a problem hiding this comment.
The description of how the .env file is loaded is misleading. The cli.py code explicitly loads the .env file from the packages/pdf-anonymizer-cli directory; it does not search parent directories. This documentation should be updated to reflect the actual behavior to avoid user confusion.
| The CLI will automatically load a `.env` file from the current directory or any parent directory. For consistency, it's recommended to place a single `.env` file at the root of the repository. | |
| The CLI loads environment variables from a `.env` file located in the `packages/pdf-anonymizer-cli` directory. |
| # OLLAMA_HOST="http://localhost:11434" | ||
| ``` | ||
|
|
||
| ## Usage |
There was a problem hiding this comment.
The Usage section is missing key information about where the output files are stored for both run and deanonymize commands. This was present in the previous documentation and is crucial for users. Please add 'Outputs' subsections to both Anonymize and Deanonymize sections detailing the file paths (e.g., data/anonymized, data/mappings, data/deanonymized, data/stats).
|
|
||
| - For Google models, ensure `GOOGLE_API_KEY` is set; otherwise the command will exit with an error. | ||
| - Logs are written to `app.log` alongside console output. | ||
| This will create a deanonymized version of the file at `data/deanonymized/document.deanonymized.md`. No newline at end of file |
There was a problem hiding this comment.
| - Local models use `ollama`. Ensure the model is pulled/running (e.g., `ollama pull phi`). | ||
| print(f"Default model: {DEFAULT_MODEL_NAME}") | ||
| print(f"Available Google models: {[m.value for m in ModelName if 'gemini' in m.value]}") | ||
| ``` No newline at end of file |
There was a problem hiding this comment.
No description provided.