feat(generation): score articles with selected relevance model (#48)

This commit is contained in:
2026-11-25 18:09:36 +01:00
parent c5b8d0d4da
commit 90dd2a65d2
53 changed files with 1639 additions and 105 deletions

View File

@ -2,15 +2,19 @@ package ai
import (
"context"
"encoding/json"
"errors"
"fmt"
)
// GenOptions permet de contrôler le comportement de génération par appel.
type GenOptions struct {
MaxOutputTokens int // explicit synthesis output reserve
JSONMode bool // request structured JSON output when supported
Think bool // active le mode raisonnement (Qwen3 /think)
NumCtx int // taille du contexte KV (0 = valeur par défaut du provider)
JSONSchema json.RawMessage // native constrained output; scoring only
RequireComplete bool // reject incomplete provider responses for structured scoring
MaxOutputTokens int // explicit synthesis output reserve
JSONMode bool // request structured JSON output when supported
Think bool // active le mode raisonnement (Qwen3 /think)
NumCtx int // taille du contexte KV (0 = valeur par défaut du provider)
}
type Provider interface {
@ -35,3 +39,7 @@ func NewProvider(name, apiKey, model, endpoint string) (Provider, error) {
return nil, fmt.Errorf("unknown provider: %s", name)
}
}
var errGenerationIncomplete = errors.New("provider response incomplete")
var errStructuredOutputUnsupported = errors.New("ranking structured output unsupported")