Collect optional validation context only when it can fit
This commit is contained in:
@@ -14,7 +14,7 @@ type LLMValidationBatch struct {
|
||||
TokenCount int `json:"token_count"`
|
||||
}
|
||||
|
||||
func prepareValidationBatches(items []LLMValidationItem, budget int, estimator chunking.TokenEstimator) ([]LLMValidationBatch, []Decision, error) {
|
||||
func prepareValidationBatches(items []LLMValidationItem, budget int, estimator chunking.TokenEstimator, context optionalValidationContext) ([]LLMValidationBatch, []Decision, error) {
|
||||
if estimator == nil {
|
||||
estimator = chunking.NewSimpleTokenEstimator()
|
||||
}
|
||||
@@ -24,7 +24,7 @@ func prepareValidationBatches(items []LLMValidationItem, budget int, estimator c
|
||||
var sizes []int
|
||||
var oversized []Decision
|
||||
for _, item := range items {
|
||||
fitted, err := fitValidationContext(item, budget, estimator)
|
||||
fitted, err := fitValidationContext(item, budget, estimator, context)
|
||||
if err != nil {
|
||||
return nil, oversized, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user