+
    ˆåºi+>  ã                  ó  € ^ RI Ht ^ RIt^ RIHtHt ^ RIHu Ht ^ RI	H
t
 ^ RI	Ht ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHt RRRR/R R lltRRRR/R R lltRRRR/R R lltR4R R lltR^2RRRR/R R lltR^2RRRR/R R lltRRRRRRRRR RR!RR"RR#RR$RR%R&R'R(RRRR/R) R* llt]P>                  R4RRRR/R+ R, lll4       t ]P>                  RRRR/R- R. ll4       t R4RRRR/R/ R0 lllt R1 t!R5R2 R3 llt"R# )6é    )ÚannotationsN)ÚAnyÚLiteral)Úprotos)Ú
operations)Úget_default_model_client)Úmodel_types)Úhelper_types)Ú	operation)Úprotobuf_helpers)Úfield_mask_pb2)Úflatten_update_pathsÚclientÚrequest_optionsc               ó$   € V ^8„  d   QhRRRRRR/# )é   Únameúmodel_types.AnyModelNameOptionsr   ú&helper_types.RequestOptionsType | NoneÚreturnz*model_types.Model | model_types.TunedModel© )Úformats   "Úm/Users/igloo/.openclaw/workspace/scratch/fb_ad_env/lib/python3.14/site-packages/google/generativeai/models.pyÚ__annotate__r   !   s(   € ÷ 
ñ 
Ø
)ð
ð <ð	
ð
 0ñ
ó    c               óÚ   € \         P                  ! V 4      p V P                  R4      '       d   \        WVR7      # V P                  R4      '       d   \	        WVR7      # \        RV  24      h)a?  Calls the API to fetch a model by name.

```
import pprint
model = genai.get_model('models/gemini-1.5-flash')
pprint.pprint(model)
```

Args:
    name: The name of the model to fetch. Should start with `models/`
    client: The client to use.
    request_options: Options for the request.

Returns:
    A `types.Model`
úmodels/)r   r   útunedModels/zWInvalid model name: Model names must start with `models/` or `tunedModels/`. Received: )r	   Úmake_model_nameÚ
startswithÚget_base_modelÚget_tuned_modelÚ
ValueError)r   r   r   s   &$$r   Ú	get_modelr$   !   se   € ô, ×&Ò& tÓ,€DØ‡y×!Ò!Ü˜dÀ?ÔSÐSØ	‰˜×	(Ò	(Ü˜tÀOÔTÐTäØeÐfjÐekÐló
ð 	
r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r   z model_types.BaseModelNameOptionsr   r   r   zmodel_types.Modelr   )r   s   "r   r   r   B   s(   € ÷ $'ñ $'Ø
*ð$'ð <ð	$'ð
 ñ$'r   c               ó(  € Vf   / pVf   \        4       p\        P                  ! V 4      p V P                  R4      '       g   \	        RV  24      hVP
                  ! RRV /VB p\        V4      P                  V4      p\        P                  ! R/ VB # )aH  Calls the API to fetch a base model by name.

```
import pprint
model = genai.get_base_model('models/chat-bison-001')
pprint.pprint(model)
```

Args:
    name: The name of the model to fetch. Should start with `models/`
    client: The client to use.
    request_options: Options for the request.

Returns:
    A `types.Model`.
r   zJInvalid model name: Base model names must start with `models/`. Received: r   r   )	r   r	   r   r    r#   r$   ÚtypeÚto_dictÚModel©r   r   r   Úresults   &$$ r   r!   r!   B   s–   € ð, ÒØˆà‚~Ü)Ó+ˆä×&Ò& tÓ,€DØ?‰?˜9×%Ò%ÜØXÐY]ÐX^Ð_ó
ð 	
ð ×ÒÑ; 4Ð;¨?Ñ;€FÜ&‹\×!Ñ! &Ó)€FÜ×ÒÑ&˜vÑ&Ð&r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r   ú!model_types.TunedModelNameOptionsr   r   r   úmodel_types.TunedModelr   )r   s   "r   r   r   i   s(   € ÷ %2ñ %2Ø
+ð%2ð <ð	%2ð
 ñ%2r   c               óô   € Vf   / pVf   \        4       p\        P                  ! V 4      p V P                  R4      '       g   \	        RV  24      hVP
                  ! RRV /VB p\        P                  ! V4      # )a[  Calls the API to fetch a tuned model by name.

```
import pprint
model = genai.get_tuned_model('tunedModels/gemini-1.5-flash')
pprint.pprint(model)
```

Args:
    name: The name of the model to fetch. Should start with `tunedModels/`
    client: The client to use.
    request_options: Options for the request.

Returns:
    A `types.TunedModel`.
r   zPInvalid model name: Tuned model names must start with `tunedModels/`. Received: r   r   )r   r	   r   r    r#   r"   Údecode_tuned_modelr*   s   &$$ r   r"   r"   i   s   € ð, ÒØˆà‚~Ü)Ó+ˆä×&Ò& tÓ,€Dà?‰?˜>×*Ò*ÜØ^Ð_cÐ^dÐeó
ð 	
ð ×#Ò#ÑA¨ÐA°ÑA€Fä×)Ò)¨&Ó1Ð1r   c               ó    € V ^8„  d   QhRRRR/# )r   Úmodelr   r   úglm.ModelServiceClient | Noner   )r   s   "r   r   r   ‘   s   € ÷ ñ Ø*ðØ4Qñr   c                óf  € \        V \        4      '       d7   V P                  R4      '       d   \        WR7      p V P                  pV# T p V# \        V \
        P                  4      '       d   V P                  pV# \        V \
        P                  4      '       d   V P                  pV# \        V \        P                  4      '       d   V P                  pV# \        V \        P                  4      '       d.   \        V RR4      pV'       g   V P                  P                  pV# \        RV  R24      h)z6Calls the API to fetch the base model name of a model.r   )r   Ú
base_modelNz#Invalid model: The provided model 'z‹' is not recognized or supported. Supported types are: str, model_types.TunedModel, model_types.Model, protos.Model, and protos.TunedModel.)Ú
isinstanceÚstrr    r$   r5   r	   Ú
TunedModelr)   r   r   ÚgetattrÚtuned_model_sourceÚ	TypeError)r2   r   r5   s   && r   Úget_base_model_namer<   ‘   s!  € ô
 %œ×ÒØ×Ñ˜N×+Ò+Ü˜eÔ3ˆEØ×)Ñ)ˆJð& Ðð# ‰Jð" Ðô! 
Eœ;×1Ñ1×	2Ò	2Ø×%Ñ%ˆ
ð Ðô 
Eœ;×,Ñ,×	-Ò	-Ø—Z‘Zˆ
ð Ðô 
Eœ6Ÿ<™<×	(Ò	(Ø—Z‘Zˆ
ð Ðô 
Eœ6×,Ñ,×	-Ò	-Ü˜U L°$Ó7ˆ
ßØ×1Ñ1×<Ñ<ˆJð Ðô Ø1°%°ð 9xð xó
ð 	
r   Ú	page_sizec               ó(   € V ^8„  d   QhRRRRRRRR/# )	r   r=   ú
int | Noner   r3   r   r   r   zmodel_types.ModelsIterabler   )r   s   "r   r   r   ¯   s2   € ÷ )ñ )àð)ð *ð)ð <ð	)ð
  ñ)r   c              #  óÐ   "  € Vf   / pVf   \        4       pVP                  ! RRV /VB  F5  p\        V4      P                  V4      p\        P
                  ! R/ VB x € K7  	  R# 5i)av  Calls the API to list all available models.

```
import pprint
for model in genai.list_models():
    pprint.pprint(model)
```

Args:
    page_size: How many `types.Models` to fetch per page (api call).
    client: You may pass a `glm.ModelServiceClient` instead of using the default client.
    request_options: Options for the request.

Yields:
    `types.Model` objects.

Nr=   r   )r   Úlist_modelsr'   r(   r	   r)   ©r=   r   r   r2   s   $$$ r   rA   rA   ¯   se   é € ð. ÒØˆà‚~Ü)Ó+ˆà×#Ò#ÑK¨iÐK¸?ÔKˆÜU“×#Ñ# EÓ*ˆÜ×ÒÑ( %Ñ(Ô(ó Lùó   ‚A$A&c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r   r=   r?   r   r3   r   r   r   zmodel_types.TunedModelsIterabler   )r   s   "r   r   r   Ñ   s2   € ÷ !4ñ !4àð!4ð *ð!4ð <ð	!4ð
 %ñ!4r   c              #  óÐ   "  € Vf   / pVf   \        4       pVP                  ! RRV /VB  F5  p\        V4      P                  V4      p\        P
                  ! V4      x € K7  	  R# 5i)a|  Calls the API to list all tuned models.

