Documentation
¶
Index ¶
- Constants
- func BytesToTensor(dataType string, data []byte, shape []int64) (any, error)
- func Serialize(r *RESTInferenceRequest) ([]byte, error)
- type Configuration
- type Event
- func (e *Event) GetBody() []byte
- func (e *Event) GetContentType() string
- func (e *Event) GetFieldByteSlice(key string) []byte
- func (e *Event) GetFieldInt(key string) (int, error)
- func (e *Event) GetFieldString(key string) string
- func (e *Event) GetHeader(key string) any
- func (e *Event) GetHeaderByteSlice(key string) []byte
- func (e *Event) GetHeaders() map[string]any
- func (e *Event) GetMethod() string
- func (e *Event) GetPath() string
- func (e *Event) GetTimestamp() time.Time
- func (e *Event) GetTriggerInfo() nuclio.TriggerInfoProvider
- func (e *Event) GetURL() string
- type ModelMetadataResponse
- type ModelReadyResponse
- type RESTInferInputTensor
- type RESTInferOutputTensor
- type RESTInferenceRequest
- type RESTInferenceResponse
- type RESTTensorMetadata
- type ServerLiveResponse
- type ServerMetadataResponse
- type ServerReadyResponse
- type TensorDef
Constants ¶
View Source
const ( DefaultRESTPort = 8080 DefaultGRPCPort = 9000 DefaultModelName = "model" DefaultModelVersion = "1" )
Variables ¶
This section is empty.
Functions ¶
func Serialize ¶
func Serialize(r *RESTInferenceRequest) ([]byte, error)
Types ¶
type Configuration ¶
type Configuration struct {
trigger.Configuration
// Server configuration
RESTPort int `mapstructure:"rest_port"`
GRPCPort int `mapstructure:"grpc_port"`
EnableREST bool `mapstructure:"enable_rest"`
EnableGRPC bool `mapstructure:"enable_grpc"`
// Model configuration
ModelName string `mapstructure:"model_name"`
ModelVersion string `mapstructure:"model_version"`
// Tensor definitions
InputTensors []TensorDef `mapstructure:"input_tensors"`
OutputTensors []TensorDef `mapstructure:"output_tensors"`
}
Configuration for OpenInference trigger
func NewConfiguration ¶
func NewConfiguration(id string, triggerConfiguration *functionconfig.Trigger, runtimeConfiguration *runtime.Configuration) (*Configuration, error)
NewConfiguration creates a new OpenInference trigger configuration
type Event ¶
type Event struct {
nuclio.AbstractEvent
// contains filtered or unexported fields
}
Event wraps an OpenInference inference request
func (*Event) GetContentType ¶
GetContentType returns the content type
func (*Event) GetFieldByteSlice ¶
GetFieldByteSlice returns a field value as a byte slice
func (*Event) GetFieldInt ¶
GetFieldInt returns a field value as an int
func (*Event) GetFieldString ¶
GetFieldString returns a field value as a string
func (*Event) GetHeaderByteSlice ¶
GetHeaderByteSlice returns a header value as a byte slice
func (*Event) GetHeaders ¶
GetHeaders returns all headers
func (*Event) GetTimestamp ¶
GetTimestamp returns the event timestamp
func (*Event) GetTriggerInfo ¶
func (e *Event) GetTriggerInfo() nuclio.TriggerInfoProvider
GetTriggerInfo returns trigger information
type ModelMetadataResponse ¶
type ModelMetadataResponse struct {
Name string `json:"name"`
Versions []string `json:"versions,omitempty"`
Platform string `json:"platform,omitempty"`
Inputs []RESTTensorMetadata `json:"inputs,omitempty"`
Outputs []RESTTensorMetadata `json:"outputs,omitempty"`
}
type ModelReadyResponse ¶
type ModelReadyResponse struct {
Ready bool `json:"ready"`
}
type RESTInferInputTensor ¶
type RESTInferOutputTensor ¶
type RESTInferenceRequest ¶
type RESTInferenceRequest struct {
ID string `json:"id,omitempty"`
Parameters map[string]any `json:"parameters,omitempty"`
Inputs []RESTInferInputTensor `json:"inputs"`
Outputs []RESTInferOutputTensor `json:"outputs,omitempty"`
}
type RESTInferenceResponse ¶
type RESTInferenceResponse struct {
ModelName string `json:"model_name"`
ModelVersion string `json:"model_version,omitempty"`
ID string `json:"id,omitempty"`
Parameters map[string]any `json:"parameters,omitempty"`
Outputs []RESTInferOutputTensor `json:"outputs"`
}
func Deserialize ¶
func Deserialize(data []byte) (*RESTInferenceResponse, error)
type RESTTensorMetadata ¶
type ServerLiveResponse ¶
type ServerLiveResponse struct {
Live bool `json:"live"`
}
type ServerMetadataResponse ¶
type ServerReadyResponse ¶
type ServerReadyResponse struct {
Ready bool `json:"ready"`
}
Click to show internal directories.
Click to hide internal directories.