api

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes(container *restful.Container, handler *Handler)

Types

type ConversationDetailResponse

type ConversationDetailResponse struct {
	ConversationID string         `json:"conversation_id"`
	AgentName      string         `json:"agent_name"`
	AgentVersion   string         `json:"agent_version"`
	TurnCount      int            `json:"turn_count"`
	TurnResults    []TurnScoreDTO `json:"turn_results"`
	TurnAvg        float64        `json:"turn_avg"`
	HolisticScore  float64        `json:"holistic_score"`
	HolisticReason string         `json:"holistic_reason"`
	FinalScore     float64        `json:"final_score"`
	Verdict        string         `json:"verdict"`
	CreatedAt      time.Time      `json:"created_at"`
}

ConversationDetailResponse is the API response for GET /api/v1/conversations/{id}.

type ConversationEvalRequest

type ConversationEvalRequest struct {
	ConversationID string `json:"conversation_id"`
	Agent          struct {
		Name    string `json:"name"`
		Version string `json:"version"`
	} `json:"agent"`
	Turns []ConversationTurnRequest `json:"turns"`
}

ConversationEvalRequest is the API request body for POST /api/v1/conversations/evaluate.

type ConversationEvalResponse

type ConversationEvalResponse struct {
	ConversationID string         `json:"conversation_id"`
	AgentName      string         `json:"agent_name"`
	AgentVersion   string         `json:"agent_version"`
	TurnCount      int            `json:"turn_count"`
	TurnResults    []TurnScoreDTO `json:"turn_results"`
	TurnAvg        float64        `json:"turn_avg"`
	HolisticScore  float64        `json:"holistic_score"`
	HolisticReason string         `json:"holistic_reason"`
	FinalScore     float64        `json:"final_score"`
	Verdict        string         `json:"verdict"`
}

ConversationEvalResponse is the API response for POST /api/v1/conversations/evaluate.

type ConversationListResponse

type ConversationListResponse struct {
	Conversations []ConversationSummaryDTO `json:"conversations"`
	Total         int                      `json:"total"`
}

type ConversationSummaryDTO

type ConversationSummaryDTO struct {
	ConversationID string    `json:"conversation_id"`
	AgentName      string    `json:"agent_name"`
	AgentVersion   string    `json:"agent_version"`
	TurnCount      int       `json:"turn_count"`
	FinalScore     float64   `json:"final_score"`
	Verdict        string    `json:"verdict"`
	CreatedAt      time.Time `json:"created_at"`
}

ConversationSummaryDTO is a single item in the list endpoint.

type ConversationTurnRequest

type ConversationTurnRequest struct {
	TurnIndex      int    `json:"turn_index"`
	UserQuery      string `json:"user_query"`
	Answer         string `json:"answer"`
	Context        string `json:"context,omitempty"`
	ExpectedOutput string `json:"expected_output,omitempty"`
}

ConversationTurnRequest is a single turn in a ConversationEvalRequest.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(
	evaluator *executor.ConversationEvaluator,
	repository storage.Repository,
	logger *zerolog.Logger,
) *Handler

func (*Handler) EvaluateConversation

func (h *Handler) EvaluateConversation(req *restful.Request, resp *restful.Response)

POST /api/v1/conversations/evaluate

func (*Handler) GetConversation

func (h *Handler) GetConversation(req *restful.Request, resp *restful.Response)

GET /api/v1/conversations/{conversation_id}

func (*Handler) Health

func (h *Handler) Health(req *restful.Request, resp *restful.Response)

GET /api/v1/health

func (*Handler) HealthMetrics

func (h *Handler) HealthMetrics(req *restful.Request, resp *restful.Response)

GET /api/v1/metrics/health?window=7d

func (*Handler) ListConversations

func (h *Handler) ListConversations(req *restful.Request, resp *restful.Response)

GET /api/v1/conversations

type HealthMetricsResponse

type HealthMetricsResponse struct {
	Window           string  `json:"window"`
	TotalEvaluations int     `json:"total_evaluations"`
	AvgConfidence    float64 `json:"avg_confidence"`
}

type HealthResponse

type HealthResponse struct {
	Status  string `json:"status"`
	Version string `json:"version"`
}

type ScoreDTO

type ScoreDTO struct {
	Name   string  `json:"name"`
	Score  float64 `json:"score"`
	Reason string  `json:"reason,omitempty"`
	Weight float64 `json:"weight,omitempty"`
}

ScoreDTO represents a single judge's score.

type TurnScoreDTO

type TurnScoreDTO struct {
	TurnIndex int        `json:"turn_index"`
	UserQuery string     `json:"user_query"`
	Answer    string     `json:"answer"`
	Scores    []ScoreDTO `json:"scores"`
	TurnScore float64    `json:"turn_score"`
}

TurnScoreDTO represents evaluation scores for a single turn.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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