Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllEngineInfo ¶
func GetAllEngineInfo(registry *Registry) map[string]EngineInfo
GetAllEngineInfo returns information about all registered engines
Types ¶
type Engine ¶
type Engine interface {
// GetName returns the name of the search engine
GetName() string
// GetVersion returns the version of the engine implementation
GetVersion() string
// GetSupportedTools returns a list of tool names supported by this engine
GetSupportedTools() []string
// Search performs a general web search
Search(ctx context.Context, params SearchParams) (*SearchResult, error)
// SearchNews performs a news search
SearchNews(ctx context.Context, params SearchParams) (*SearchResult, error)
// SearchImages performs an image search
SearchImages(ctx context.Context, params SearchParams) (*SearchResult, error)
// SearchVideos performs a video search
SearchVideos(ctx context.Context, params SearchParams) (*SearchResult, error)
// SearchPlaces performs a places search
SearchPlaces(ctx context.Context, params SearchParams) (*SearchResult, error)
// SearchMaps performs a maps search
SearchMaps(ctx context.Context, params SearchParams) (*SearchResult, error)
// SearchReviews performs a reviews search
SearchReviews(ctx context.Context, params SearchParams) (*SearchResult, error)
// SearchShopping performs a shopping search
SearchShopping(ctx context.Context, params SearchParams) (*SearchResult, error)
// SearchScholar performs a scholar search
SearchScholar(ctx context.Context, params SearchParams) (*SearchResult, error)
// SearchLens performs a visual search (if supported)
SearchLens(ctx context.Context, params SearchParams) (*SearchResult, error)
// SearchAutocomplete gets search suggestions
SearchAutocomplete(ctx context.Context, params SearchParams) (*SearchResult, error)
// ScrapeWebpage scrapes content from a webpage
ScrapeWebpage(ctx context.Context, params ScrapeParams) (*SearchResult, error)
}
Engine defines the interface that all search engines must implement
func GetDefaultEngine ¶
GetDefaultEngine returns the default engine based on environment variable Falls back to "serper" if SEARCH_ENGINE is not set or the specified engine is not available
type EngineInfo ¶
type EngineInfo struct {
Name string `json:"name"`
Version string `json:"version"`
SupportedTools []string `json:"supported_tools"`
}
GetEngineInfo returns information about an engine
func GetEngineInfo ¶
func GetEngineInfo(engine Engine) EngineInfo
GetEngineInfo returns information about a specific engine
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages available search engines
type ScrapeParams ¶
type ScrapeParams struct {
URL string `json:"url" jsonschema:"description=URL to scrape"`
}
ScrapeParams represents parameters for web scraping
type SearchParams ¶
type SearchParams struct {
Query string `json:"query" jsonschema:"description=Search query"`
Location string `json:"location,omitempty" jsonschema:"description=Search location"`
Language string `json:"language,omitempty" jsonschema:"description=Search language (e.g., 'en')"`
Country string `json:"country,omitempty" jsonschema:"description=Country code (e.g., 'us')"`
NumResults int `json:"num_results,omitempty" jsonschema:"description=Number of results (1-100),default=10"`
}
SearchParams represents common search parameters across all engines
type SearchResult ¶
type SearchResult struct {
Data interface{} `json:"data"`
Raw string `json:"raw,omitempty"`
}
SearchResult represents a common search result structure
Click to show internal directories.
Click to hide internal directories.