internetsearch

package
v0.59.13 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultInternetSearchRateLimit is the default maximum requests per second for internet search
	DefaultInternetSearchRateLimit = 1
	// InternetSearchRateLimitEnvVar is the environment variable for configuring rate limit
	InternetSearchRateLimitEnvVar = "INTERNET_SEARCH_RATE_LIMIT"
)

Variables

This section is empty.

Functions

func NewToolResultJSON

func NewToolResultJSON(data any) (*mcp.CallToolResult, error)

NewToolResultJSON creates a new tool result with JSON content

Types

type HTTPClientInterface added in v0.21.1

type HTTPClientInterface interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClientInterface defines the interface for HTTP clients

type MultiSearchResponse added in v0.59.0

type MultiSearchResponse struct {
	Searches []QueryResult `json:"searches"`
	Summary  SearchSummary `json:"summary"`
}

MultiSearchResponse represents the response for multi-query searches

type QueryResult added in v0.59.0

type QueryResult struct {
	Query    string         `json:"query"`
	Results  []SearchResult `json:"results"`
	Provider string         `json:"provider,omitempty"`
	Error    string         `json:"error,omitempty"`
}

QueryResult represents the result of a single query in a multi-query search

type RateLimitedHTTPClient added in v0.21.1

type RateLimitedHTTPClient struct {
	// contains filtered or unexported fields
}

RateLimitedHTTPClient implements HTTPClientInterface with rate limiting

func NewRateLimitedHTTPClient added in v0.21.1

func NewRateLimitedHTTPClient() *RateLimitedHTTPClient

NewRateLimitedHTTPClient creates a new rate-limited HTTP client for internet search with proxy support

func (*RateLimitedHTTPClient) Do added in v0.21.1

Do implements the HTTPClientInterface interface with rate limiting

type SearchResponse

type SearchResponse struct {
	Results   []SearchResult `json:"results"`
	Provider  string         `json:"provider"`
	Timestamp time.Time      `json:"timestamp"`
}

SearchResponse represents a unified response structure

type SearchResult

type SearchResult struct {
	Title       string         `json:"title"`
	URL         string         `json:"url"`
	Description string         `json:"description"`
	Metadata    map[string]any `json:"metadata,omitempty"`
}

SearchResult represents a unified search result

type SearchSummary added in v0.59.0

type SearchSummary struct {
	Total      int `json:"total"`
	Successful int `json:"successful"`
	Failed     int `json:"failed"`
}

SearchSummary provides aggregate statistics for multi-query searches

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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