{"record":{"id":"4efedddf425102c9","repo":"headroomlabs-ai/headroom","slug":"anthropic-package-required-for-llm-judge-install","errorCode":null,"errorMessage":"Anthropic package required for LLM judge. Install with: pip install anthropic","messagePattern":"Anthropic package required for LLM judge\\. Install with: pip install anthropic","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"headroom/evals/memory/judge.py","lineNumber":123,"sourceCode":"        model: Anthropic model to use (default: claude-sonnet-4-20250514).\n        api_key: Anthropic API key (uses ANTHROPIC_API_KEY env var if not provided).\n\n    Returns:\n        A judge function that takes (question, ground_truth, prediction)\n        and returns (score, reasoning).\n\n    Example:\n        judge_fn = create_anthropic_judge()\n        score, reasoning = judge_fn(\n            \"When did Bob start his new job?\",\n            \"March 2024\",\n            \"Bob began working at his new position in early March of 2024\"\n        )\n    \"\"\"\n    try:\n        import anthropic\n    except ImportError as e:\n        raise ImportError(\n            \"Anthropic package required for LLM judge. Install with: pip install anthropic\"\n        ) from e\n\n    client = anthropic.Anthropic(api_key=api_key) if api_key else anthropic.Anthropic()\n\n    def judge(question: str, ground_truth: str, prediction: str) -> tuple[float, str]:\n        prompt = JUDGE_PROMPT.format(\n            question=question,\n            ground_truth=ground_truth,\n            prediction=prediction,\n        )\n\n        response = client.messages.create(\n            model=model,\n            max_tokens=200,\n            messages=[{\"role\": \"user\", \"content\": prompt}],\n        )\n","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/headroomlabs-ai/headroom/blob/322425c43bffde1ed0b64fecf3cf5951565dd82b/headroom/evals/memory/judge.py#L105-L141","documentation":"Error \"Anthropic package required for LLM judge. Install with: pip install anthropic\" thrown in headroomlabs-ai/headroom.","triggerScenarios":"Raised when the memory eval LLM judge is configured with the Anthropic provider but the `anthropic` package is not installed.","commonSituations":"See trigger scenarios.","solutions":["Install the Anthropic package: pip install anthropic","Set ANTHROPIC_API_KEY in the environment before running the judge","Or install the evals extra: pip install headroom-ai[evals]"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"322425c43bffde1ed0b64fecf3cf5951565dd82b","analyzedAt":"2026-08-15T01:03:05.481Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}