{"record":{"id":"86e39b1517417974","repo":"Graphify-Labs/graphify","slug":"aws-bedrock-extraction-requires-boto3-run-pip-in","errorCode":null,"errorMessage":"AWS Bedrock extraction requires boto3. Run: pip install graphifyy[bedrock]","messagePattern":"AWS Bedrock extraction requires boto3\\. Run: pip install graphifyy\\[bedrock\\]","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"graphify/llm.py","lineNumber":1686,"sourceCode":"    result[\"finish_reason\"] = resp.choices[0].finish_reason\n    if _response_is_hollow(raw_content, result) and result[\"finish_reason\"] != \"length\":\n        print(\n            \"[graphify] azure returned a hollow response; treating as \"\n            \"truncation so adaptive retry can bisect the chunk.\",\n            file=sys.stderr,\n        )\n        result[\"finish_reason\"] = \"length\"\n    return result\n\n\ndef _call_bedrock(model: str, user_message: str, max_tokens: int = 8192, *, deep_mode: bool = False, images: list[_ImageRef] | None = None) -> dict:\n    \"\"\"Call AWS Bedrock via boto3 Converse API using the standard AWS credential chain.\"\"\"\n    try:\n        import boto3\n        import botocore.config\n        import botocore.exceptions\n    except ImportError as exc:\n        raise ImportError(\n            \"AWS Bedrock extraction requires boto3. Run: pip install graphifyy[bedrock]\"\n        ) from exc\n\n    region = os.environ.get(\"AWS_REGION\") or os.environ.get(\"AWS_DEFAULT_REGION\") or \"us-east-1\"\n    profile = os.environ.get(\"AWS_PROFILE\")\n    session = boto3.Session(profile_name=profile, region_name=region)\n    # Wire GRAPHIFY_API_TIMEOUT into the botocore read timeout. Without an\n    # explicit config, Converse uses botocore's 60s default and a long\n    # generation dies with \"Read timeout on endpoint URL\" no matter what the\n    # env var / --api-timeout is set to — the same gap #1112/#1442 closed for\n    # the claude-cli and secondary-dispatch paths, on the last cloud backend.\n    client = session.client(\n        \"bedrock-runtime\",\n        config=botocore.config.Config(\n            read_timeout=_resolve_api_timeout(),\n            connect_timeout=10,\n            retries={\"max_attempts\": _resolve_max_retries() + 1, \"mode\": \"adaptive\"},\n        ),","sourceCodeStart":1668,"sourceCodeEnd":1704,"githubUrl":"https://github.com/Graphify-Labs/graphify/blob/7fe58b0b0f3873be9a21c30106b8b8527c353aa6/graphify/llm.py#L1668-L1704","documentation":"Raised by `_call_bedrock` when `import boto3` (plus botocore.config/exceptions) fails. The Bedrock backend uses boto3's Converse API with the standard AWS credential chain, so boto3 is a hard dependency for `backend=\"bedrock\"`. The message points at the `graphifyy[bedrock]` extra which bundles it.","triggerScenarios":"Calling `extract_files_direct(..., backend=\"bedrock\")` (or having AWS credentials auto-detected) without boto3 installed in the environment.","commonSituations":"Installing graphify core without extras on a machine with AWS_* env vars set, so `detect_backend()` picks bedrock; CI images without boto3; venv conflicts where boto3 was removed.","solutions":["Install the extra: `pip install graphifyy[bedrock]` (or `pip install boto3`).","Verify `python -c \"import boto3, botocore\"` in the running interpreter.","If you didn't intend Bedrock, unset AWS_* env vars or pass `backend=` explicitly so auto-detection doesn't select it."],"exampleFix":"# before\npip install graphifyy\n\n# after\npip install \"graphifyy[bedrock]\"","handlingStrategy":"validation","validationCode":"import importlib.util\n\nif importlib.util.find_spec(\"boto3\") is None:\n    raise SystemExit(\"bedrock backend needs boto3: pip install graphifyy[bedrock]\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install `graphifyy[bedrock]` on any machine where AWS_* credentials exist — auto-detection will select bedrock.","If AWS env vars are set incidentally (e.g. base images), either install boto3 or pass `backend=` explicitly to avoid bedrock."],"tags":["dependency","import-error","bedrock","aws","installation"],"backgroundTag":null,"analyzedSha":"7fe58b0b0f3873be9a21c30106b8b8527c353aa6","analyzedAt":"2026-08-14T19:23:21.323Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}