arthurai.client.client.ArthurAI#
- class arthurai.client.client.ArthurAI(config=None, verify_ssl=None, url=None, access_key=None, offline=False, login=None, password=None, organization_id=None, allow_insecure=False)#
Bases:
object
A client that interacts with Arthur’s servers.
Methods
Create a new service account
Retrieves the current organization that the client is operating in
Retrieve an existing model by id
(BETA) Retrieve an existing model group by id
Retrieve service accounts
Create a new multistage model.
Sets the current organization that the client's requests apply to
- create_service_account(description, role)#
Create a new service account
- Parameters
description (
str
) – the description for the new service accountrole (
Role
) – the Role of the new service account
- Returns
parsed response in the following format:
{ "id": "<service account id>", "organization_id": "<organization id>", "description": "<service account description>", "token": "<service account api key>" }
- get_current_org()#
Retrieves the current organization that the client is operating in
- Return type
Dict
[str
,str
]- Returns
a string with the UUID of the current organization
- Permissions
N/A
- get_model(identifier, id_type='id')#
Retrieve an existing model by id
- Param
identifier: Id to get the model by
- Param
id_type: Type of id the identifier is, possible options are [‘id’, ‘partner_model_id’]
- Raises
ArthurUserError – failed due to user error
ArthurInternalError – failed due to an internal error
- Permissions
model read
- Return type
- get_model_group(id_or_model)#
(BETA) Retrieve an existing model group by id
- Param
identifier: Id to get the model group by
- Raises
ArthurUserError – failed due to user error
ArthurInternalError – failed due to an internal error
- Permissions
model_group read
- Return type
- get_service_accounts(description=None)#
Retrieve service accounts
- Parameters
description (
Optional
[str
]) – an optional description that returned account should match- Returns
parsed response containing a list of service accounts, in the following format:
[ { "id": "<service account id>", "organization_id": "<organization id>", "description": "<service account description>", "token": "<service account api key>" } ]
- model(partner_model_id=None, input_type=None, output_type=None, model_type=None, display_name=None, description=None, tags=None, classifier_threshold=None, is_batch=False, text_delimiter=None, expected_throughput_gb_per_day=None, pixel_height=None, pixel_width=None)#
Create a new multistage model.
- Parameters
partner_model_id (
Optional
[str
]) – The string external id of the model. If display_name is provided without partner_model_id, we will generate a unique partner_model_id.output_type (
Optional
[OutputType
]) – theOutputType
model_type (
Optional
[OutputType
]) –Deprecated since version version: 2.0.0 Use output_type instead.
display_name (
Optional
[str
]) – Optional name to display on dashboard, will default to the external iddescription (
Optional
[str
]) – Optional description for the modeltags (
Optional
[List
[str
]]) – A list of string tags to associate with the modelclassifier_threshold (
Optional
[float
]) – For binary classification models this is the threshold to determine a positive class, defaults to 0.5is_batch (
bool
) – boolean value which signifies whether the model sends inferences by batch or streamingtext_delimiter (
Optional
[TextDelimiter
]) – TextDelimiter used in NLP models to split documents into tokens for explanationsexpected_throughput_gb_per_day (
Optional
[int
]) – Expected amount of throughput. Used to provision resourcespixel_height (
Optional
[int
]) – Image height in pixels. Needed for CV models which require images to be one sizepixel_width (
Optional
[int
]) – Image width in pixels. Needed for CV models which require images to be one size
- Return type
- Returns
An
ArthurModel
- set_current_org(org_id)#
Sets the current organization that the client’s requests apply to
- Parameters
org_id (
str
) – The ID of the organization to set- Return type
None
- Returns
None
- Permissions
N/A