autogen icon indicating copy to clipboard operation
autogen copied to clipboard

Fix various failure modes when ingesting websites

Open jidodata-ykim opened this issue 1 year ago • 6 comments
trafficstars

Why are these changes needed?

We fixed a few edge cases and improved error handling when ingesting websites:

  • Fixed cases when the ingestion failed and would halt due to a division by zero error.

  • Raises an error now if the save_path is a directory.

  • When accessing a website 404 errors weren't handled correctly.

Related issue number

Not applicable

Checks

  • [x] I've included any doc changes needed for https://microsoft.github.io/autogen/. See https://microsoft.github.io/autogen/docs/Contribute#documentation to build and test documentation locally.
  • [ ] I've added tests (if relevant) corresponding to the changes introduced in this PR.
  • [ ] I've made sure all auto checks have passed.

jidodata-ykim avatar Jan 31 '24 23:01 jidodata-ykim

@microsoft-github-policy-service agree @microsoft-github-policy-service agree [company="JiDo Data UG"]

On Thu, Feb 1, 2024, 08:56 microsoft-github-policy-service[bot] < @.***> wrote:

@jidodata-ykim https://github.com/jidodata-ykim please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.

@microsoft-github-policy-service agree

  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.

@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement Contribution License Agreement

This Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”), and conveys certain license rights to Microsoft Corporation and its affiliates (“Microsoft”) for Your contributions to Microsoft open source projects. This Agreement is effective as of the latest signature date below.

  1. Definitions. “Code” means the computer software code, whether in human-readable or machine-executable form, that is delivered by You to Microsoft under this Agreement. “Project” means any of the projects owned or managed by Microsoft and offered under a license approved by the Open Source Initiative (www.opensource.org). “Submit” is the act of uploading, submitting, transmitting, or distributing code or other content to any Project, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Project for the purpose of discussing and improving that Project, but excluding communication that is conspicuously marked or otherwise designated in writing by You as “Not a Submission.” “Submission” means the Code and any other copyrightable material Submitted by You, including any associated comments and documentation.
  2. Your Submission. You must agree to the terms of this Agreement before making a Submission to any Project. This Agreement covers any and all Submissions that You, now or in the future (except as described in Section 4 below), Submit to any Project.
  3. Originality of Work. You represent that each of Your Submissions is entirely Your original work. Should You wish to Submit materials that are not Your original work, You may Submit them separately to the Project if You (a) retain all copyright and license information that was in the materials as You received them, (b) in the description accompanying Your Submission, include the phrase “Submission containing materials of a third party:” followed by the names of the third party and any licenses or other restrictions of which You are aware, and (c) follow any other instructions in the Project’s written guidelines concerning Submissions.
  4. Your Employer. References to “employer” in this Agreement include Your employer or anyone else for whom You are acting in making Your Submission, e.g. as a contractor, vendor, or agent. If Your Submission is made in the course of Your work for an employer or Your employer has intellectual property rights in Your Submission by contract or applicable law, You must secure permission from Your employer to make the Submission before signing this Agreement. In that case, the term “You” in this Agreement will refer to You and the employer collectively. If You change employers in the future and desire to Submit additional Submissions for the new employer, then You agree to sign a new Agreement and secure permission from the new employer before Submitting those Submissions.
  5. Licenses.
  • Copyright License. You grant Microsoft, and those who receive the Submission directly or indirectly from Microsoft, a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license in the Submission to reproduce, prepare derivative works of, publicly display, publicly perform, and distribute the Submission and such derivative works, and to sublicense any or all of the foregoing rights to third parties.
  • Patent License. You grant Microsoft, and those who receive the Submission directly or indirectly from Microsoft, a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license under Your patent claims that are necessarily infringed by the Submission or the combination of the Submission with the Project to which it was Submitted to make, have made, use, offer to sell, sell and import or otherwise dispose of the Submission alone or with the Project.
  • Other Rights Reserved. Each party reserves all rights not expressly granted in this Agreement. No additional licenses or rights whatsoever (including, without limitation, any implied licenses) are granted by implication, exhaustion, estoppel or otherwise.
  1. Representations and Warranties. You represent that You are legally entitled to grant the above licenses. You represent that each of Your Submissions is entirely Your original work (except as You may have disclosed under Section 3). You represent that You have secured permission from Your employer to make the Submission in cases where Your Submission is made in the course of Your work for Your employer or Your employer has intellectual property rights in Your Submission by contract or applicable law. If You are signing this Agreement on behalf of Your employer, You represent and warrant that You have the necessary authority to bind the listed employer to the obligations contained in this Agreement. You are not expected to provide support for Your Submission, unless You choose to do so. UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, AND EXCEPT FOR THE WARRANTIES EXPRESSLY STATED IN SECTIONS 3, 4, AND 6, THE SUBMISSION PROVIDED UNDER THIS AGREEMENT IS PROVIDED WITHOUT WARRANTY OF ANY KIND, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY OF NONINFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
  2. Notice to Microsoft. You agree to notify Microsoft in writing of any facts or circumstances of which You later become aware that would make Your representations in this Agreement inaccurate in any respect.
  3. Information about Submissions. You agree that contributions to Projects and information about contributions may be maintained indefinitely and disclosed publicly, including Your name and other information that You submit with Your Submission.
  4. Governing Law/Jurisdiction. This Agreement is governed by the laws of the State of Washington, and the parties consent to exclusive jurisdiction and venue in the federal courts sitting in King County, Washington, unless no federal subject matter jurisdiction exists, in which case the parties consent to exclusive jurisdiction and venue in the Superior Court of King County, Washington. The parties waive all defenses of lack of personal jurisdiction and forum non-conveniens.
  5. Entire Agreement/Assignment. This Agreement is the entire agreement between the parties, and supersedes any and all prior agreements, understandings or communications, written or oral, between the parties relating to the subject matter hereof. This Agreement may be assigned by Microsoft.

