| |
- ai_core_sdk.resource_clients.metrics_client.MetricsCoreClient(ai_api_client_sdk.resource_clients.metrics_client.MetricsClient)
-
- Tracking
class Tracking(ai_core_sdk.resource_clients.metrics_client.MetricsCoreClient) |
|
Tracking(base_url: str = None, auth_url: str = None, client_id: str = None, client_secret: str = None, token_creator: Callable[[], str] = None, resource_group: str = None)
Tracking is a class implemented for interacting with the metrics related
endpoints of the server. It is a wrapper around the base class
:class:`ai_core_sdk.resource_clients.metrics_client.MetricsCoreClient`
:param base_url: Base URL of the AI Core. Should include the base path as well. (i.e., "<base_url>/lm/scenarios"
should work)
:type base_url: str
:param auth_url: URL of the authorization endpoint. Should be the full URL (including /oauth/token), defaults to
None
:type auth_url: str, optional
:param client_id: client id to be used for authorization, defaults to None
:type client_id: str, optional
:param client_secret: client secret to be used for authorization, defaults to None
:type client_secret: str, optional
:param token_creator: the function which returns the Bearer token, when called. Either this, or
auth_url & client_id & client_secret should be specified, defaults to None
:type token_creator: Callable[[], str], optional
:param resource_group: The default resource group which will be used while sending the requests to the server. If
not set, the resource_group should be specified with every request to the server, defaults to None
:type resource_group: str, optional |
|
- Method resolution order:
- Tracking
- ai_core_sdk.resource_clients.metrics_client.MetricsCoreClient
- ai_api_client_sdk.resource_clients.metrics_client.MetricsClient
- ai_api_client_sdk.resource_clients.base_client.BaseClient
- builtins.object
Methods defined here:
- __init__(self, base_url: str = None, auth_url: str = None, client_id: str = None, client_secret: str = None, token_creator: Callable[[], str] = None, resource_group: str = None)
- Initialize self. See help(type(self)) for accurate signature.
- delete(self, execution_id: str, resource_group: str = None) -> None
- Deletes the metrics.
:param execution_id: ID of the execution, of which the metrics should be deleted.
:type execution_id: str
:param resource_group: Resource Group which the request should be sent on behalf. Either this or a default
resource group in the :class:`ai_api_client_sdk.ai_api_v2_client.AIAPIV2Client` should be specified,
defaults to None
:type resource_group: str
:raises: class:`ai_api_client_sdk.exception.AIAPIInvalidRequestException` if a 400 response is received from the
server
:raises: class:`ai_api_client_sdk.exception.AIAPIAuthorizationException` if a 401 response is received from the
server
:raises: class:`ai_api_client_sdk.exception.AIAPINotFoundException` if a 404 response is received from the
server
:raises: class:`ai_api_client_sdk.exception.AIAPIServerException` if a non-2XX response is received from the
server
- log_metrics(self, metrics: List[ai_api_client_sdk.models.metric.Metric], execution_id: str = '', artifact_name: str = None, resource_group: str = None) -> None
- Creates or updates the metrics for an execution.
:param metrics: List of the metrics related to the execution,
:type metrics: List[class:`ai_api_client_sdk.metric.Metric`]
:param execution_id: ID of the execution, of which the metrics should be modified.
:type execution_id: str
:param artifact_name: Name of the artifact to associate with a metric, defaults to None
:type artifact_name: str
:param resource_group: Resource Group which the request should be sent on behalf. Either this or a default
resource group in the :class:`ai_api_client_sdk.ai_api_v2_client.AIAPIV2Client` should be specified,
defaults to None
:type resource_group: str
:raises: class:`ai_api_client_sdk.exception.AIAPIInvalidRequestException` if a 400 response is received from the
server
:raises: class:`ai_api_client_sdk.exception.AIAPIServerException` if a non-2XX response is received from the
server
- modify(self, execution_id: str = '', metrics: List[ai_api_client_sdk.models.metric.Metric] = None, tags: List[ai_api_client_sdk.models.metric_tag.MetricTag] = None, custom_info: List[ai_api_client_sdk.models.metric_custom_info.MetricCustomInfo] = None, resource_group: str = None) -> None
- Creates or updates the metrics for an execution.
:param execution_id: ID of the execution, of which the metrics should be modified.
:type execution_id: str
:param metrics: List of the metrics related to the execution, defaults to None
:type metrics: List[class:`ai_api_client_sdk.metric.Metric`], optional
:param tags: List of the tags related to the execution, defaults to None
:type tags: List[class:'ai_api_client_sdk.models.metric_tag.MetricTag'], optional
:param custom_info: List of custom info related to the execution, defaults to None
:type custom_info: List[class:`ai_api_client_sdk.models.metric_custom_info.MetricCustomInfo`], optional
:param resource_group: Resource Group which the request should be sent on behalf. Either this or a default
resource group in the :class:`ai_api_client_sdk.ai_api_v2_client.AIAPIV2Client` should be specified,
defaults to None
:type resource_group: str
:raises: class:`ai_api_client_sdk.exception.AIAPIInvalidRequestException` if a 400 response is received from the
server
:raises: class:`ai_api_client_sdk.exception.AIAPIServerException` if a non-2XX response is received from the
server
- query(self, filter: str = None, execution_ids: List[str] = None, select: List[str] = None, resource_group: str = None) -> ai_api_client_sdk.models.metrics_query_response.MetricsQueryResponse
- Creates or updates the metrics for an execution.
:param filter: Deprecated. Use parameter execution_ids instead. A filter expression that filters the metric
resources using execution IDs. User can only use in, eq operators in filter expression, defaults to None
:type filter: str, optional
:param execution_ids: IDs of the executions, of which the metrics should be retrieved, defaults to None
:type execution_ids: List[str], optional
:param select: Values of select can be metrics,tags,customInfo or any of the combinations of these or *.
Can be used to select(project) only the resources specified
:type select: List[str], optional
:param resource_group: Resource Group which the request should be sent on behalf. Either this or a default
resource group in the :class:`ai_api_client_sdk.ai_api_v2_client.AIAPIV2Client` should be specified,
defaults to None
:type resource_group: str
:raises: class:`ai_api_client_sdk.exception.AIAPIInvalidRequestException` if a 400 response is received from the
server
:raises: class:`ai_api_client_sdk.exception.AIAPIAuthorizationException` if a 401 response is received from the
server
:raises: class:`ai_api_client_sdk.exception.AIAPIServerException` if a non-2XX response is received from the
server
:return: An object representing the response from the server
:rtype: class:`ai_api_client_sdk.models.metrics_query_response.MetricsQueryResponse`
- set_custom_info(self, custom_info: List[ai_api_client_sdk.models.metric_custom_info.MetricCustomInfo], execution_id: str = '', resource_group: str = None) -> None
- log custom info against the given execution
captures consumption semantics for the metrics or complex metric in JSON format.
:param custom_info: List of custom info related to the execution
:type custom_info: List[class:`ai_api_client_sdk.models.metric_custom_info.MetricCustomInfo`], optional
:param execution_id: ID of the execution, of which the metrics should be modified.
:type execution_id: str
:param resource_group: Resource Group which the request should be sent on behalf. Either this or a default
resource group in the :class:`ai_api_client_sdk.ai_api_v2_client.AIAPIV2Client` should be specified,
defaults to None
:type resource_group: str
:raises: class:`ai_api_client_sdk.exception.AIAPIInvalidRequestException` if a 400 response is received from the
server
:raises: class:`ai_api_client_sdk.exception.AIAPIServerException` if a non-2XX response is received from the
server
- set_tags(self, tags: List[ai_api_client_sdk.models.metric_tag.MetricTag], execution_id: str = '', resource_group: str = None) -> None
- log tags against the given execution
:param tags: List of the tags related to the execution, defaults to None
:type tags: List[class:'ai_api_client_sdk.models.metric_tag.MetricTag']
:param execution_id: ID of the execution, of which the metrics should be modified.
:type execution_id: str
:param resource_group: Resource Group which the request should be sent on behalf. Either this or a default
resource group in the :class:`ai_api_client_sdk.ai_api_v2_client.AIAPIV2Client` should be specified,
defaults to None
:type resource_group: str
:raises: class:`ai_api_client_sdk.exception.AIAPIInvalidRequestException` if a 400 response is received from the
server
:raises: class:`ai_api_client_sdk.exception.AIAPIServerException` if a non-2XX response is received from the
server
Methods inherited from ai_api_client_sdk.resource_clients.base_client.BaseClient:
- bulk_modify(self, *args, **kwargs)
- Modifies multiple instances of the relevant resource. Will be implemented by the respective resource clients
- count(self, *args, **kwargs)
- Counts the relevant resources. Will be implemented by the respective resource clients
- create(self, *args, **kwargs)
- Creates the relevant resource. Will be implemented by the respective resource clients
- get(self, *args, **kwargs)
- Retrieves the relevant resource. Will be implemented by the respective resource clients
- query_logs(self, *args, **kwargs)
- Queries the relevant logs. Will be implemented by the respective resource clients
Data descriptors inherited from ai_api_client_sdk.resource_clients.base_client.BaseClient:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |