Skip to main content

ihyee-langchain

LangChain tools for the ihyee web intelligence API.

Search the web, fetch specific URLs, and render JavaScript-heavy pages -- all as LangChain tools that plug directly into your agents and chains.

Installation

pip install ihyee-langchain

Quick start

from ihyee_langchain import IhyeeSearchTool

tool = IhyeeSearchTool(api_key="your-ihyee-api-key")
result = tool.invoke("transformer architecture explained")
print(result)

Tools

IhyeeSearchTool

Search the web and return extracted, summarized content from top results.

from ihyee_langchain import IhyeeSearchTool

tool = IhyeeSearchTool(
    api_key="your-key",   # or set IHYEE_API_KEY env var
    max_results=5,        # number of results (default: 5)
    content_mode="both",  # "text", "links", or "both" (default: "both")
)

result = tool.invoke("latest developments in quantum computing")

IhyeeFetchTool

Fetch and extract content from specific URLs.

from ihyee_langchain import IhyeeFetchTool

tool = IhyeeFetchTool(api_key="your-key")

# Single URL
result = tool.invoke("https://example.com/article")

# Multiple URLs (comma-separated)
result = tool.invoke("https://example.com/page1, https://example.com/page2")

IhyeeRenderTool

Render JavaScript-heavy pages (SPAs, dynamic content) using a headless browser.

from ihyee_langchain import IhyeeRenderTool

tool = IhyeeRenderTool(
    api_key="your-key",
    wait_for="networkidle",    # "networkidle", "domcontentloaded", or "load"
    timeout_ms=30000,          # max wait time in ms
)

result = tool.invoke("https://spa.example.com")

Configuration

All tools accept these parameters:

Parameter Description Default
api_key ihyee API key. Falls back to IHYEE_API_KEY env var. None
content_mode What to extract: "text", "links", or "both". "both"

IhyeeSearchTool additionally accepts:

Parameter Description Default
max_results Number of search results to return. 5

IhyeeRenderTool additionally accepts:

Parameter Description Default
wait_for Page load strategy: "networkidle", "domcontentloaded", or "load". "networkidle"
timeout_ms Maximum render wait time in milliseconds. 30000

Usage with LangChain agents

from langchain_openai import ChatOpenAI
from langchain.agents import AgentExecutor, create_tool_calling_agent
from langchain_core.prompts import ChatPromptTemplate
from ihyee_langchain import IhyeeSearchTool, IhyeeFetchTool

tools = [IhyeeSearchTool(), IhyeeFetchTool()]
llm = ChatOpenAI(model="gpt-4o")

prompt = ChatPromptTemplate.from_messages([
    ("system", "You are a helpful research assistant."),
    ("human", "{input}"),
    ("placeholder", "{agent_scratchpad}"),
])

agent = create_tool_calling_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools)

result = executor.invoke({"input": "What is the transformer architecture?"})
print(result["output"])

Usage with LangGraph

from langchain_openai import ChatOpenAI
from langgraph.prebuilt import create_react_agent
from ihyee_langchain import IhyeeSearchTool, IhyeeFetchTool

tools = [IhyeeSearchTool(), IhyeeFetchTool()]
agent = create_react_agent(ChatOpenAI(model="gpt-4o"), tools)

result = agent.invoke({
    "messages": [("user", "What is the transformer architecture?")]
})

for msg in result["messages"]:
    print(msg.content)

Environment variables

Variable Description
IHYEE_API_KEY Default API key for all tools when api_key is not passed explicitly.

License

MIT

Metadata

Release files for ihyee-langchain 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ihyee-langchain 1.2.0
File Size Uploaded
ihyee_langchain-1.2.0.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ihyee-langchain 1.2.0
File Interpreter ABI Platform
ihyee_langchain-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.4 kB

Release files / ihyee_langchain-1.2.0.tar.gz

Download URL ihyee_langchain-1.2.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e2629c0b7c0db6e2674f54c399dc372434a64724f3f22763da7b367be0ff280b
BLAKE2b-256 checksum
How to use checksums
eb16107875073f9c6a5db77c69f74e94f04dee27ff9f9fa6a1b08415dffb7ea0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / ihyee_langchain-1.2.0-py3-none-any.whl

Download URL ihyee_langchain-1.2.0-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c36bad404307f6bdee5acdd8437fa9a7ca3965192f45f110738d4a240f93a237
BLAKE2b-256 checksum
How to use checksums
61a7a79aacec68982e4700ff114db8ee5169d01690118f794f0a000385389268
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page