Documentation
¶
Index ¶
Constants ¶
View Source
const ( StatusPass = "pass" StatusWarning = "warning" StatusFail = "fail" StatusUnknown = "unknown" StatusObserved = "observed" )
View Source
const DefaultSeedanceModel = "doubao-seedance-2-0-260128"
Variables ¶
View Source
var DefaultSeedanceModels = []string{ DefaultSeedanceModel, "doubao-seedance-2-0-fast-260128", "doubao-seedance-2-0-mini-260615", }
Functions ¶
func SupportedProtocols ¶
func SupportedProtocols() []string
func WriteReport ¶
Types ¶
type CaseDefinition ¶
type CaseDefinition struct {
ID string `json:"id"`
Name string `json:"name"`
Dimension string `json:"dimension"`
Protocol string `json:"protocol"`
Type string `json:"type"`
Default bool `json:"default"`
Disabled bool `json:"disabled"`
ExecutionMode string `json:"execution_mode"`
Severity string `json:"severity"`
Spec testspec.Spec `json:"spec"`
}
func LoadSuite ¶
func LoadSuite(root, suite string) ([]CaseDefinition, error)
func SelectCases ¶
func SelectCases(cases []CaseDefinition, ids []string, all bool) ([]CaseDefinition, error)
type CaseResult ¶
type CaseResult struct {
Verification testspec.Verdict `json:"verification"`
Observation *testspec.Observation `json:"observation,omitempty"`
ID string `json:"id"`
Name string `json:"name"`
Dimension string `json:"dimension"`
Protocol string `json:"protocol"`
Model string `json:"model"`
Status string `json:"status"`
Severity string `json:"severity"`
ElapsedMS int64 `json:"elapsed_ms"`
Evidence string `json:"evidence"`
HTTPStatus int `json:"http_status,omitempty"`
Usage map[string]any `json:"usage,omitempty"`
Metrics map[string]any `json:"metrics,omitempty"`
Exchanges []HTTPExchange `json:"exchanges,omitempty"`
ArtifactDir string `json:"artifact_dir,omitempty"`
}
func RedactCaseResult ¶
func RedactCaseResult(result CaseResult, apiKey string) CaseResult
RedactCaseResult returns a safe copy for machine-readable progress events. Reports use the same redaction path before anything is written to disk.
func RunCase ¶
func RunCase(ctx context.Context, doer HTTPDoer, config RunConfig, planned PlannedRun) (CaseResult, error)
RunCase is the CLI presentation boundary for the same runtime used by desktop.
type DimensionSummary ¶
type DimensionSummary struct {
Dimension string `json:"dimension"`
SummaryCounts
}
type HTTPExchange ¶
type PlannedRun ¶
type PlannedRun struct {
Case CaseDefinition
Model string
ResultID string
}
func ExpandRuns ¶
func ExpandRuns(config RunConfig, cases []CaseDefinition) ([]PlannedRun, error)
type Report ¶
type Report struct {
Title string `json:"title"`
GeneratedAt time.Time `json:"generated_at"`
Suite string `json:"suite"`
BaseURL string `json:"base_url"`
Model string `json:"model"`
Overall string `json:"overall"`
Verdict string `json:"verdict"`
Summary SummaryCounts `json:"summary"`
Notices []ReportNotice `json:"notices,omitempty"`
Dimensions []DimensionSummary `json:"dimensions"`
Failures []CaseResult `json:"failures,omitempty"`
Warnings []CaseResult `json:"warnings,omitempty"`
Results []CaseResult `json:"results"`
APIKey string `json:"-"`
}
func BuildReport ¶
func BuildReport(config RunConfig, results []CaseResult) Report
type ReportNotice ¶
Click to show internal directories.
Click to hide internal directories.