Integraties
CrewAI
Geef CrewAI-agents een Thunderbit-aangedreven web-research-tool
CrewAI-agents hebben verse, schone webcontent als input nodig. Wikkel /distill in als CrewAI-Tool zodat elke Agent in de crew on demand URL's kan lezen.
Installatie
pip install crewai httpxCustom Tool
from crewai.tools import BaseTool
import httpx
API = "https://openapi.thunderbit.com/openapi/v1"
H = {"Authorization": "Bearer YOUR_API_KEY"}
class ReadUrlTool(BaseTool):
name: str = "read_url"
description: str = (
"Fetch a URL and return clean Markdown. Use for any web research task: "
"docs, articles, product pages, search results."
)
def _run(self, url: str) -> str:
resp = httpx.post(f"{API}/distill",
headers=H,
json={"url": url, "renderMode": "basic"},
timeout=60.0)
resp.raise_for_status()
return resp.json()["data"]["markdown"]Inhaken op een Crew
from crewai import Agent, Task, Crew
researcher = Agent(
role="Web Researcher",
goal="Gather authoritative information from public web pages",
backstory="Skilled at distilling long pages into key facts.",
tools=[ReadUrlTool()],
)
task = Task(
description="Research how vector databases compare in 2026.",
expected_output="A concise comparison table.",
agent=researcher,
)
Crew(agents=[researcher], tasks=[task]).kickoff()Tips
- Voor multi-source-onderzoek: stel
/batch/distillbeschikbaar als tweede Tool (read_urls) zodat de Agent kan uitwaaieren - Beperk teruggegeven Markdown tot ~8k tokens voordat je het aan de Agent geeft — voorkom context-bloat
Gerelateerd
Deze integratie wordt uitgebreid met multi-agent crew-templates — kom snel terug.