Konan Types

class konan_sdk.konan_types.KonanCredentials(email: str, password: str)

Bases: object

Credentials to use to authenticate with the Konan API.

__init__(email: str, password: str) None

Initialize a new KonanCredentials.

Parameters
  • email (str) – email address

  • password (str) – password

class konan_sdk.konan_types.KonanTokens(access: str, refresh: str)

Bases: object

API Token retrieved by successfully authenticating with the Konan API.

__init__(access: str, refresh: str) None

Initialize a new KonanTokens.

Parameters
  • access (str) – Konan access token

  • refresh (str) – Konan refresh token

class konan_sdk.konan_types.KonanPrediction(uuid: str, output: Dict[str, Any], features: Optional[Dict[str, Any]] = None, feedback: Optional[Union[str, Dict[str, Any], Any]] = None)

Bases: object

Successful prediction registered with the Konan API.

__init__(uuid: str, output: Dict[str, Any], features: Optional[Dict[str, Any]] = None, feedback: Optional[Union[str, Dict[str, Any], Any]] = None) None

Initialize a new KonanPrediction.

Parameters
  • uuid (str) – Prediction uuid

  • output (Dict) – Live model output

  • features (Optional[Dict[str, Any]], optional) – features used to make the Prediction, defaults to None

  • feedback (Optional[Union[str, Dict[str, Any], Any]], optional) – Feedback made on the Prediction, defaults to None

class konan_sdk.konan_types.KonanDockerCredentials(username: str, password: str)

Bases: object

Credentials to use to authenticate with the Docker ContainerRegistry.

__init__(username: str, password: str) None

Initialize a new KonanDockerCredentials.

Parameters
  • username (str) – username

  • password (str) – password

class konan_sdk.konan_types.KonanDockerImage(url: str, exposed_port: int)

Bases: object

Docker image to use for Konan Model creation.

__init__(url: str, exposed_port: int) None

Initialize a new KonanDockerImage.

Parameters
  • url (str) – URL of the docker image

  • exposed_port (int) – Port number that hte docker image exposes its services at

class konan_sdk.konan_types.KonanModelState(value)

Bases: Enum

Different states a KonanModel can be in

Parameters

Enum ([type]) – [description]

Live = 'live'

Model Live State

Challenger = 'challenger'

Model Challenger State

Disabled = 'disabled'

Model Disabled State

Other = 'other'

Model Other State

class konan_sdk.konan_types.KonanModelCreationRequest(name: str, docker_credentials: Optional[KonanDockerCredentials], docker_image: KonanDockerImage, state: KonanModelState)

Bases: object

Information required to create a new Konan Model.

__init__(name: str, docker_credentials: Optional[KonanDockerCredentials], docker_image: KonanDockerImage, state: KonanModelState) None

Initialize a new KonanModelCreationRequest.

Parameters
  • name (str) – Name of the new Konan Mode.

  • docker_credentials (Optional[KonanDockerCredentials]) – Credentials of the Docker Container Registry to use

  • docker_image (KonanDockerImage) – Docker Image to use as the Konan Model

class konan_sdk.konan_types.KonanProjectCreationRequest(name: str, description: Optional[str])

Bases: object

Information required to issue a create a new Konan Project.

__init__(name: str, description: Optional[str]) None

Initialize a new KonanProjectCreationRequest.

Parameters
  • name (str) – Name of the new Konan Project.

  • description (str) – Description of the new Konan Project.

class konan_sdk.konan_types.KonanDeploymentCreationRequest(name: str, description: Optional[str], model_creation_request: KonanModelCreationRequest)

Bases: KonanProjectCreationRequest

Information required to issue a create a new Konan Deployment.

__init__(name: str, description: Optional[str], model_creation_request: KonanModelCreationRequest) None

Initialize a new KonanDeploymentCreationRequest.

Parameters
  • name (str) – Name of the new Konan Project.

  • description (str) – Description of the new Konan Project.

  • model_creation_request (KonanModelCreationRequest) – Information required to create a new Konan Model.

class konan_sdk.konan_types.KonanDeploymentErrorType(value)

Bases: Enum

Different error types possibly returned by the Konan API when attempting to create a new Konan Deployment.

Parameters

Enum ([type]) – [description]

Image = 'image'

Deployment Image Error

HealthEndpoint = 'health_endpoint'

Healthz Error

ExposedPort = 'exposed_port'

Exposed Port Error

class konan_sdk.konan_types.KonanDeploymentError(type: KonanDeploymentErrorType, message: str)

Bases: object

Error returned by the Konan API when attempting to create a new Konan Deployment.

__init__(type: KonanDeploymentErrorType, message: str) None

Initialize a new KonanDeploymentError.

Parameters
class konan_sdk.konan_types.KonanLiveModelSwitchState(switch_to: KonanModelState, new_live_model_uuid: str)

Bases: object

Konan Live Model Switch State

__init__(switch_to: KonanModelState, new_live_model_uuid: str) None

Initialize a new KonanLiveModelSwitchState

Parameters
  • switch_to (KonanModelState) – state of model to switch to

  • new_live_model_uuid (str) – UUID of the model to promote to live

class konan_sdk.konan_types.KonanModel(uuid: str, name: str, created_at: datetime, state: KonanModelState)

Bases: object

Konan Model

__init__(uuid: str, name: str, created_at: datetime, state: KonanModelState) None

Initialize a new KonanModel

Parameters
  • uuid (str) – UUID of the Konan Mode

  • name (str) – Name of the Konan Mode

  • created_at (datetime.datetime) – Konan Model creation date and time

  • state (KonanModelState) – State of the Konan Model

class konan_sdk.konan_types.KonanDeployment(uuid: str, name: str, created_at: datetime)

Bases: object

Konan Deployment.

__init__(uuid: str, name: str, created_at: datetime) None

Initialize a new KonanDeployment.

Parameters
  • uuid (str) – UUID of the Konan Deployment

  • name (str) – Name of the Konan Deployment

  • created_at (datetime.datetime) – Konan Deployment creation date and time

class konan_sdk.konan_types.KonanDeploymentCreationResponse(deployment: KonanDeployment, live_model: KonanModel, errors: List[KonanDeploymentError], container_logs: str)

Bases: object

Information returned by the Konan API when attempting to create a new Konan Deployment.

__init__(deployment: KonanDeployment, live_model: KonanModel, errors: List[KonanDeploymentError], container_logs: str) None

Initialize a new KonanDeploymentCreationResponse.

Parameters
  • deployment (KonanDeployment) – Konan Deployment Created

  • errors (List[KonanDeploymentError]) – Errors encountered when attempting to create the new Konan Deployment

  • container_logs (str) – Container logs generated when creating the new Konan Deployment

class konan_sdk.konan_types.KonanTimeWindow(start_time: datetime, end_time: datetime)

Bases: object

Konan Time Window of certain events.

__init__(start_time: datetime, end_time: datetime) None

Initialize a new KonanTimeWindow.

Parameters
class konan_sdk.konan_types.KonanFeedbackSubmission(prediction_uuid: str, target: Union[Dict, str])

Bases: object

Konan Feedback to send to the Konan API.

__init__(prediction_uuid: str, target: Union[Dict, str]) None

Initialize a new KonanFeedbackSubmission.

Parameters
  • prediction_uuid (str) – Prediction UUID to provide the Feedback for

  • target (Union[Dict, str]) – Ground Truth Target

class konan_sdk.konan_types.KonanFeedbackStatus(prediction_uuid: str, status: int, message: str)

Bases: object

Feedback Status returned by the Konan API.

__init__(prediction_uuid: str, status: int, message: str) None

Initialize a new KonanFeedbackStatus.

Parameters
  • prediction_uuid (str) – Prediction UUID

  • status (int) – Feedback status integer

  • message (str) – Feedback status message

class konan_sdk.konan_types.KonanFeedbacksResult(feedbacks_status: List[KonanFeedbackStatus], success_count: int, failure_count: int, total_count: int)

Bases: object

Bulk results of the Konan API when submitting Feedbacks.

__init__(feedbacks_status: List[KonanFeedbackStatus], success_count: int, failure_count: int, total_count: int) None

Initialize a new KonanFeedbacksResult.

Parameters
  • feedbacks_status (List[KonanFeedbackStatus]) – Status of all submitted Feedbacks

  • success_count (int) – Number of successfully created Feedbacks

  • failure_count (int) – Number of failed Feedbacks to create

  • total_count (int) – Total number of Feedbacks submitted