@@ -77,6 +77,7 @@ def __init__( # pyright: ignore[reportMissingSuperCall]
7777 location : str | None = None ,
7878 activity_config : ActivityConfig | None = None ,
7979 ) -> None :
80+ """Initialize without calling super (no HTTP clients needed)."""
8081 # Do NOT call super().__init__() — it creates HTTP clients, loads
8182 # credentials, etc. We only set the properties the SDK's request
8283 # formatting code accesses.
@@ -164,6 +165,7 @@ async def async_request(
164165 request_dict : dict [str , object ],
165166 http_options : HttpOptionsOrDict | None = None ,
166167 ) -> SdkHttpResponse :
168+ """Dispatch an async API request through a Temporal activity."""
167169 config : ActivityConfig = {** self ._activity_config }
168170 if "summary" not in config :
169171 # Default summary is the API path (e.g. "models/gemini-2.5-flash:generateContent").
@@ -192,6 +194,7 @@ def request(
192194 request_dict : dict [str , object ],
193195 http_options : HttpOptionsOrDict | None = None ,
194196 ) -> SdkHttpResponse :
197+ """Raise — sync requests not supported in workflows."""
195198 raise RuntimeError (
196199 "Synchronous requests are not supported in Temporal workflows. "
197200 "Use the AsyncClient returned by gemini_client() instead."
@@ -204,6 +207,7 @@ def request_streamed(
204207 request_dict : dict [str , object ],
205208 http_options : HttpOptionsOrDict | None = None ,
206209 ) -> Any :
210+ """Raise — sync streaming not supported in workflows."""
207211 raise RuntimeError (
208212 "Synchronous streaming is not supported in Temporal workflows. "
209213 "Use the AsyncClient returned by gemini_client() instead."
@@ -216,6 +220,7 @@ async def async_request_streamed(
216220 request_dict : dict [str , object ],
217221 http_options : HttpOptionsOrDict | None = None ,
218222 ) -> Any :
223+ """Dispatch a streamed request, batching chunks in the activity."""
219224 config : ActivityConfig = {** self ._activity_config }
220225 if "summary" not in config :
221226 config ["summary" ] = f"{ http_method .upper ()} { path } "
@@ -247,21 +252,25 @@ async def _yield_chunks():
247252 # so we raise here to catch any unexpected direct usage.
248253
249254 def upload_file (self , * args : Any , ** kwargs : Any ) -> Any :
255+ """Raise — use client.files.upload() instead."""
250256 raise NotImplementedError (
251257 "Use client.files.upload() instead of the internal upload_file() method."
252258 )
253259
254260 async def async_upload_file (self , * args : Any , ** kwargs : Any ) -> Any :
261+ """Raise — use client.files.upload() instead."""
255262 raise NotImplementedError (
256263 "Use client.files.upload() instead of the internal async_upload_file() method."
257264 )
258265
259266 def download_file (self , * args : Any , ** kwargs : Any ) -> Any :
267+ """Raise — use client.files.download() instead."""
260268 raise NotImplementedError (
261269 "Use client.files.download() instead of the internal download_file() method."
262270 )
263271
264272 async def async_download_file (self , * args : Any , ** kwargs : Any ) -> Any :
273+ """Raise — use client.files.download() instead."""
265274 raise NotImplementedError (
266275 "Use client.files.download() instead of the internal async_download_file() method."
267276 )
0 commit comments