```
import pprint
for model in genai.list_tuned_models():
    pprint.pprint(model)
```

Args:
    page_size: How many `types.Models` to fetch per page (api call).
    client: You may pass a `glm.ModelServiceClient` instead of using the default client.
    request_options: Options for the request.

Yields:
    `types.TunedModel` objects.
Nr=   r   )r   Úlist_tuned_modelsr'   r(   r	   r0   rB   s   $$$ r   rF   rF   Ñ   sk   é € ð, ÒØˆà‚~Ü)Ó+ˆà×)Ò)ñ Øðà
ôˆô U“×#Ñ# EÓ*ˆÜ×,Ò,¨UÓ3Ô3óùrC   ÚidÚdisplay_nameÚdescriptionÚtemperatureÚtop_pÚtop_kÚepoch_countÚ
batch_sizeÚlearning_rateÚ	input_keyÚ
text_inputÚ
output_keyÚoutputc                óX   € V ^8„  d   QhRRRRRRRRRRR	R
RR
RRRRRRRR
RRRRRRRRRR/# )r   Úsource_modelr   Útraining_datazmodel_types.TuningDataOptionsrG   z
str | NonerH   rI   rJ   zfloat | NonerK   rL   r?   rM   rN   rO   rP   r7   rR   r   r3   r   r   r   z$operations.CreateTunedModelOperationr   )r   s   "r   r   r   õ   sÌ   € ÷ {Oñ {OØ1ð{Oà0ð{Oð 	ð	{Oð
 ð{Oð ð{Oð ð{Oð ð{Oð ð{Oð ð{Oð ð{Oð  ð{Oð ð{Oð ð{Oð *ð{Oð  <ð!{Oð" *ñ#{Or   c               óV  € Vf   / pVf   \        4       p\        P                  ! V 4      p\        V 4      pVP	                  R4      '       d   RV/p M/VP	                  R4      '       d
   RRVRV//p M\        RV  R24      h\        P                  ! WVR7      p\        P                  ! VV	V
R	7      p\        P                  ! VVR
7      p\        P                  ! R/ V BRVRVRVRVRVRV/B pVP                  ! \        VVR7      3/ VB p\        P                  P                  V4      # )a‚
  Calls the API to initiate a tuning process that optimizes a model for specific data, returning an operation object to track and manage the tuning progress.

Since tuning a model can take significant time, this API doesn't wait for the tuning to complete.
Instead, it returns a `google.api_core.operation.Operation` object that lets you check on the
status of the tuning job, or wait for it to complete, and check the result.

After the job completes you can either find the resulting `TunedModel` object in
`Operation.result()` or `palm.list_tuned_models` or `palm.get_tuned_model(model_id)`.

```
my_id = "my-tuned-model-id"
operation = palm.create_tuned_model(
  id = my_id,
  source_model="models/text-bison-001",
  training_data=[{'text_input': 'example input', 'output': 'example output'},...]
)
tuned_model=operation.result()      # Wait for tuning to finish

palm.generate_text(f"tunedModels/{my_id}", prompt="...")
```

Args:
    source_model: The name of the model to tune.
    training_data: The dataset to tune the model on. This must be either:
      * A `protos.Dataset`, or
      * An `Iterable` of:
        *`protos.TuningExample`,
        * `{'text_input': text_input, 'output': output}` dicts
        * `(text_input, output)` tuples.
      * A `Mapping` of `Iterable[str]` - use `input_key` and `output_key` to choose which
        columns to use as the input/output
      * A csv file (will be read with `pd.read_csv` and handles as a `Mapping`
        above). This can be:
        * A local path as a `str` or `pathlib.Path`.
        * A url for a csv file.
        * The url of a Google Sheets file.
      * A JSON file - Its contents will be handled either as an `Iterable` or `Mapping`
        above. This can be:
        * A local path as a `str` or `pathlib.Path`.
    id: The model identifier, used to refer to the model in the API
      `tunedModels/{id}`. Must be unique.
    display_name: A human-readable name for display.
    description: A description of the tuned model.
    temperature: The default temperature for the tuned model, see `types.Model` for details.
    top_p: The default `top_p` for the model, see `types.Model` for details.
    top_k: The default `top_k` for the model, see `types.Model` for details.
    epoch_count: The number of tuning epochs to run. An epoch is a pass over the whole dataset.
    batch_size: The number of examples to use in each training batch.
    learning_rate: The step size multiplier for the gradient updates.
    client: Which client to use.
    request_options: Options for the request.

Returns:
    A [`google.api_core.operation.Operation`](https://googleapis.dev/python/google-api-core/latest/operation.html)
r   r5   r   r:   Útuned_modelz(Invalid model name: The provided model 'zM' does not match any known model patterns such as 'models/' or 'tunedModels/')rP   rR   )rM   rN   rO   )rV   ÚhyperparametersrH   rI   rJ   rK   rL   Útuning_task)Útuned_model_idrX   r   )r   r	   r   r<   r    r#   Úencode_tuning_datar   ÚHyperparametersÚ
TuningTaskr8   Úcreate_tuned_modelÚdictr   ÚCreateTunedModelOperationÚfrom_core_operation)rU   rV   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rR   r   r   Úsource_model_nameÚbase_model_namerY   rZ   rX   r   s   &&$$$$$$$$$$$$$      r   r_   r_   õ   s}  € ðR ÒØˆà‚~Ü)Ó+ˆä#×3Ò3°LÓAÐÜ)¨,Ó7€OØ×#Ñ# I×.Ò.Ø$Ð&7Ð8‰Ø	×	%Ñ	% n×	5Ò	5à ØÐ0Ø˜oð#ð
‰ô Ø6°|°nð  ERð  Só
ð 	
ô  ×2Ò2Ø°zô€Mô ×,Ò,ØØØ#ô€Oô
 ×#Ò#Ø#Ø'ô€Kô
 ×#Ò#ñ Ø
ñà!ðð  ðð  ð	ð
 ðð ðð  ò€Kð ×)Ò)Ü˜B¨KÔ8ñØ<Kñ€Iô ×/Ñ/×CÑCÀIÓNÐNr   c          
     ó,   € V ^8„  d   QhRRRRRRRRR	R
/# )r   rX   zprotos.TunedModelÚupdatesÚNoner   r3   r   r   r   r.   r   )r   s   "r   r   r   t  s:   € ÷ 	ñ 	Ø"ð	àð	ð *ð		ð
 <ð	ð ñ	r   c               ó   € R # ©Nr   ©rX   rf   r   r   s   &&$$r   Úupdate_tuned_modelrk   s  ó   € ñ 	r   c          
     ó,   € V ^8„  d   QhRRRRRRRRR	R
/# )r   rX   r7   rf   zdict[str, Any]r   r3   r   r   r   r.   r   )r   s   "r   r   r     s:   € ÷ 	ñ 	Øð	àð	ð *ð		ð
 <ð	ð ñ	r   c               ó   € R # ri   r   rj   s   &&$$r   rk   rk   ~  rl   r   c          
     ó,   € V ^8„  d   QhRRRRRRRRR	R
/# )r   rX   zstr | protos.TunedModelrf   zdict[str, Any] | Noner   r3   r   r   r   r.   r   )r   s   "r   r   r   ‰  s:   € ÷ 22ñ 22Ø(ð22à"ð22ð *ð	22ð
 <ð22ð ñ22r   c               ó”  € Vf   / pVf   \        4       p\        V \        4      '       dÇ   T p\        V\        4      '       g#   \	        R\        V4      P                   R24      hVP                  ! RRV/VB p \        V4      p\        P                  ! 4       pVP                  4        F  pVP                  P                  V4       K   	  VP                  4        F  w  rg\        WV4       K  	  M›\        V \         P"                  4      '       dZ   Ve   \%        R4      hV P&                  pVP                  VR7      p\(        P*                  ! VP,                  V P,                  4      pM"\	        R\        V 4      P                   R24      hVP.                  ! \         P0                  ! WR7      3/ VB p	\2        P4                  ! V	4      # )	zeCalls the API to push updates to a specified tuned model where only certain attributes are updatable.z”Invalid argument type: In the function `update_tuned_model(name:str, updates: dict)`, the `updates` argument must be of type `dict`. Received type: Ú.r   z‰Invalid argument: When calling `update_tuned_model(tuned_model:protos.TunedModel, updates=None)`, the `updates` argument must not be set.)r   zºInvalid argument type: In the function `update_tuned_model(tuned_model:dict|protos.TunedModel)`, the `tuned_model` argument must be of type `dict` or `protos.TunedModel`. Received type: )rX   Úupdate_maskr   )r   r6   r7   r`   r;   r'   Ú__name__r"   r   r   Ú	FieldMaskÚkeysÚpathsÚappendÚitemsÚ_apply_updater   r8   r#   r   r   Ú
field_maskÚ_pbrk   ÚUpdateTunedModelRequestr	   r0   )
rX   rf   r   r   r   rz   ÚpathÚvalueÚwasr+   s
   &&$$      r   rk   rk   ‰  sÉ  € ð ÒØˆà‚~Ü)Ó+ˆä+œs×#Ò#ØˆÜ˜'¤4×(Ò(Üð gô  hlð  mtó  hu÷  h~ñ  h~ð  gð  @ð  Aóð ð ×,Ò,ÑJ°$ÐJ¸/ÑJˆä& wÓ/ˆÜ#×-Ò-Ó/ˆ
Ø—L‘L–NˆDØ×Ñ×#Ñ# DÖ)ñ #à"Ÿ=™=ž?‰KˆDÜ˜+¨UÖ3ò +ä	K¤×!2Ñ!2×	3Ò	3ØÒÜð:óð ð
 ×ÑˆØ×$Ñ$¨$Ð$Ó/ˆÜ%×0Ò0°·±¸+¿/¹/ÓJ‰
äðdÜdhÐitÓdu×d~Ñd~Ðcð  @AðBó
ð 	
ð
 ×&Ò&Ü×&Ò&°;ÔWñà
ñ€Fô ×)Ò)¨&Ó1Ð1r   c                ó|   € VP                  R 4      pVRR  F  p\        W4      p K  	  \        WR,          V4       R# )rq   Néÿÿÿÿ)Úsplitr9   Úsetattr)Úthingr}   r~   ÚpartsÚparts   &&&  r   ry   ry   ¾  s7   € ØJ‰Js‹O€EØcr“
ˆÜ˜Ó$Šñ äˆE˜•9˜eÖ$r   c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r   rX   r-   r   r3   r   r   r   rg   r   )r   s   "r   r   r   Å  s0   € ÷ <ñ <Ø2ð<à)ð<ð <ð<ð 
ñ	<r   c                ó‚   € Vf   / pVf   \        4       p\        P                  ! V 4      pVP                  ! RRV/VB  R# )z/Calls the API to delete a specified tuned modelNr   r   )r   r	   r   Údelete_tuned_model)rX   r   r   r   s   &&& r   r‰   r‰   Å  sB   € ð ÒØˆà‚~Ü)Ó+ˆä×&Ò& {Ó3€DØ
×ÒÑ; 4Ð;¨?Ô;r   ri   )NN)#Ú
__future__r   Útypingr   r   Úgoogle.ai.generativelanguageÚaiÚgenerativelanguageÚglmÚgoogle.generativeair   r   Úgoogle.generativeai.clientr   Úgoogle.generativeai.typesr	   r
   Úgoogle.api_corer   r   Úgoogle.protobufr   Úgoogle.generativeai.utilsr   r$   r!   r"   r<   rA   rF   r_   Úoverloadrk   ry   r‰   r   r   r   Ú<module>r—      sû  ðõ #ã ß ç *Ð *å &Ý *Ý ?Ý 1Ý 2Ý %Ý ,Ý *Ý :ð
ð ð
ð ?C÷	
ðB$'ð ð$'ð ?C÷	$'ðN%2ð ð%2ð ?C÷	%2÷Pð<)àð)ð -1ð)ð ?C÷	)ðD!4àð!4ð -1ð!4ð ?C÷	!4ðH{Oð ð	{Oð
  $ð{Oð #ð{Oð !%ð{Oð ð{Oð ð{Oð #ð{Oð "ð{Oð #'ð{Oð "ð{Oð ð{Oð -1ð{Oð  ?C÷!{Oð| ‡ñ	ð -1ð		ð
 ?C÷	ó ð	ð ‡ð	ð -1ð		ð
 ?Cö	ó ð	ñ22ð -1ð	22ð
 ?C÷22ð 22òj%÷<ñ <r   