evaluationapi

package
v0.0.0-...-71ec521 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package evaluationapi provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.13.2 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

func RegisterHandlers

func RegisterHandlers(router gin.IRouter, si ServerInterface)

RegisterHandlers creates http.Handler with routing matching OpenAPI spec.

func RegisterHandlersWithOptions

func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)

RegisterHandlersWithOptions creates http.Handler with additional options

Types

type Authorization

type Authorization = string

Authorization Bearer Token.

type ErrorInformation

type ErrorInformation struct {
	// Code Some unique error code.
	Code int32 `json:"code"`

	// Message Error message.
	Message string `json:"message"`
}

ErrorInformation Information about the error.

type Evaluations

type Evaluations struct {
	// NumNegative number of negative evaluations.
	NumNegative int32 `json:"numNegative"`

	// NumNeutral number of neutral evaluations.
	NumNeutral int32 `json:"numNeutral"`

	// NumPositive Number of positive evaluations.
	NumPositive int32 `json:"numPositive"`
}

Evaluations Evaluation statistics.

type GetEvaluationParams

type GetEvaluationParams struct {
	// Authorization JWT token with authorization information.
	Authorization *Authorization `json:"Authorization,omitempty"`
}

GetEvaluationParams defines parameters for GetEvaluation.

type GetEvaluationResponse

type GetEvaluationResponse struct {
	// Evaluations Evaluation statistics.
	Evaluations Evaluations `json:"evaluations"`

	// Id Unique id of the evaluation.
	Id string `json:"id"`

	// Request Message.
	Request Message `json:"request"`

	// Response Message.
	Response Message `json:"response"`
}

GetEvaluationResponse The data of the next evaluation.

type GetStatisticsParams

type GetStatisticsParams struct {
	// Authorization JWT token with authorization information.
	Authorization *Authorization `json:"Authorization,omitempty"`
}

GetStatisticsParams defines parameters for GetStatistics.

type GetStatisticsResponse

type GetStatisticsResponse struct {
	Scenarios *[]ScenarioStatistics `json:"scenarios,omitempty"`
}

GetStatisticsResponse The statistics of the evaluations grouped by scenario

type GinServerOptions

type GinServerOptions struct {
	BaseURL      string
	Middlewares  []MiddlewareFunc
	ErrorHandler func(*gin.Context, error, int)
}

GinServerOptions provides options for the Gin server.

type Message

type Message struct {
	// Body e.g. E-Mail body. The actual message.
	Body string `json:"body"`

	// Date string containing the date when the email was received in ISO 8601 format.
	Date string `json:"date"`

	// From Name of the author.
	From string `json:"from"`

	// Subject e.g. E-Mail subject.
	Subject string `json:"subject"`
}

Message Message.

type MiddlewareFunc

type MiddlewareFunc func(c *gin.Context)

type NameValuePair

type NameValuePair struct {
	// Name Name of the category.
	Name string `json:"name"`

	// Value Amout of rated question/response pairs in this category.
	Value int32 `json:"value"`
}

NameValuePair The statistics of the evaluations

type PostEvaluationJSONRequestBody

type PostEvaluationJSONRequestBody = PostEvaluationRequest

PostEvaluationJSONRequestBody defines body for PostEvaluation for application/json ContentType.

type PostEvaluationParams

type PostEvaluationParams struct {
	// Authorization JWT token with authorization information.
	Authorization *Authorization `json:"Authorization,omitempty"`
}

PostEvaluationParams defines parameters for PostEvaluation.

type PostEvaluationRequest

type PostEvaluationRequest struct {
	EvaluationResult PostEvaluationRequestEvaluationResult `json:"evaluationResult"`

	// Id Unique id of the evaluation.
	Id string `json:"id"`
}

PostEvaluationRequest The result of the current evaluation.

type PostEvaluationRequestEvaluationResult

type PostEvaluationRequestEvaluationResult string

PostEvaluationRequestEvaluationResult defines model for PostEvaluationRequest.EvaluationResult.

const (
	Negative PostEvaluationRequestEvaluationResult = "negative"
	Neutral  PostEvaluationRequestEvaluationResult = "neutral"
	Positive PostEvaluationRequestEvaluationResult = "positive"
)

Defines values for PostEvaluationRequestEvaluationResult.

type RatingScore

type RatingScore struct {
	// Max Maximum of rating Score.
	Max float32 `json:"max"`

	// Min Minimum of rating Score.
	Min float32 `json:"min"`

	// Value Rating score of the scenario.
	Value float32 `json:"value"`
}

RatingScore defines model for RatingScore.

type ScenarioStatistics

type ScenarioStatistics struct {
	// Description The description of the Scenario.
	Description *string `json:"description,omitempty"`

	// Id Unique id of the evaluation.
	Id string `json:"id"`

	// Name The name of the Scenario
	Name               string          `json:"name"`
	ProgressStatistics []NameValuePair `json:"progressStatistics"`
	RatingScore        RatingScore     `json:"ratingScore"`
	ResultStatistics   []NameValuePair `json:"resultStatistics"`

	// SystemPrompt The used systemprompt for the scenario.
	SystemPrompt *string `json:"systemPrompt,omitempty"`

	// TotalResponseCount The amount of questions and response evaluated in this scenario.
	TotalResponseCount int32 `json:"totalResponseCount"`
}

ScenarioStatistics Statistics per Scenario.

type ServerInterface

type ServerInterface interface {
	// Gets the next message for evaluation.
	// (GET /evaluation)
	GetEvaluation(c *gin.Context, params GetEvaluationParams)
	// Posts the evaluation of the current evaluation response.
	// (POST /evaluation)
	PostEvaluation(c *gin.Context, params PostEvaluationParams)
	// Gets the statistics.
	// (GET /statistics)
	GetStatistics(c *gin.Context, params GetStatisticsParams)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandler       func(*gin.Context, error, int)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) GetEvaluation

func (siw *ServerInterfaceWrapper) GetEvaluation(c *gin.Context)

GetEvaluation operation middleware

func (*ServerInterfaceWrapper) GetStatistics

func (siw *ServerInterfaceWrapper) GetStatistics(c *gin.Context)

GetStatistics operation middleware

func (*ServerInterfaceWrapper) PostEvaluation

func (siw *ServerInterfaceWrapper) PostEvaluation(c *gin.Context)

PostEvaluation operation middleware

Jump to

Keyboard shortcuts

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