— Reply to this email directly, view it on GitHub https://github.com/microsoft/autogen/pull/1496#issuecomment-1920199481, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFN43HFFHR2ZAS57QG4JJ53YRLKY7AVCNFSM6AAAAABCT6AADCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRQGE4TSNBYGE . You are receiving this because you were mentioned.Message ID: @.***>

jidodata-ykim avatar Jan 31 '24 23:01 jidodata-ykim

Codecov Report

Attention: 18 lines in your changes are missing coverage. Please review.

Comparison is base (d01063d) 37.79% compared to head (768ece6) 46.08%.

Files Patch % Lines
autogen/retrieve_utils.py 0.00% 17 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1496      +/-   ##
==========================================
+ Coverage   37.79%   46.08%   +8.29%     
==========================================
  Files          50       50              
  Lines        5704     5715      +11     
  Branches     1295     1407     +112     
==========================================
+ Hits         2156     2634     +478     
+ Misses       3377     2870     -507     
- Partials      171      211      +40     
Flag Coverage Δ
unittests 46.07% <0.00%> (+8.27%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Feb 08 '24 12:02 codecov-commenter

Also, please use pre-commit to format the code.

thinkall avatar Feb 08 '24 12:02 thinkall

https://github.com/microsoft/autogen/actions/runs/7829772683/job/21362424800?pr=1496 The code format error can be fixed by using pre-commit.

sonichi avatar Feb 08 '24 21:02 sonichi

@jidodata-ykim thanks for your contribution. A few things besides this PR:

  1. You can join our discord server and comment and link this PR so we can add you related roles to get you notified for feature updates.
  2. You can take a look at other issues on the roadmap for RAG: #1657

ekzhu avatar Feb 13 '24 08:02 ekzhu

⚠️ GitGuardian has uncovered 96 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard. Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
12853598 Triggered Generic High Entropy Secret 79dbb7bc2561713bc11225849e408dc74db1228f test/oai/test_utils.py View secret
10404693 Triggered Generic High Entropy Secret e43a86c78f3f947b6e142b3aaf36e7a9852f7078 test/oai/test_utils.py View secret
10404693 Triggered Generic High Entropy Secret bdb40d77d7be9ea42e5fa28f6e851edf549ef0af test/oai/test_utils.py View secret
10404693 Triggered Generic High Entropy Secret 954ca451f949a4924578bb7e3e93c97ad4ba1dd5 test/oai/test_utils.py View secret
10404693 Triggered Generic High Entropy Secret 79dbb7bc2561713bc11225849e408dc74db1228f test/oai/test_utils.py View secret
10404662 Triggered Generic CLI Secret eff19acf1365e34fe17d9ac0939666f32b3ceda5 .github/workflows/dotnet-release.yml View secret
10404662 Triggered Generic CLI Secret 06a0a5ddb39fb3000e40cb4872741dead9fcb7e0 .github/workflows/dotnet-release.yml View secret
10404662 Triggered Generic CLI Secret 0524c774dda696855e9a8f87fe0b9ed96cce13f6 .github/workflows/dotnet-release.yml View secret
10404662 Triggered Generic CLI Secret d7ea410501cb96bc97a203a0a95431541515f9cc .github/workflows/dotnet-release.yml View secret
10404662 Triggered Generic CLI Secret e43a86c78f3f947b6e142b3aaf36e7a9852f7078 .github/workflows/dotnet-build.yml View secret
10404662 Triggered Generic CLI Secret 841ed315e2f19d79a6b86ed587eb6e0fc4a0c0da .github/workflows/dotnet-release.yml View secret
10404662 Triggered Generic CLI Secret 802f099588bedf1d022b2bba5fb534635df8e6f1 .github/workflows/dotnet-release.yml View secret
10404662 Triggered Generic CLI Secret 9a484d8589761d58940e3c0b79215204ce6a23c1 .github/workflows/dotnet-build.yml View secret
10404662 Triggered Generic CLI Secret e973ac38ea4f7b36687ea03aa44f770d7e2ddcac .github/workflows/dotnet-release.yml View secret
10404662 Triggered Generic CLI Secret 89650e74f572bbc60e9c24e04b4c601616e439c7 .github/workflows/dotnet-release.yml View secret
10404662 Triggered Generic CLI Secret e07b06bc939353dee2afc6dd52c159d6cb3428d5 .github/workflows/dotnet-release.yml View secret
10404662 Triggered Generic CLI Secret abe4c419c45a244e2399508f9ffef606ce6a4685 .github/workflows/dotnet-build.yml View secret
10404662 Triggered Generic CLI Secret 7362fb9cf4f0a6b3e7ae4e97229afad655d5d87b .github/workflows/dotnet-release.yml View secret
12853599 Triggered Generic High Entropy Secret 79dbb7bc2561713bc11225849e408dc74db1228f test/oai/test_utils.py View secret
10404694 Triggered Generic High Entropy Secret e43a86c78f3f947b6e142b3aaf36e7a9852f7078 test/oai/test_utils.py View secret
10404694 Triggered Generic High Entropy Secret 954ca451f949a4924578bb7e3e93c97ad4ba1dd5 test/oai/test_utils.py View secret
10404694 Triggered Generic High Entropy Secret bdb40d77d7be9ea42e5fa28f6e851edf549ef0af test/oai/test_utils.py View secret
10404695 Triggered Generic High Entropy Secret abad9ff4487444324d1916a6b94c8049b4cab9e7 test/oai/test_utils.py View secret
10404695 Triggered Generic High Entropy Secret 954ca451f949a4924578bb7e3e93c97ad4ba1dd5 test/oai/test_utils.py View secret
10404695 Triggered Generic High Entropy Secret c7bb588a684a038dbee7f9dc9afd6d44ce35ac3a test/oai/test_utils.py View secret
10404695 Triggered Generic High Entropy Secret b97b99d4b2cfe735a7aa46258508d4a7cda9cad5 test/oai/test_utils.py View secret
10404695 Triggered Generic High Entropy Secret e43a86c78f3f947b6e142b3aaf36e7a9852f7078 test/oai/test_utils.py View secret
12853600 Triggered Generic High Entropy Secret 79dbb7bc2561713bc11225849e408dc74db1228f test/oai/test_utils.py View secret
12853601 Triggered Generic High Entropy Secret 79dbb7bc2561713bc11225849e408dc74db1228f test/oai/test_utils.py View secret
10493810 Triggered Generic Password 49e8053dd1e5456d3758b4a85f5721e9c9b12e16 notebook/agentchat_pgvector_RetrieveChat.ipynb View secret
10493810 Triggered Generic Password 501610b4fc0c649fa2b1cbf0fd72fa6f14f026d0 notebook/agentchat_pgvector_RetrieveChat.ipynb View secret
10493810 Triggered Generic Password 49e8053dd1e5456d3758b4a85f5721e9c9b12e16 notebook/agentchat_pgvector_RetrieveChat.ipynb View secret
10493810 Triggered Generic Password 501610b4fc0c649fa2b1cbf0fd72fa6f14f026d0 notebook/agentchat_pgvector_RetrieveChat.ipynb View secret
10493810 Triggered Generic Password d422c63596fce7b84e0ef8a7bd6518d5f4336eaf notebook/agentchat_pgvector_RetrieveChat.ipynb View secret
10493810 Triggered Generic Password 97fa339ac749b3c7d51f1b0fae156d41c02b214e notebook/agentchat_pgvector_RetrieveChat.ipynb View secret
10493810 Triggered Generic Password 49e8053dd1e5456d3758b4a85f5721e9c9b12e16 notebook/agentchat_pgvector_RetrieveChat.ipynb View secret
10493810 Triggered Generic Password d422c63596fce7b84e0ef8a7bd6518d5f4336eaf notebook/agentchat_pgvector_RetrieveChat.ipynb View secret
10493810 Triggered Generic Password 97fa339ac749b3c7d51f1b0fae156d41c02b214e notebook/agentchat_pgvector_RetrieveChat.ipynb View secret
10493810 Triggered Generic Password d422c63596fce7b84e0ef8a7bd6518d5f4336eaf notebook/agentchat_pgvector_RetrieveChat.ipynb View secret
10493810 Triggered Generic Password 97fa339ac749b3c7d51f1b0fae156d41c02b214e notebook/agentchat_pgvector_RetrieveChat.ipynb View secret
10493810 Triggered Generic Password 501610b4fc0c649fa2b1cbf0fd72fa6f14f026d0 notebook/agentchat_pgvector_RetrieveChat.ipynb View secret
10404696 Triggered Generic High Entropy Secret 954ca451f949a4924578bb7e3e93c97ad4ba1dd5 test/oai/test_utils.py View secret
10404696 Triggered Generic High Entropy Secret bdb40d77d7be9ea42e5fa28f6e851edf549ef0af test/oai/test_utils.py View secret
10404696 Triggered Generic High Entropy Secret 79dbb7bc2561713bc11225849e408dc74db1228f test/oai/test_utils.py View secret
10404696 Triggered Generic High Entropy Secret e43a86c78f3f947b6e142b3aaf36e7a9852f7078 test/oai/test_utils.py View secret
10422482 Triggered Generic High Entropy Secret 79dbb7bc2561713bc11225849e408dc74db1228f test/oai/test_utils.py View secret
10422482 Triggered Generic High Entropy Secret bdb40d77d7be9ea42e5fa28f6e851edf549ef0af test/oai/test_utils.py View secret
12853602 Triggered Generic High Entropy Secret 79dbb7bc2561713bc11225849e408dc74db1228f test/oai/test_utils.py View secret
11616921 Triggered Generic High Entropy Secret a86d0fde2e667f9177eea55da17312b770c9d76b notebook/agentchat_agentops.ipynb View secret
11616921 Triggered Generic High Entropy Secret 394561b4629222c19d8bb3bc58222fc8813a5833 notebook/agentchat_agentops.ipynb View secret
11616921 Triggered Generic High Entropy Secret 3eac646b8974e1d1be3fde557b055563f56f2f5f notebook/agentchat_agentops.ipynb View secret
11616921 Triggered Generic High Entropy Secret f45b55337aa7f9d6151f21f2c55ba5dc83f95b79 notebook/agentchat_agentops.ipynb View secret
11616921 Triggered Generic High Entropy Secret 65632487224aae2c7faca67de40fd2bda3ad3905 notebook/agentchat_agentops.ipynb View secret
12853598 Triggered Generic High Entropy Secret 2b3a9ae05569d38cfc89d9daa4b1612b8406d178 test/oai/test_utils.py View secret
12853598 Triggered Generic High Entropy Secret c03558f5b2708c31df36666486f54b2714435162 test/oai/test_utils.py View secret
10404693 Triggered Generic High Entropy Secret c03558f5b2708c31df36666486f54b2714435162 test/oai/test_utils.py View secret
10404693 Triggered Generic High Entropy Secret 2b3a9ae05569d38cfc89d9daa4b1612b8406d178 test/oai/test_utils.py View secret
10404693 Triggered Generic High Entropy Secret 0a3c6c49834b4f68c688c1d2e76a5ebb8f7d91e2 test/oai/test_utils.py View secret
10404693 Triggered Generic High Entropy Secret 76f5f5a66532a3b95d03fe0ae8a56a59e43012e1 test/oai/test_utils.py View secret
10404662 Triggered Generic CLI Secret 954ca451f949a4924578bb7e3e93c97ad4ba1dd5 .github/workflows/dotnet-build.yml View secret
12853599 Triggered Generic High Entropy Secret 2b3a9ae05569d38cfc89d9daa4b1612b8406d178 test/oai/test_utils.py View secret
12853599 Triggered Generic High Entropy Secret c03558f5b2708c31df36666486f54b2714435162 test/oai/test_utils.py View secret
10404694 Triggered Generic High Entropy Secret 76f5f5a66532a3b95d03fe0ae8a56a59e43012e1 test/oai/test_utils.py View secret
10404694 Triggered Generic High Entropy Secret 0a3c6c49834b4f68c688c1d2e76a5ebb8f7d91e2 test/oai/test_utils.py View secret
10404695 Triggered Generic High Entropy Secret 3b79cc6fdfa485026262ec44aa5f1f0238bf7c3d test/oai/test_utils.py View secret
10404695 Triggered Generic High Entropy Secret 11baa52155c3846299d39ed0b5a814b33b0eb671 test/oai/test_utils.py View secret
12853600 Triggered Generic High Entropy Secret c03558f5b2708c31df36666486f54b2714435162 test/oai/test_utils.py View secret
12853600 Triggered Generic High Entropy Secret 2b3a9ae05569d38cfc89d9daa4b1612b8406d178 test/oai/test_utils.py View secret
12853601 Triggered Generic High Entropy Secret c03558f5b2708c31df36666486f54b2714435162 test/oai/test_utils.py View secret
12853601 Triggered Generic High Entropy Secret 2b3a9ae05569d38cfc89d9daa4b1612b8406d178 test/oai/test_utils.py View secret
10493810 Triggered Generic Password 3b79cc6fdfa485026262ec44aa5f1f0238bf7c3d notebook/agentchat_pgvector_RetrieveChat.ipynb View secret
10493810 Triggered Generic Password 11baa52155c3846299d39ed0b5a814b33b0eb671 notebook/agentchat_pgvector_RetrieveChat.ipynb View secret
10493810 Triggered Generic Password 11baa52155c3846299d39ed0b5a814b33b0eb671 notebook/agentchat_pgvector_RetrieveChat.ipynb View secret
10493810 Triggered Generic Password 3b79cc6fdfa485026262ec44aa5f1f0238bf7c3d notebook/agentchat_pgvector_RetrieveChat.ipynb View secret
10404696 Triggered Generic High Entropy Secret 0a3c6c49834b4f68c688c1d2e76a5ebb8f7d91e2 test/oai/test_utils.py View secret
10404696 Triggered Generic High Entropy Secret 76f5f5a66532a3b95d03fe0ae8a56a59e43012e1 test/oai/test_utils.py View secret
10404696 Triggered Generic High Entropy Secret c03558f5b2708c31df36666486f54b2714435162 test/oai/test_utils.py View secret
10404696 Triggered Generic High Entropy Secret 2b3a9ae05569d38cfc89d9daa4b1612b8406d178 test/oai/test_utils.py View secret
10422482 Triggered Generic High Entropy Secret 2b3a9ae05569d38cfc89d9daa4b1612b8406d178 test/oai/test_utils.py View secret
10422482 Triggered Generic High Entropy Secret c03558f5b2708c31df36666486f54b2714435162 test/oai/test_utils.py View secret

and 16 others.

đź›  Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

gitguardian[bot] avatar Jul 20 '24 21:07 gitguardian[bot]