mirror of
https://github.com/hwchase17/langchain.git
synced 2026-01-24 05:50:18 +00:00
x
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Dict, List, Literal, Mapping, Optional, Union
|
||||
|
||||
import itertools
|
||||
from langchain.chains.research.download import AutoDownloadHandler, DownloadHandler
|
||||
from typing import Any, Dict, List, Literal, Mapping, Optional, Union
|
||||
|
||||
from langchain.base_language import BaseLanguageModel
|
||||
from langchain.callbacks.manager import (
|
||||
@@ -12,6 +10,7 @@ from langchain.callbacks.manager import (
|
||||
)
|
||||
from langchain.chains.base import Chain
|
||||
from langchain.chains.llm import LLMChain
|
||||
from langchain.chains.research.download import AutoDownloadHandler, DownloadHandler
|
||||
from langchain.chains.research.readers import DocReadingChain, ParallelApplyChain
|
||||
from langchain.chains.research.search import GenericSearcher
|
||||
from langchain.document_loaders.parsers.html.markdownify import MarkdownifyHTMLParser
|
||||
|
||||
@@ -14,7 +14,7 @@ Downloading is batched by default to allow efficient parallelization.
|
||||
import abc
|
||||
import asyncio
|
||||
import mimetypes
|
||||
from typing import Any, List, Sequence, Optional
|
||||
from typing import Any, List, Optional, Sequence
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
"""Tests for the downloader."""
|
||||
from langchain.chains.research.fetch import (
|
||||
AutoDownloadHandler,
|
||||
PlaywrightDownloadHandler,
|
||||
RequestsDownloadHandler,
|
||||
from langchain.chains.research.download import (
|
||||
_is_javascript_required,
|
||||
)
|
||||
|
||||
@@ -22,17 +19,11 @@ def test_is_javascript_required():
|
||||
assert _is_javascript_required(
|
||||
"""
|
||||
<html>
|
||||
<body>
|
||||
<script>
|
||||
console.log("Javascript is required.");
|
||||
</script>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
def test_requests_handler():
|
||||
"""Test that the requests handler is working."""
|
||||
handler = RequestsDownloadHandler()
|
||||
fetch = handler.download(["https://www.google.com"])
|
||||
|
||||
Reference in New Issue
Block a user