Files

12 KiB

\MlAPI

All URIs are relative to https://api.hanzo.ai

Method HTTP request Description
DeleteMlModelsByName Delete /v1/ml/models/{name} Deletes a deployed inference model.
GetMlHealth Get /v1/ml/health Whether model serving can actually work right now
GetMlModels Get /v1/ml/models Lists the inference models deployed in the caller's org.
GetMlModelsByName Get /v1/ml/models/{name} Returns one deployed inference model.
PatchMlModelsByName Patch /v1/ml/models/{name} Change a deployed model in place
PostMlModels Post /v1/ml/models Deploys one inference model for the caller's org, and answers 201 with the model as Kubernetes admitted it.
PostMlModelsByNamePredict Post /v1/ml/models/{name}/predict Run inference against one of your deployed models

DeleteMlModelsByName

DeleteMlModelsByName(ctx, name).Execute()

Deletes a deployed inference model.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "sentiment" // string | Name is the resource to act on, taken from the path. Lower-cased and trimmed to the DNS-1123 label a CustomResource's metadata.name must be.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.MlAPI.DeleteMlModelsByName(context.Background(), name).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `MlAPI.DeleteMlModelsByName``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the resource to act on, taken from the path. Lower-cased and trimmed to the DNS-1123 label a CustomResource's metadata.name must be.

Other Parameters

Other parameters are passed through a pointer to a apiDeleteMlModelsByNameRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetMlHealth

GetMlHealth(ctx).Execute()

Whether model serving can actually work right now

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.MlAPI.GetMlHealth(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `MlAPI.GetMlHealth``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetMlHealthRequest struct via the builder pattern

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetMlModels

MlMlResourceList GetMlModels(ctx).Execute()

Lists the inference models deployed in the caller's org.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.MlAPI.GetMlModels(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `MlAPI.GetMlModels``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetMlModels`: MlMlResourceList
	fmt.Fprintf(os.Stdout, "Response from `MlAPI.GetMlModels`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetMlModelsRequest struct via the builder pattern

Return type

MlMlResourceList

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetMlModelsByName

MlMlResource GetMlModelsByName(ctx, name).Execute()

Returns one deployed inference model.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "sentiment" // string | Name is the resource to act on, taken from the path. Lower-cased and trimmed to the DNS-1123 label a CustomResource's metadata.name must be.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.MlAPI.GetMlModelsByName(context.Background(), name).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `MlAPI.GetMlModelsByName``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetMlModelsByName`: MlMlResource
	fmt.Fprintf(os.Stdout, "Response from `MlAPI.GetMlModelsByName`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the resource to act on, taken from the path. Lower-cased and trimmed to the DNS-1123 label a CustomResource's metadata.name must be.

Other Parameters

Other parameters are passed through a pointer to a apiGetMlModelsByNameRequest struct via the builder pattern

Name Type Description Notes

Return type

MlMlResource

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PatchMlModelsByName

PatchMlModelsByName(ctx, name).Execute()

Change a deployed model in place

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "name_example" // string | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.MlAPI.PatchMlModelsByName(context.Background(), name).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `MlAPI.PatchMlModelsByName``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string

Other Parameters

Other parameters are passed through a pointer to a apiPatchMlModelsByNameRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostMlModels

MlMlResource PostMlModels(ctx).MlMlCreate(mlMlCreate).Execute()

Deploys one inference model for the caller's org, and answers 201 with the model as Kubernetes admitted it.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	mlMlCreate := *openapiclient.NewMlMlCreate() // MlMlCreate | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.MlAPI.PostMlModels(context.Background()).MlMlCreate(mlMlCreate).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `MlAPI.PostMlModels``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostMlModels`: MlMlResource
	fmt.Fprintf(os.Stdout, "Response from `MlAPI.PostMlModels`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostMlModelsRequest struct via the builder pattern

Name Type Description Notes
mlMlCreate MlMlCreate

Return type

MlMlResource

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostMlModelsByNamePredict

PostMlModelsByNamePredict(ctx, name).Execute()

Run inference against one of your deployed models

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "name_example" // string | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.MlAPI.PostMlModelsByNamePredict(context.Background(), name).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `MlAPI.PostMlModelsByNamePredict``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string

Other Parameters

Other parameters are passed through a pointer to a apiPostMlModelsByNamePredictRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]