docs: fix auth_tokens.create() docstring to use the real field and type - #2836
docs: fix auth_tokens.create() docstring to use the real field and type#2836arunpshankar wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
The `create()` docstring documents a config field and a type that do not
exist, so all four of its usage examples raise AttributeError if copied:
live_constrained_parameters=types.LiveEphemeralParameters(...)
AttributeError: module 'google.genai.types' has no attribute
'LiveEphemeralParameters'
The field on CreateAuthTokenConfig is `live_connect_constraints` and the
type is `LiveConnectConstraints`, which has the same (model, config)
shape the examples already use - so this is a rename, not a behaviour
change. `LiveEphemeralParameters` appears zero times in types.py.
Also fixes the adjacent typo 'attrubite' -> 'attribute' and lowercases
the sentence continuation, and updates the prose comments that referred
to the old type name and to lockAdditionalFields (the Python field is
`lock_additional_fields`).
Docstring only - no functional change. Verified all four corrected
examples construct against google-genai 2.16.0.
f0a2cd7 to
185b2b4
Compare
|
Two notes from double-checking this before review: 1. The rename is already recorded in this repo.
So the docstring is stale text left behind by a deliberate rename, not a forward reference. 2. Safety of the change: the patch is docstring-only. Parsing both revisions and comparing the ASTs with docstrings stripped gives an identical tree, so there is no functional delta. |
The
auth_tokens.create()docstring documents a config field and a type that do not exist. All four of its usage examples raiseAttributeErrorif copied verbatim.Reproduction
Cause
The field on
CreateAuthTokenConfigislive_connect_constraints, and the type isLiveConnectConstraints:LiveEphemeralParametersappears zero times intypes.py.LiveConnectConstraintshas the same(model, config)shape the examples already use, so this is a rename in the docs rather than a behaviour change.What this PR changes
Docstring only, no functional change:
live_constrained_parameters→live_connect_constraints(5 occurrences)types.LiveEphemeralParameters(→types.LiveConnectConstraints((3 occurrences, Cases 2–4)lockAdditionalFields→lock_additional_fields(the Python field name)attrubite→attribute, and lowercased the sentence continuationVerification
All four corrected examples construct against
google-genai2.16.0:Found while building a Vertex-based teaching repo — the examples were the first thing I reached for when wiring ephemeral tokens for a browser Live client.