diff --git a/google/genai/tunings.py b/google/genai/tunings.py index f41b89e17..7c800e196 100644 --- a/google/genai/tunings.py +++ b/google/genai/tunings.py @@ -3844,9 +3844,9 @@ def _get_ipython_shell_name() -> Union[str, Any]: import sys if 'IPython' in sys.modules: - from IPython import get_ipython + from IPython import get_ipython # type: ignore[attr-defined] - return get_ipython().__class__.__name__ + return get_ipython().__class__.__name__ # type: ignore[no-untyped-call] return '' @staticmethod @@ -3964,10 +3964,10 @@ def _display_link( """ - from IPython.display import display - from IPython.display import HTML + from IPython.display import display # type: ignore[attr-defined] + from IPython.display import HTML # type: ignore[attr-defined] - display(HTML(html)) + display(HTML(html)) # type: ignore[no-untyped-call] @staticmethod def display_experiment_button(experiment: str, project: str) -> None: diff --git a/google/genai/types.py b/google/genai/types.py index d5d04ea46..813e7a977 100644 --- a/google/genai/types.py +++ b/google/genai/types.py @@ -9309,10 +9309,10 @@ def show(self) -> None: try: from IPython import display as IPython_display except ImportError: - IPython_display = None + IPython_display = None # type: ignore[assignment] if IPython_display: - IPython_display.display(self._pil_image) + IPython_display.display(self._pil_image) # type: ignore[no-untyped-call] else: img = self._pil_image if img is not None: @@ -11726,11 +11726,11 @@ def show(self) -> None: try: from IPython import display as IPython_display except ImportError: - IPython_display = None + IPython_display = None # type: ignore[assignment] if IPython_display: - IPython_display.display( - IPython_display.Video( + IPython_display.display( # type: ignore[no-untyped-call] + IPython_display.Video( # type: ignore[no-untyped-call] data=self.video_bytes, mimetype=mime_type, embed=True ) )