Reduce Gemini fallback noise and restore result volume
build-push / docker (push) Successful in 4m6s
build-push / docker (push) Successful in 4m6s
This commit is contained in:
@@ -127,7 +127,7 @@ func (s *SearchService) SearchMedia(queries []string, enabledPlatforms map[strin
|
||||
}
|
||||
|
||||
func (s *SearchService) EnrichResults(results []SearchResult) []SearchResult {
|
||||
limit := minInt(len(results), 12)
|
||||
limit := minInt(len(results), 14)
|
||||
if limit == 0 {
|
||||
return results
|
||||
}
|
||||
|
||||
@@ -255,10 +255,6 @@ User query: ` + query,
|
||||
})
|
||||
}
|
||||
|
||||
if len(recommendations) == 0 {
|
||||
recommendations = BuildFallbackRecommendations(candidates, 8, "Gemini Vision 평가를 받지 못해 키워드 기준으로 보강된 결과입니다.")
|
||||
}
|
||||
|
||||
return recommendations, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ func RankSearchResults(query string, results []SearchResult) []SearchResult {
|
||||
}
|
||||
|
||||
func GeminiCandidateLimit(total int) int {
|
||||
return min(total, 12)
|
||||
return min(total, 16)
|
||||
}
|
||||
|
||||
func EvaluateAllCandidatesWithGemini(service *GeminiService, query string, ranked []SearchResult) ([]AIRecommendation, GeminiBatchStats, error) {
|
||||
@@ -314,9 +314,9 @@ func MergeRecommendations(recommended []AIRecommendation, ranked []SearchResult,
|
||||
merged = append(merged, item)
|
||||
}
|
||||
|
||||
if len(merged) < min(6, limit) {
|
||||
if len(merged) < min(12, limit) {
|
||||
for _, item := range ranked {
|
||||
if len(merged) >= min(6, limit) || item.Link == "" || seen[item.Link] {
|
||||
if len(merged) >= min(12, limit) || item.Link == "" || seen[item.Link] {
|
||||
continue
|
||||
}
|
||||
if strings.TrimSpace(item.ThumbnailURL) == "" && strings.TrimSpace(item.PreviewVideoURL) == "" {
|
||||
@@ -330,7 +330,7 @@ func MergeRecommendations(recommended []AIRecommendation, ranked []SearchResult,
|
||||
ThumbnailURL: item.ThumbnailURL,
|
||||
PreviewVideoURL: item.PreviewVideoURL,
|
||||
Source: item.Source,
|
||||
Reason: GeminiFallbackReason,
|
||||
Reason: "Gemini 검토가 부족해 편집용 후보로 추가된 결과입니다.",
|
||||
Recommended: false,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ type searchCollector interface {
|
||||
type envatoCollector struct{}
|
||||
|
||||
func (envatoCollector) Name() string { return "Envato" }
|
||||
func (envatoCollector) MaxResults() int { return 10 }
|
||||
func (envatoCollector) MaxResults() int { return 12 }
|
||||
func (envatoCollector) Enabled(enabledPlatforms map[string]bool) bool {
|
||||
return len(enabledPlatforms) == 0 || enabledPlatforms["envato"]
|
||||
}
|
||||
@@ -31,7 +31,7 @@ func (envatoCollector) Enrich(searcher *SearchService, result SearchResult) Sear
|
||||
type artgridCollector struct{}
|
||||
|
||||
func (artgridCollector) Name() string { return "Artgrid" }
|
||||
func (artgridCollector) MaxResults() int { return 10 }
|
||||
func (artgridCollector) MaxResults() int { return 12 }
|
||||
func (artgridCollector) Enabled(enabledPlatforms map[string]bool) bool {
|
||||
return len(enabledPlatforms) == 0 || enabledPlatforms["artgrid"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user