File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -940,7 +940,16 @@ async def connect(
940940 )
941941 method = 'BidiGenerateContentConstrained'
942942 key_name = 'access_token'
943-
943+ if version != 'v1alpha' :
944+ warnings .warn (
945+ message = (
946+ "The SDK's ephemeral token support is in v1alpha only."
947+ 'Please use client = genai.Client(api_key=token.name, '
948+ 'http_options=types.HttpOptions(api_version="v1alpha"))'
949+ ' before session connection.'
950+ ),
951+ category = errors .ExperimentalWarning ,
952+ )
944953 uri = f'{ base_url } /ws/google.ai.generativelanguage.{ version } .GenerativeService.{ method } ?{ key_name } ={ api_key } '
945954 headers = self ._api_client ._http_options .headers
946955
Original file line number Diff line number Diff line change @@ -284,14 +284,18 @@ class AsyncTokens(_api_module.BaseModule):
284284 async def create (
285285 self , * , config : Optional [types .CreateAuthTokenConfigOrDict ] = None
286286 ) -> types .AuthToken :
287- """Creates an auth token asynchronously.
287+ """Creates an auth token asynchronously. Support in v1alpha only.
288288
289289 Args:
290290 config (CreateAuthTokenConfig): Optional configuration for the request.
291291
292292 Usage:
293293
294294 .. code-block:: python
295+ client = genai.Client(
296+ api_key=API_KEY,
297+ http_options=types.HttpOptions(api_version='v1alpha'),
298+ )
295299
296300 auth_token = await client.aio.tokens.create(
297301 config=types.CreateAuthTokenConfig(
You can’t perform that action at this time.
0 commit comments