langchain-parallel-web


Namelangchain-parallel-web JSON
Version 0.0.1a0 PyPI version JSON
download
home_pagehttps://github.com/sanjeevhalyal/langchain-parallel-web
SummaryParallelWeb integration for LangChain
upload_time2025-08-24 05:19:18
maintainerNone
docs_urlNone
authorSanjeev Halyal
requires_python<4.0,>=3.9
licenseMIT
keywords langchain parallel web llm ai
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # langchain-parallel-web

LangChain tool and toolkit for Parallel Web search. It exposes a tool that performs web research and returns ranked, compressed excerpts from multiple sources, plus a toolkit to easily wire it into agents.

## Installation

```bash
pip install -U langchain-parallel-web
```

Set your Parallel API key:

```bash
export PARALLEL_API_KEY="your-api-key"
```

You can also pass the key directly to the classes shown below.

## Tool: Parallel Web Search

`ParallelWebTool` exposes the Parallel Web search as a LangChain tool.

```python
from langchain_parallel_web.tools import ParallelWebTool

# Option 1: rely on PARALLEL_API_KEY in env
tool = ParallelWebTool()

# Option 2: pass the key explicitly
# tool = ParallelWebTool(parallel_api_key="your-api-key")

result_json = tool.invoke({
    "objective": "Find when the UN was founded; prefer official sources.",
    "search_queries": [
        "United Nations founding year",
        "When was the UN founded official site"
    ],
})
print(result_json)
```

### Configuration
You can control search behavior via `ParallelWebSearchConfig`.

```python
from langchain_parallel_web.parallel_web_wrapper import ParallelWebSearchConfig
from langchain_parallel_web.tools import ParallelWebTool

config = ParallelWebSearchConfig(
    max_results=10,          # up to 40
    processor="base",        # or "pro"
    max_chars_per_result=1500
)

tool = ParallelWebTool(config=config)
```

## Toolkit: Agent Integration

`ParallelWebToolkit` returns a ready-to-use list of tools for agent setups.

```python
from langchain_parallel_web.toolkits import ParallelWebToolkit

# Pass the key explicitly for the toolkit
toolkit = ParallelWebToolkit(parallel_api_key="your-api-key")

tools = toolkit.get_tools()

# Use `tools` with your LangChain agent or runnable graph
```

## Direct API Wrapper

For lower-level control, call the wrapper directly.

```python
from langchain_parallel_web.parallel_web_wrapper import (
    ParallelWebAPIWrapper,
    ParallelWebSearchInput,
)

wrapper = ParallelWebAPIWrapper()  # uses PARALLEL_API_KEY from env
# or: wrapper = ParallelWebAPIWrapper(parallel_api_key="your-api-key")

payload = ParallelWebSearchInput(
    objective="Summarize key announcements from OpenAI DevDay 2023.",
    search_queries=["OpenAI DevDay 2023 announcements", "OpenAI DevDay keynote summary"],
)

out = wrapper.search(payload)
print(out.model_dump())
```

Async usage is supported:

```python
import asyncio
from langchain_parallel_web.parallel_web_wrapper import (
    ParallelWebAPIWrapper,
    ParallelWebSearchInput,
)

async def main():
    wrapper = ParallelWebAPIWrapper()
    out = await wrapper.asearch(
        ParallelWebSearchInput(
            objective="Latest SEC filing summary for NVDA.",
            search_queries=["NVIDIA latest 10-Q", "NVDA SEC filing"],
        )
    )
    print(out.model_dump())

asyncio.run(main())
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sanjeevhalyal/langchain-parallel-web",
    "name": "langchain-parallel-web",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "langchain, parallel, web, llm, ai",
    "author": "Sanjeev Halyal",
    "author_email": "1448731+sanjeevhalyal@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/9b/32/118883fbe8458516e5c5514c5033e07782f82d5f14c09b8d67d4e25cde9e/langchain_parallel_web-0.0.1a0.tar.gz",
    "platform": null,
    "description": "# langchain-parallel-web\n\nLangChain tool and toolkit for Parallel Web search. It exposes a tool that performs web research and returns ranked, compressed excerpts from multiple sources, plus a toolkit to easily wire it into agents.\n\n## Installation\n\n```bash\npip install -U langchain-parallel-web\n```\n\nSet your Parallel API key:\n\n```bash\nexport PARALLEL_API_KEY=\"your-api-key\"\n```\n\nYou can also pass the key directly to the classes shown below.\n\n## Tool: Parallel Web Search\n\n`ParallelWebTool` exposes the Parallel Web search as a LangChain tool.\n\n```python\nfrom langchain_parallel_web.tools import ParallelWebTool\n\n# Option 1: rely on PARALLEL_API_KEY in env\ntool = ParallelWebTool()\n\n# Option 2: pass the key explicitly\n# tool = ParallelWebTool(parallel_api_key=\"your-api-key\")\n\nresult_json = tool.invoke({\n    \"objective\": \"Find when the UN was founded; prefer official sources.\",\n    \"search_queries\": [\n        \"United Nations founding year\",\n        \"When was the UN founded official site\"\n    ],\n})\nprint(result_json)\n```\n\n### Configuration\nYou can control search behavior via `ParallelWebSearchConfig`.\n\n```python\nfrom langchain_parallel_web.parallel_web_wrapper import ParallelWebSearchConfig\nfrom langchain_parallel_web.tools import ParallelWebTool\n\nconfig = ParallelWebSearchConfig(\n    max_results=10,          # up to 40\n    processor=\"base\",        # or \"pro\"\n    max_chars_per_result=1500\n)\n\ntool = ParallelWebTool(config=config)\n```\n\n## Toolkit: Agent Integration\n\n`ParallelWebToolkit` returns a ready-to-use list of tools for agent setups.\n\n```python\nfrom langchain_parallel_web.toolkits import ParallelWebToolkit\n\n# Pass the key explicitly for the toolkit\ntoolkit = ParallelWebToolkit(parallel_api_key=\"your-api-key\")\n\ntools = toolkit.get_tools()\n\n# Use `tools` with your LangChain agent or runnable graph\n```\n\n## Direct API Wrapper\n\nFor lower-level control, call the wrapper directly.\n\n```python\nfrom langchain_parallel_web.parallel_web_wrapper import (\n    ParallelWebAPIWrapper,\n    ParallelWebSearchInput,\n)\n\nwrapper = ParallelWebAPIWrapper()  # uses PARALLEL_API_KEY from env\n# or: wrapper = ParallelWebAPIWrapper(parallel_api_key=\"your-api-key\")\n\npayload = ParallelWebSearchInput(\n    objective=\"Summarize key announcements from OpenAI DevDay 2023.\",\n    search_queries=[\"OpenAI DevDay 2023 announcements\", \"OpenAI DevDay keynote summary\"],\n)\n\nout = wrapper.search(payload)\nprint(out.model_dump())\n```\n\nAsync usage is supported:\n\n```python\nimport asyncio\nfrom langchain_parallel_web.parallel_web_wrapper import (\n    ParallelWebAPIWrapper,\n    ParallelWebSearchInput,\n)\n\nasync def main():\n    wrapper = ParallelWebAPIWrapper()\n    out = await wrapper.asearch(\n        ParallelWebSearchInput(\n            objective=\"Latest SEC filing summary for NVDA.\",\n            search_queries=[\"NVIDIA latest 10-Q\", \"NVDA SEC filing\"],\n        )\n    )\n    print(out.model_dump())\n\nasyncio.run(main())\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "ParallelWeb integration for LangChain",
    "version": "0.0.1a0",
    "project_urls": {
        "Homepage": "https://github.com/sanjeevhalyal/langchain-parallel-web",
        "Issues": "https://github.com/sanjeevhalyal/langchain-parallel-web/issues",
        "Release Notes": "https://github.com/sanjeevhalyal/langchain-parallel-web/releases",
        "Repository": "https://github.com/sanjeevhalyal/langchain-parallel-web",
        "Source Code": "https://github.com/sanjeevhalyal/langchain-parallel-web"
    },
    "split_keywords": [
        "langchain",
        " parallel",
        " web",
        " llm",
        " ai"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "539a8a53592602faf2c3f469f71250d28da2fa4095cc714ab27af926133dfa48",
                "md5": "ba8a2abdb115f493997ec086d814c759",
                "sha256": "0f813b535116d8b4517fc65ee9bba47121cd5a89a1658093f2278e768584df62"
            },
            "downloads": -1,
            "filename": "langchain_parallel_web-0.0.1a0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ba8a2abdb115f493997ec086d814c759",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 10661,
            "upload_time": "2025-08-24T05:19:17",
            "upload_time_iso_8601": "2025-08-24T05:19:17.036593Z",
            "url": "https://files.pythonhosted.org/packages/53/9a/8a53592602faf2c3f469f71250d28da2fa4095cc714ab27af926133dfa48/langchain_parallel_web-0.0.1a0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9b32118883fbe8458516e5c5514c5033e07782f82d5f14c09b8d67d4e25cde9e",
                "md5": "82249a047e8edc79c08e2f42ed3cdbf7",
                "sha256": "d47f856862877005fca7acf40041bd4b696ecd7c5535f5c276a10df2b61b0d5f"
            },
            "downloads": -1,
            "filename": "langchain_parallel_web-0.0.1a0.tar.gz",
            "has_sig": false,
            "md5_digest": "82249a047e8edc79c08e2f42ed3cdbf7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 9232,
            "upload_time": "2025-08-24T05:19:18",
            "upload_time_iso_8601": "2025-08-24T05:19:18.555175Z",
            "url": "https://files.pythonhosted.org/packages/9b/32/118883fbe8458516e5c5514c5033e07782f82d5f14c09b8d67d4e25cde9e/langchain_parallel_web-0.0.1a0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-24 05:19:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sanjeevhalyal",
    "github_project": "langchain-parallel-web",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "langchain-parallel-web"
}
        
Elapsed time: 1.50014s