genai.tune.tune_service module¶
- class genai.tune.tune_service.TuneService[source]¶
 Bases:
BaseService[BaseServiceConfig,BaseServiceServices]- create(*, model_id, name, task_id, training_file_ids, tuning_type, validation_file_ids=None, parameters=None)[source]¶
 - Raises:
 ApiResponseException – In case of a known API error.
ApiNetworkException – In case of unhandled network error.
ValidationError – In case of provided parameters are invalid.
- Parameters:
 model_id (str)
name (str)
task_id (str)
training_file_ids (list[str])
tuning_type (str | Enum)
validation_file_ids (list[str] | None)
parameters (dict | TuneParameters | None)
- Return type:
 
- create_from_file(*, name, file_id)[source]¶
 - Raises:
 ApiResponseException – In case of a known API error.
ApiNetworkException – In case of unhandled network error.
ValidationError – In case of provided parameters are invalid.
- Parameters:
 name (str)
file_id (str)
- Return type:
 
- delete(id)[source]¶
 - Raises:
 ApiResponseException – In case of a known API error.
ApiNetworkException – In case of unhandled network error.
- Parameters:
 id (str)
- Return type:
 None
- list(*, limit=None, offset=None, status=None, search=None)[source]¶
 - Raises:
 ApiResponseException – In case of a known API error.
ApiNetworkException – In case of unhandled network error.
- Parameters:
 limit (int | None)
offset (int | None)
status (TuneStatus | None)
search (str | None)
- Return type:
 
- read(*, id, type)[source]¶
 Download tune assets.
- Raises:
 ValueError – if the tune status is not ‘COMPLETED’.
ApiResponseException – In case of a known API error.
ApiNetworkException – In case of unhandled network error.
ValidationError – In case of provided parameters are invalid.
- Parameters:
 id (str)
type (str | TuneAssetType)
- Return type:
 bytes
- retrieve(id)[source]¶
 - Raises:
 ApiResponseException – In case of a known API error.
ApiNetworkException – In case of unhandled network error.
- Parameters:
 id (str)
- Return type:
 
- types()[source]¶
 - Raises:
 ApiResponseException – In case of a known API error.
ApiNetworkException – In case of unhandled network error.
- Return type: