NousResearch/hermes-agent · error · RuntimeError

boto3 {boto3.__version__} does not support converse_stream (

Error message

boto3 {boto3.__version__} does not support converse_stream (minimum 1.34.59 required). Upgrade with: pip install --upgrade boto3

What it means

boto3 is installed but older than 1.34.59, the version that introduced converse()/converse_stream() which the Bedrock adapter is built on. The check exists specifically because editable installs into system Python can shadow the venv's pinned boto3 (e.g. Ubuntu 24.04 ships 1.34.46). Unparseable versions are tolerated; only a confirmed-too-old version raises.

Source

Thrown at agent/bedrock_adapter.py:83

    """Import boto3, raising a clear error if not installed or too old."""
    try:
        import boto3
    except ImportError:
        raise ImportError(
            "The 'boto3' package is required for the AWS Bedrock provider. "
            "Install it with: pip install boto3\n"
            "Or install Hermes with Bedrock support: pip install -e '.[bedrock]'"
        )
    # converse() / converse_stream() were added in boto3 1.34.59.
    # When Hermes is installed editable into system Python, the system boto3
    # (e.g. Ubuntu 24.04 ships 1.34.46) may take precedence over the venv
    # version pinned in pyproject.toml.
    try:
        version = tuple(int(x) for x in boto3.__version__.split(".")[:3])
    except (AttributeError, ValueError):
        return boto3  # can't parse — don't block on version check
    if version < _MIN_BOTO3_VERSION:
        raise RuntimeError(
            f"boto3 {boto3.__version__} does not support converse_stream "
            f"(minimum 1.34.59 required). Upgrade with: "
            f"pip install --upgrade boto3"
        )
    return boto3


def _get_bedrock_runtime_client(region: str):
    """Get or create a cached ``bedrock-runtime`` client for the given region.

    Uses the default AWS credential chain (env vars → profile → instance role).
    """
    if region not in _bedrock_runtime_client_cache:
        boto3 = _require_boto3()
        _bedrock_runtime_client_cache[region] = boto3.client(
            "bedrock-runtime", region_name=region,
        )
    return _bedrock_runtime_client_cache[region]

View on GitHub (pinned to c896c09c42)

Solutions

  1. pip install --upgrade 'boto3>=1.34.59'.
  2. If a system boto3 shadows the venv: recreate the venv without system-site-packages, or upgrade the system package.
  3. Verify at runtime: python -c "import boto3; print(boto3.__version__, boto3.__file__)" — the path must be inside the venv.

Example fix

pip install --upgrade 'boto3>=1.34.59'
python -c "import boto3; print(boto3.__version__, boto3.__file__)"
Defensive patterns

Strategy: validation

Validate before calling

import boto3
from functools import reduce
v = tuple(int(x) for x in boto3.__version__.split(".")[:3])
assert v >= (1, 34, 59), f"boto3 {boto3.__version__} too old for converse_stream — upgrade"
assert ".venv" in boto3.__file__ or "site-packages" in boto3.__file__, "system boto3 may shadow the venv"

Try / catch

try:
    from agent.bedrock_adapter import _require_boto3
    _require_boto3()
except RuntimeError as e:
    if "converse_stream" in str(e):
        run("pip install --upgrade 'boto3>=1.34.59'")

Prevention

When it happens

Trigger: boto3.__version__ parses to < (1,34,59) at _require_boto3() time (agent/bedrock_adapter.py:83) — typically system-site-packages shadowing the venv.

Common situations: Editable install into system Python; OS-distributed boto3; long-lived venv with an old pin; CI image with old boto3.

Related errors


AI-assisted analysis of NousResearch/hermes-agent@c896c09c42 (2026-08-14). Data as JSON: /api/errors/d347e4e668f19de5. Report an issue: GitHub.