suggestionbox

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package suggestionbox contains the HTTP server for suggestionbox services.

Index

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 Choice

type Choice struct {
	ID string `json:"id"`

	Features []Feature `json:"features"`
}

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 ListModelsResponse struct {
	Models []Model `json:"models"`

	// Error is an error message if one occurred.
	Error string `json:"error"`
}

type Model

type Model struct {
	ID string `json:"id"`

	Name string `json:"name"`

	Options ModelOptions `json:"options"`

	Choices []Choice `json:"choices"`
}

type ModelOptions

type ModelOptions struct {
	RewardExpirationSeconds int `json:"reward_expiration_seconds"`

	Ngrams int `json:"ngrams"`

	Skipgrams int `json:"skipgrams"`

	Mode string `json:"mode"`

	Epsilon float64 `json:"epsilon"`

	Cover float64 `json:"cover"`
}

type PredictRequest

type PredictRequest struct {
	ModelID string `json:"model_id"`

	Limit int `json:"limit"`

	Inputs []Feature `json:"inputs"`
}

type PredictResponse

type PredictResponse struct {
	Choices []PredictedChoice `json:"choices"`

	// Error is an error message if one occurred.
	Error string `json:"error"`
}

type PredictedChoice

type PredictedChoice struct {
	ID string `json:"id"`

	Features []Feature `json:"features"`

	RewardID string `json:"reward_id"`
}

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 RewardRequest struct {
	ModelID string `json:"model_id"`

	RewardID string `json:"reward_id"`

	Value int `json:"value"`
}

type RewardResponse

type RewardResponse struct {

	// Error is an error message if one occurred.
	Error string `json:"error"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL