Utils
Bases:
BaseModel
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.
```json { "title": "ApiClient", "type": "object", "properties": { "api_url": { "format": "uri", "maxLength": 2083, "minLength": 1, "title": "Api Url", "type": "string" }, "token": { "format": "password", "title": "Token", "type": "string", "writeOnly": true } }, "required": [ "api_url", "token" ] } ```
* **Fields:** - [`api_url (pydantic_core._pydantic_core.Url)`](#promptquality.utils.api_client.ApiClient.api_url) - [`token (pydantic.types.SecretStr)`](#promptquality.utils.api_client.ApiClient.token)
- Constraints:
- max_length = 2083
- allowed_schemes = [‘http’, ‘https’]
- Return type:
Dict
[str
,str
]
- Return type:
Dict
[str
,str
]
- Return type:
Dict
[str
,str
]
- Return type:
Dict
[str
,str
]
- Return type:
Dict
[str
,str
]
- Return type:
Dict
[str
,str
]
- Return type:
Dict
[str
,float
]
- Return type:
Dict
[str
,Any
]
- Return type:
List
[Dict
[str
,Any
]]
- Return type:
List
[Dict
[str
,str
]]
- Return type:
List
[Dict
[str
,Any
]]
- Return type:
Dict
[str
,str
]
- Return type:
List
[Dict
[str
,str
]]
- Return type:
bool
- Return type:
Dict
[str
,Any
]
- Return type:
List
[Dict
[str
,Any
]]
- Return type:
Dict
[str
,Any
]
- Return type:
Dict
[str
,Any
]
- Return type:
Dict
[str
,Any
]
- Return type:
Dict
[str
,Any
]
- Return type:
Dict
[str
,str
]
- Return type:
Dict
[str
,str
]
- Return type:
Path
- Return type:
List
[Dict
[str
,str
]]
Set the dataset path and format.
If the dataset is a dictionary or list, it will be stored as a a temporary file and the path to the temporary file will be returned. If the dataset is a path or string, the path will be returned. If the dataset is not a dictionary, list, path, or string, a ValueError will be raised.
If the dataset is a dictionary or list and PyArrow is available, the dataset will be stored as a Feather file. Otherwise, the dataset will be stored as a CSV file.
- Parameters: dataset (DatasetType) – Dataset as provided by the user.
- Returns: Path to the dataset file and the dataset format.
- Raises:
- ValueError – If the dataset is not a dictionary, list, path, or string.
- ValueError – If the dataset file is not a CSV or Feather file.
- FileNotFoundError – If the dataset file does not exist.
- Return type:
bool
Validates name contains only letters, numbers, space, - and _.
If no name is provided, a random name is generated.
- Return type:
str
- Return type:
str
Jul_19_3_07_12_demo_template_v4
- Return type:
str
- Return type:
Any
Bases:
str
, Enum
- Return type:
Dict
[str
,str
]
- Return type:
Dict
[str
,str
]
- Return type:
Dict
[str
,str
]
Last modified 7d ago