Documentation
¶
Index ¶
Constants ¶
View Source
const ( ProviderExa = "exa" ProviderDirect = "direct" DefaultTimeoutSecs = 30 DefaultMaxChars = 50_000 )
Variables ¶
View Source
var DefaultFallbackOrder = []string{ ProviderExa, ProviderDirect, }
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Provider string `yaml:"provider"`
Fallbacks []string `yaml:"fallbacks"`
Exa ExaConfig `yaml:"exa"`
Direct DirectConfig `yaml:"direct"`
}
Config controls fetch provider selection and credentials.
func ApplyEnvDefaults ¶
ApplyEnvDefaults fills empty config fields from environment variables.
func ConfigFromEnv ¶
func ConfigFromEnv() *Config
ConfigFromEnv builds a fetch config using environment variables.
func (*Config) WithDefaults ¶
type DirectConfig ¶
type Provider ¶
type Provider interface {
Name() string
Fetch(ctx context.Context, req Request) (*Response, error)
}
Provider fetches readable content for a given backend.
type Response ¶
type Response struct {
URL string
FinalURL string
Status int
ContentType string
ExtractMode string
Extractor string
Truncated bool
Length int
RawLength int
WrappedLength int
FetchedAt string
TookMs int64
Text string
Warning string
Cached bool
Provider string
Extras map[string]any
}
Response represents normalized fetch output.
Click to show internal directories.
Click to hide internal directories.