Documentation ¶
Overview ¶
Package suggestionbox contains the HTTP server for suggestionbox services.
Index ¶
- func New(suggestionbox Suggestionbox) *remotohttp.Server
- func RegisterSuggestionboxServer(server *remotohttp.Server, service Suggestionbox)
- func Run(addr string, suggestionbox Suggestionbox) error
- type Choice
- type CreateModelRequest
- type CreateModelResponse
- type DeleteModelRequest
- type DeleteModelResponse
- type Feature
- type GetStateRequest
- type ListModelsRequest
- type ListModelsResponse
- type Model
- type ModelOptions
- type PredictRequest
- type PredictResponse
- type PredictedChoice
- type PutStateRequest
- type PutStateResponse
- type RewardRequest
- type RewardResponse
- type Suggestionbox
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New( suggestionbox Suggestionbox, ) *remotohttp.Server
New makes a new remotohttp.Server with the specified services registered.
func RegisterSuggestionboxServer ¶
func RegisterSuggestionboxServer(server *remotohttp.Server, service Suggestionbox)
RegisterSuggestionboxServer registers a Suggestionbox with a remotohttp.Server.
func Run ¶
func Run(addr string, suggestionbox Suggestionbox, ) error
Run is the simplest way to run the services.
Types ¶
type CreateModelRequest ¶
type CreateModelRequest struct {
Model Model `json:"model"`
}
type CreateModelResponse ¶
type CreateModelResponse struct { // Error is an error message if one occurred. Error string `json:"error"` }
type DeleteModelRequest ¶
type DeleteModelRequest struct {
ModelID string `json:"model_id"`
}
type DeleteModelResponse ¶
type DeleteModelResponse struct { // Error is an error message if one occurred. Error string `json:"error"` }
type Feature ¶
type Feature struct { Key string `json:"key"` Type string `json:"type"` Value string `json:"value"` File remototypes.File `json:"file"` }
type GetStateRequest ¶
type GetStateRequest struct { }
type ListModelsRequest ¶
type ListModelsRequest struct { }
type ListModelsResponse ¶
type Model ¶
type Model struct { ID string `json:"id"` Name string `json:"name"` Options ModelOptions `json:"options"` Choices []Choice `json:"choices"` }
type ModelOptions ¶
type PredictRequest ¶
type PredictResponse ¶
type PredictResponse struct { Choices []PredictedChoice `json:"choices"` // Error is an error message if one occurred. Error string `json:"error"` }
type PredictedChoice ¶
type PutStateRequest ¶
type PutStateRequest struct {
StateFile remototypes.File `json:"state_file"`
}
type PutStateResponse ¶
type PutStateResponse struct { // Error is an error message if one occurred. Error string `json:"error"` }
type RewardRequest ¶
type RewardResponse ¶
type RewardResponse struct { // Error is an error message if one occurred. Error string `json:"error"` }
type Suggestionbox ¶
type Suggestionbox interface { CreateModel(context.Context, *CreateModelRequest) (*CreateModelResponse, error) DeleteModel(context.Context, *DeleteModelRequest) (*DeleteModelResponse, error) GetState(context.Context, *GetStateRequest) (*remototypes.FileResponse, error) ListModels(context.Context, *ListModelsRequest) (*ListModelsResponse, error) Predict(context.Context, *PredictRequest) (*PredictResponse, error) PutState(context.Context, *PutStateRequest) (*PutStateResponse, error) Reward(context.Context, *RewardRequest) (*RewardResponse, error) }
Click to show internal directories.
Click to hide internal directories.