Browserbase Haystack Fetcher
Project description
Browserbase Haystack Fetcher
Browserbase is a serverless platform for running headless browsers, it offers advanced debugging, session recordings, stealth mode, integrated proxies and captcha solving.
Installation and setup
- Get an API key from browserbase.com and set it in environment variables (
BROWSERBASE_KEY
). - Install the required dependencies:
pip install browserbase-haystack
Usage
You can load webpages into Haystack using BrowserbaseFetcher
. Optionally, you can set text_content
parameter to convert the pages to text-only representation.
Standalone
from browserbase_haystack import BrowserbaseFetcher
browserbase_fetcher = BrowserbaseFetcher()
browserbase_fetcher.run(urls=["https://example.com"], text_content=False)
In a pipeline
from browserbase_haystack import BrowserbaseFetcher
from haystack import Pipeline
from haystack.components.generators import OpenAIGenerator
from haystack.components.builders import PromptBuilder
prompt_template = (
"Tell me the titles of the given pages. Pages: {{ documents }}"
)
prompt_builder = PromptBuilder(template=prompt_template)
llm = OpenAIGenerator()
pipe = Pipeline()
pipe.add_component("fetcher", self.browserbase_fetcher)
pipe.add_component("prompt_builder", prompt_builder)
pipe.add_component("llm", llm)
pipe.connect("fetcher.documents", "prompt_builder.documents")
pipe.connect("prompt_builder.prompt", "llm.prompt")
result = pipe.run(data={"fetcher": {"urls": ["https://example.com"]}})
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for browserbase_haystack-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4514c4b75c44721fe489e167314ca96e87995edcdba5fff4ef36cdaeddaf189 |
|
MD5 | 678c91c8a3b08442f3891071ae5506fa |
|
BLAKE2b-256 | d91c7baf666ab8f623c5bca207aa2730c04a797ddb83b8a280cf94ce5518f101 |
Close
Hashes for browserbase_haystack-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab3f06af86ea470fa0b9de33fd12cc4ace159896b46d1168caf2f13f816b38e3 |
|
MD5 | 7bdba520cbfb163b291b28abe7c6d195 |
|
BLAKE2b-256 | 13bcb0bf17e028033c2ae018755ffb942035cc6476670716423ecedbd4277c84 |