paper-system/llm_processor/models/models.go

35 lines
862 B
Go
Raw Normal View History

2025-01-24 15:26:47 +00:00
package models
import (
"fmt"
)
// Paper represents a research paper
type Paper struct {
Title string `json:"title"`
Abstract string `json:"abstract"`
ArxivID string `json:"arxiv_id"`
}
// Result represents the evaluation result from the LLM
type Result struct {
Paper Paper `json:"paper"`
Decision string `json:"decision"` // ACCEPT, REJECT, or ERROR
Explanation string `json:"explanation"`
}
// OrganizedResults contains categorized results
type OrganizedResults struct {
Accepted []Result `json:"accepted"`
Rejected []Result `json:"rejected"`
Errors []Result `json:"errors"`
}
// Validate checks if a Result has valid decision value
func (r *Result) Validate() error {
if r.Decision != "ACCEPT" && r.Decision != "REJECT" && r.Decision != "ERROR" {
return fmt.Errorf("invalid decision value: %s", r.Decision)
}
return nil
}