From 15b4a0b1ad191c1f8f34a12753ab888bd41ba9ce Mon Sep 17 00:00:00 2001 From: Wanlin Du Date: Fri, 21 Aug 2026 17:39:29 -0700 Subject: [PATCH] chore: enable the python static typecheck for environment api PiperOrigin-RevId: 968790561 --- google/genai/__init__.py | 6 +++--- google/genai/environments.py | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 google/genai/environments.py diff --git a/google/genai/__init__.py b/google/genai/__init__.py index e9d37f6bb..fc030b398 100644 --- a/google/genai/__init__.py +++ b/google/genai/__init__.py @@ -25,12 +25,12 @@ __version__ = version.__version__ -__all__ = ['Client', 'interactions', 'types'] +__all__ = ['Client', 'environments', 'interactions', 'types'] def __getattr__(name: str) -> Any: - if name == 'interactions': - module = importlib.import_module('.interactions', __name__) + if name in {'environments', 'interactions'}: + module = importlib.import_module(f'.{name}', __name__) globals()[name] = module return module raise AttributeError(f'module {__name__!r} has no attribute {name!r}') diff --git a/google/genai/environments.py b/google/genai/environments.py new file mode 100644 index 000000000..1146ee27d --- /dev/null +++ b/google/genai/environments.py @@ -0,0 +1,21 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +"""Expose Google GenAI environment types.""" + +from ._gaos.types.environments import * # noqa: F401,F403 +from ._gaos.types.environments import __all__ as _environments_all + +__all__ = list(_environments_all)