ParallelExtractTool()Parallel Extract Tool.
Calls Parallel's Extract API to pull clean, structured content from web pages. Returns a compact summary string the LLM sees and the full structured response as a tool artifact.
Setup:
Install langchain-parallel and set environment variable
PARALLEL_API_KEY.
pip install -U langchain-parallel
export PARALLEL_API_KEY="your-api-key"
Key init args:
api_key: Optional[SecretStr]
Parallel API key. If not provided, will be read from
PARALLEL_API_KEY env var.
base_url: str
Base URL for Parallel API. Defaults to "https://api.parallel.ai".
max_chars_per_extract: Optional[int]
Tool-wide default cap on full_content size (per URL). Only applied
when full_content is passed as True (a settings object always
wins).
Instantiation:
from langchain_parallel import ParallelExtractTool
tool = ParallelExtractTool()
Invocation:
result = tool.invoke({
"urls": ["https://en.wikipedia.org/wiki/Artificial_intelligence"],
"search_objective": "Main applications of AI",
"full_content": False,
})
for r in result:
print(r["url"], r.get("title"))
Async:
result = await tool.ainvoke({"urls": [...]})
Response shape (list[dict]):
Each item carries url, title, optional publish_date, and
either excerpts (always present in v1) and/or full_content.
Errors carry error_type and http_status_code.