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 ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RegisterHandlers(router gin.IRouter, si ServerInterface)
- func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)
- type Authorization
- type ErrorInformation
- type Evaluations
- type GetEvaluationParams
- type GetEvaluationResponse
- type GetStatisticsParams
- type GetStatisticsResponse
- type GinServerOptions
- type Message
- type MiddlewareFunc
- type NameValuePair
- type PostEvaluationJSONRequestBody
- type PostEvaluationParams
- type PostEvaluationRequest
- type PostEvaluationRequestEvaluationResult
- type RatingScore
- type ScenarioStatistics
- type ServerInterface
- type ServerInterfaceWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
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 ¶
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 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 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