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

backend: Fix web scrape issue with results format #878

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

tianjing-li
Copy link
Collaborator

@tianjing-li tianjing-li commented Dec 13, 2024

Thank you for contributing to the Cohere Toolkit!

  • PR title: "area: description"

    • Where "area" is whichever of interface, frontend, model, tools, backend, etc. is being modified. Use "docs: ..." for purely docs changes, "infra: ..." for CI changes.
    • Example: "deployment: add Azure model option"
  • PR message: Delete this entire checklist and replace with

    • Description: a description of the change
    • Issue: the issue # it fixes, if applicable
    • Dependencies: any dependencies required for this change
  • Add tests and docs: Please include testing and documentation for your changes

  • Lint and test: Run make lint and make run-tests

AI Description

The PR introduces a new list, results, to store the data extracted from the web scraping process. This change is made to handle different content types, such as PDF and HTML, and return a list of results instead of individual data.

Changes:

  • A new list, results, is initialized at the beginning of the handle_response function.
  • The PDF content handling now appends a dictionary with the text and URL to the results list.
  • The HTML content handling appends the extracted data to the results list.
  • The function now returns the results list instead of individual data.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 78.19%. Comparing base (f370c46) to head (4b28aac).

Files with missing lines Patch % Lines
src/backend/tools/web_scrape.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #878      +/-   ##
==========================================
- Coverage   78.21%   78.19%   -0.02%     
==========================================
  Files         259      259              
  Lines       11088    11090       +2     
==========================================
  Hits         8672     8672              
- Misses       2416     2418       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tianjing-li tianjing-li merged commit 925f3c2 into main Dec 13, 2024
8 checks passed
@tianjing-li tianjing-li deleted the resolve-web-scrape branch December 13, 2024 18:27
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.

3 participants