Skip to content

Commit 91038f2

Browse files
DeanChensjcopybara-github
authored andcommitted
fix: bypass Protobuf Gencode/Runtime version check in antigravity integration
Set TEMPORARILY_DISABLE_PROTOBUF_VERSION_CHECK environment variable before loading google.antigravity to prevent version errors when installed alongside google-cloud-aiplatform (which caps protobuf at <7.0.0). Co-authored-by: Shangjie Chen <deanchen@google.com> PiperOrigin-RevId: 953000596
1 parent 13bef9c commit 91038f2

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/google/adk/labs/antigravity/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,21 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import os
16+
17+
os.environ.setdefault("TEMPORARILY_DISABLE_PROTOBUF_VERSION_CHECK", "true")
18+
1519
try:
1620
import google.antigravity # noqa: F401
1721
except ImportError as e:
1822
raise ImportError(
1923
"The 'google-antigravity' package is required to use the ADK"
20-
' Antigravity integration. Install it with: pip install'
24+
" Antigravity integration. Install it with: pip install"
2125
' "google-adk[antigravity]"'
2226
) from e
2327

2428
from ._antigravity_agent import AntigravityAgent
2529

2630
__all__ = [
27-
'AntigravityAgent',
31+
"AntigravityAgent",
2832
]

0 commit comments

Comments
 (0)