thread-master/backend/internal/library/placement/effective_strategy.go

17 lines
540 B
Go
Raw Permalink Normal View History

2026-06-26 08:37:04 +00:00
package placement
import libkg "haixun-backend/internal/library/knowledge"
// EffectiveExpandStrategy returns LLM when web search is required but no API key is configured.
func EffectiveExpandStrategy(research ResearchSettings) libkg.ExpandStrategy {
strategy := libkg.ParseExpandStrategy(research.ExpandStrategy)
if strategy.RequiresWebSearch() && MissingWebSearchKey(research) {
return libkg.ExpandStrategyLLM
}
return strategy
}
func WebSearchAvailable(research ResearchSettings) bool {
return !MissingWebSearchKey(research)
}