{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "ahmadhassan-bted-autoswarm-shadow-adapter--embed-custom-agent-as-shadow-worker",
 "repo": "AhmadHassan-BTed/AutoSwarm-Shadow-Adapter",
 "repo_url": "https://github.com/AhmadHassan-BTed/AutoSwarm-Shadow-Adapter",
 "repo_slug": "ahmadhassan-bted-autoswarm-shadow-adapter",
 "title": "Plug a private agent into the shadow queue",
 "page_title": "How to plug a private agent into the shadow queue with Auto Swarm Shadow Adapter",
 "summary": "Use the ShadowWorker Python class to run your own handler against parked tasks.",
 "who": "A developer with a private model or internal database who wants AutoSwarm's human-in-the-loop queue to hand tasks to custom code.",
 "problem": "Off-the-shelf providers do not cover a private model, so a custom handler is needed to process parked tasks from the same queue.",
 "outcome": "A Python script connects as a ShadowWorker, calls your custom_handler for each task, and returns the handler's output as the deliverable.",
 "steps": [
  "Install the adapter package from PyPI (inferred: `pip install AutoSwarm-shadow-adapter`). (inferred, check the README)",
  "Write an async function `my_local_agent(task: dict) -> str` that returns the result for the task.",
  "Create `ShadowWorker(server_url=..., username=..., password=..., role=..., custom_handler=my_local_agent)` with your server and account details. (inferred, check the README)",
  "Run `asyncio.run(worker.run_forever())` so the worker keeps polling the queue.",
  "Check the submitted outputs in the React portal or the store."
 ],
 "agent_prompt": "Use the repo AhmadHassan-BTed/AutoSwarm-Shadow-Adapter to build a ShadowWorker with a custom_handler that calls <private model or database> for the <role> role. Expected output: a Python script that runs forever and returns one string per task. Verify that the handler's returned text appears as the deliverable for a parked task.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "2 hours",
 "basis": "readme",
 "caveat": "The README's SDK example uses a placeholder password, so real credentials must be set separately and the install command is not shown in the README.",
 "category": "Work and operations",
 "tags": [
  "Work and operations"
 ],
 "lang": "python",
 "requirements": [
  "A working AutoSwarm install (the README links to HKUDS/AutoSwarm)",
  "Python",
  "A SHADOW_JWT_SECRET of at least 32 characters",
  "Access to a local model server (Ollama) or an API key for Anthropic or OpenAI, depending on the use case"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.7,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/ahmadhassan-bted-autoswarm-shadow-adapter/embed-custom-agent-as-shadow-worker/",
 "md": "https://dedupedai.com/use-cases/ahmadhassan-bted-autoswarm-shadow-adapter/embed-custom-agent-as-shadow-worker/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/ahmadhassan-bted-autoswarm-shadow-adapter--embed-custom-agent-as-shadow-worker.json",
 "api_version": "v1"
}
