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

Draft: community: add pull_md tool for converting URLs to Markdown #29006

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix(pull-md): remove unused imports
  • Loading branch information
chigwell committed Jan 3, 2025
commit e486c649a4fb3721311d21b279d0c90423a069b7
1 change: 0 additions & 1 deletion libs/community/langchain_community/utilities/pull_md.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
"""Utility that calls the Pull.md API for markdown conversion."""

import logging
from typing import Any, Dict

from pydantic import BaseModel
import requests

logger = logging.getLogger(__name__)

Check failure on line 8 in libs/community/langchain_community/utilities/pull_md.py

View workflow job for this annotation

GitHub Actions / cd libs/community / make lint #3.13

Ruff (I001)

langchain_community/utilities/pull_md.py:3:1: I001 Import block is un-sorted or un-formatted

Check failure on line 8 in libs/community/langchain_community/utilities/pull_md.py

View workflow job for this annotation

GitHub Actions / cd libs/community / make lint #3.9

Ruff (I001)

langchain_community/utilities/pull_md.py:3:1: I001 Import block is un-sorted or un-formatted


class PullMdAPIWrapper(BaseModel):
Expand All @@ -29,10 +28,10 @@
HTTPError: An error from the requests library for bad HTTP responses.
"""
try:
from pull_md import pull_markdown # Assuming pull_md is installed in the environment

Check failure on line 31 in libs/community/langchain_community/utilities/pull_md.py

View workflow job for this annotation

GitHub Actions / cd libs/community / make lint #3.13

Ruff (E501)

langchain_community/utilities/pull_md.py:31:89: E501 Line too long (97 > 88)

Check failure on line 31 in libs/community/langchain_community/utilities/pull_md.py

View workflow job for this annotation

GitHub Actions / cd libs/community / make lint #3.9

Ruff (E501)

langchain_community/utilities/pull_md.py:31:89: E501 Line too long (97 > 88)
return pull_markdown(url)

Check failure on line 32 in libs/community/langchain_community/utilities/pull_md.py

View workflow job for this annotation

GitHub Actions / cd libs/community / make lint #3.13

Ruff (I001)

langchain_community/utilities/pull_md.py:31:1: I001 Import block is un-sorted or un-formatted

Check failure on line 32 in libs/community/langchain_community/utilities/pull_md.py

View workflow job for this annotation

GitHub Actions / cd libs/community / make lint #3.9

Ruff (I001)

langchain_community/utilities/pull_md.py:31:1: I001 Import block is un-sorted or un-formatted
except ImportError:
raise ImportError("pull_md package is not installed. Install it with `pip install pull-md`")

Check failure on line 34 in libs/community/langchain_community/utilities/pull_md.py

View workflow job for this annotation

GitHub Actions / cd libs/community / make lint #3.13

Ruff (E501)

langchain_community/utilities/pull_md.py:34:89: E501 Line too long (104 > 88)

Check failure on line 34 in libs/community/langchain_community/utilities/pull_md.py

View workflow job for this annotation

GitHub Actions / cd libs/community / make lint #3.9

Ruff (E501)

langchain_community/utilities/pull_md.py:34:89: E501 Line too long (104 > 88)
except requests.exceptions.RequestException as e:
logger.error(f"Request to Pull.md API failed: {e}")
raise
Expand Down
Loading