Issues encountered when calling the API

When calling predict_sequence using the latest alphagenome package (version 0.6.1), the API consistently fails with the error:

‘str’ object has no attribute ‘to_proto’

Environment:

  • AlphaGenome version: 0.6.1 (latest as of May 2026)

  • Python 3.10

  • Installation: via pip install alphagenome (also tried editable install from source)

  • OS: Linux (Ubuntu-based)

Observed behavior:

  • The dna_client.OutputType enum is correctly identified as <enum 'OutputType'>.

  • The requested_outputs list is explicitly constructed using enum values (e.g., [dna_client.OutputType.RNA_SEQ, dna_client.OutputType.DNASE]), not strings.

  • The ontology_terms list is correctly passed as a list of strings (e.g., ['UBERON:0002048']).

  • Even with hardcoded parameters (bypassing any variable assignment), the same error occurs.

What has been attempted:

  • Reinstalling alphagenome from PyPI with --no-cache-dir.

  • Creating a fresh conda environment with only Python 3.10 and alphagenome.

  • Unsetting all proxy environment variables (http_proxy, https_proxy, all_proxy).

  • Using the official minimal example from the documentation.

  • Verifying that the API key is correctly set via environment variable and is valid (tested with a simple gRPC health check).

Suspect root cause:
The error suggests that somewhere in the internal gRPC serialization path (possibly within the generated protobuf code or a compatibility issue between protobuf, grpcio, and the precompiled *_pb2.py files bundled with alphagenome), an object that is expected to have a .to_proto() method is actually a plain string. This occurs despite the user providing correct enum types.

Note: The same API key and script work for other users or in different environments, indicating the issue is likely specific to this machine’s Python environment or a subtle binary incompatibility in the installed alphagenome package.

Hi @yunlong_li ,

Can you paste the exact predict_sequence call that you’re having trouble with? The ‘str’ object has no attribute ‘to_proto’ error usually means that the wrong args are being passed to the function, rather than anything todo with gRPC internals.