INNER CODE UNIT · Python
build_specialist
openhackai/OpenHack · openhack/agents/specialists/__init__.py:56
def build_specialist(
vuln_class: str,
target_dir,
session,
model=None,
base_url: str = "",
):
"""Construct a specialist agent for the given class.
Builds the specialist its own LLM client + ToolRegistry (sharing the session so
findings land in one place). XSS-class specialists get a registry with the
stateful browser; `base_url` lets the white-box swarm point the browser/tools at
the live sandbox (default "" → absolute URLs pass through for black-box).
"""
from pathlib import Path
from openhack.agents.llm import LLMClient
from openhack.tools.registry import ToolRegistry