search

package
v0.0.0-...-5239448 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderExa        = basesearch.ProviderExa
	ProviderBrave      = basesearch.ProviderBrave
	ProviderPerplexity = basesearch.ProviderPerplexity
	ProviderOpenRouter = basesearch.ProviderOpenRouter

	DefaultSearchCount  = basesearch.DefaultSearchCount
	MaxSearchCount      = basesearch.MaxSearchCount
	DefaultTimeoutSecs  = basesearch.DefaultTimeoutSecs
	DefaultCacheTtlSecs = basesearch.DefaultCacheTtlSecs
)

Variables

View Source
var DefaultFallbackOrder = basesearch.DefaultFallbackOrder

Functions

This section is empty.

Types

type BraveConfig

type BraveConfig struct {
	Enabled          *bool
	BaseURL          string
	APIKey           string
	TimeoutSecs      int
	CacheTtlSecs     int
	SearchLang       string
	UILang           string
	DefaultCountry   string
	DefaultFreshness string
}

type Config

type Config struct {
	Provider  string
	Fallbacks []string

	Exa        ExaConfig
	Brave      BraveConfig
	Perplexity PerplexityConfig
	OpenRouter OpenRouterConfig
}

func ApplyEnvDefaults

func ApplyEnvDefaults(cfg *Config) *Config

func (*Config) WithDefaults

func (c *Config) WithDefaults() *Config

type ExaConfig

type ExaConfig struct {
	Enabled           *bool
	BaseURL           string
	APIKey            string
	Type              string
	Category          string
	NumResults        int
	IncludeText       bool
	TextMaxCharacters int
	Highlights        bool
}

type OpenRouterConfig

type OpenRouterConfig struct {
	Enabled      *bool
	APIKey       string
	BaseURL      string
	Model        string
	TimeoutSecs  int
	CacheTtlSecs int
}

type PerplexityConfig

type PerplexityConfig struct {
	Enabled      *bool
	APIKey       string
	BaseURL      string
	Model        string
	TimeoutSecs  int
	CacheTtlSecs int
}

type Request

type Request struct {
	Query      string
	Count      int
	Country    string
	SearchLang string
	UILang     string
	Freshness  string
}

type Response

type Response struct {
	Query      string
	Provider   string
	Count      int
	TookMs     int64
	Results    []Result
	Answer     string
	Summary    string
	Definition string
	Warning    string
	NoResults  bool
	Cached     bool
	Extras     map[string]any
}
func Search(ctx context.Context, req Request, cfg *Config) (*Response, error)

type Result

type Result struct {
	ID          string
	Title       string
	URL         string
	Description string
	Published   string
	SiteName    string
	Author      string
	Image       string
	Favicon     string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL