17 lines
540 B
Go
17 lines
540 B
Go
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)
|
|
}
|