module aixplain.modules.model.utility_model
Copyright 2024 The aiXplain SDK authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Author: Thiago Castro Ferreira, Shreyas Sharma and Lucas Pavanelli Date: November 25th 2024 Description: Utility Model Class
class UtilityModelInput
UtilityModelInput(name: str, description: str, type: aixplain.enums.data_type.DataType = <DataType.TEXT: 'text'>)
method __init__
__init__(
name: str,
description: str,
type: DataType = <DataType.TEXT: 'text'>
) → None
method to_dict
to_dict()
method validate
validate()
class UtilityModel
Ready-to-use Utility Model.
Attributes:
id
(Text): ID of the Modelname
(Text): Name of the Modelcode
(Union[Text, Callable]): code of the model.description
(Text): description of the model. Defaults to "".inputs
(List[UtilityModelInput]): inputs of the model. Defaults to [].output_examples
(Text): output examples. Defaults to "".api_key
(Text, optional): API key of the Model. Defaults to None.supplier
(Union[Dict, Text, Supplier, int], optional): supplier of the asset. Defaults to "aiXplain".version
(Text, optional): version of the model. Defaults to "1.0".function
(Function, optional): model AI function. Defaults to None.is_subscribed
(bool, optional): Is the user subscribed. Defaults to False.cost
(Dict, optional): model price. Defaults to None.**additional_info
: Any additional Model info to be saved
method __init__
__init__(
id: str,
name: str,
code: Union[str, Callable],
description: Optional[str] = None,
inputs: List[UtilityModelInput] = [],
output_examples: str = '',
api_key: Optional[str] = None,
supplier: Union[Dict, str, Supplier, int] = 'aiXplain',
version: Optional[str] = None,
function: Optional[Function] = None,
is_subscribed: bool = False,
cost: Optional[Dict] = None,
**additional_info
) → None
Utility Model Init
Args:
id
(Text): ID of the Modelname
(Text): Name of the Modelcode
(Union[Text, Callable]): code of the model.description
(Text): description of the model. Defaults to "".inputs
(List[UtilityModelInput]): inputs of the model. Defaults to [].output_examples
(Text): output examples. Defaults to "".api_key
(Text, optional): API key of the Model. Defaults to None.supplier
(Union[Dict, Text, Supplier, int], optional): supplier of the asset. Defaults to "aiXplain".version
(Text, optional): version of the model. Defaults to "1.0".function
(Function, optional): model AI function. Defaults to None.is_subscribed
(bool, optional): Is the user subscribed. Defaults to False.cost
(Dict, optional): model price. Defaults to None.**additional_info
: Any additional Model info to be saved
method delete
delete()
method to_dict
to_dict()
method update
update()
method validate
validate()