Documentation
¶
Index ¶
- func NewWebFetchHTTP(cfg WebFetchHTTPConfig) (agentkit.ToolPack, error)
- func NewWebFetchScripted(cfg WebFetchScriptedConfig) (agentkit.ToolPack, error)
- func NewWebSearchExa(cfg WebSearchExaConfig, deps WebSearchExaDeps) (agentkit.ToolPack, error)
- func NewWebSearchScripted(cfg WebSearchScriptedConfig) (agentkit.ToolPack, error)
- type WebFetchHTTPConfig
- type WebFetchInput
- type WebFetchOutput
- type WebFetchScriptedConfig
- type WebSearchExaConfig
- type WebSearchExaDeps
- type WebSearchHit
- type WebSearchInput
- type WebSearchOutput
- type WebSearchScriptedConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWebFetchHTTP ¶
func NewWebFetchHTTP(cfg WebFetchHTTPConfig) (agentkit.ToolPack, error)
NewWebFetchHTTP registers tool/web-fetch-http: Fetch a URL over HTTP(S) and return readable text (tool name: web_fetch).
Best practices:
- Needs no credentials, so it works without any API key.
- Leave allowPrivateHosts off to block cloud metadata and internal admin endpoints.
func NewWebFetchScripted ¶
func NewWebFetchScripted(cfg WebFetchScriptedConfig) (agentkit.ToolPack, error)
NewWebFetchScripted registers tool/web-fetch-scripted: Canned page bodies for tests and keyless smoke runs.
func NewWebSearchExa ¶
func NewWebSearchExa(cfg WebSearchExaConfig, deps WebSearchExaDeps) (agentkit.ToolPack, error)
NewWebSearchExa registers tool/web-search-exa: Search the web through Exa (tool name: web_search).
Best practices:
- A missing key is reported at call time, not at build time.
- Search returns snippets; pair with tool/web-fetch-http when the model needs the full page.
func NewWebSearchScripted ¶
func NewWebSearchScripted(cfg WebSearchScriptedConfig) (agentkit.ToolPack, error)
NewWebSearchScripted registers tool/web-search-scripted: Canned search results for tests and keyless smoke runs.
Types ¶
type WebFetchHTTPConfig ¶
type WebFetchHTTPConfig struct {
// TimeoutSeconds is per-request wall clock; defaults to 30.
TimeoutSeconds int `json:"timeoutSeconds,omitempty"`
// MaxBytes is body read limit before extraction; defaults to 1 MiB.
MaxBytes int `json:"maxBytes,omitempty"`
// MaxRedirects is redirect chain limit; defaults to 5.
MaxRedirects int `json:"maxRedirects,omitempty"`
// UserAgent overrides the outgoing User-Agent.
UserAgent string `json:"userAgent,omitempty"`
// AllowPrivateHosts allows loopback / private / link-local targets; off by default.
AllowPrivateHosts bool `json:"allowPrivateHosts,omitempty"`
// AllowHosts, when non-empty, only these hosts (and their subdomains) may be fetched.
AllowHosts []string `json:"allowHosts,omitempty"`
// DenyHosts are hosts to refuse, applied after AllowHosts.
DenyHosts []string `json:"denyHosts,omitempty"`
}
type WebFetchInput ¶
type WebFetchOutput ¶
type WebFetchScriptedConfig ¶
type WebSearchExaConfig ¶
type WebSearchExaConfig struct {
// APIKeyRef is credential ref resolved via deps.credentials, e.g. "env:EXA_API_KEY".
APIKeyRef string `json:"apiKeyRef,omitempty"`
// APIKey is literal key; prefer APIKeyRef so the secret stays out of config files.
APIKey string `json:"apiKey,omitempty"`
// BaseURL overrides the API host; defaults to https://api.exa.ai.
BaseURL string `json:"baseUrl,omitempty"`
// MaxResults is cap on hits per call; defaults to 5.
MaxResults int `json:"maxResults,omitempty"`
// TimeoutSeconds is per-request wall clock; defaults to 30.
TimeoutSeconds int `json:"timeoutSeconds,omitempty"`
// Type is Exa search mode: auto (default), fast, instant, deep.
Type string `json:"type,omitempty"`
// Category narrows results, e.g. "news" or "research paper".
Category string `json:"category,omitempty"`
// IncludeText also requests page text; costs more tokens and money than highlights alone.
IncludeText bool `json:"includeText,omitempty"`
// SnippetChars is snippet truncation limit; defaults to 800.
SnippetChars int `json:"snippetChars,omitempty"`
// IncludeDomains restricts results to these domains.
IncludeDomains []string `json:"includeDomains,omitempty"`
// ExcludeDomains drops results from these domains.
ExcludeDomains []string `json:"excludeDomains,omitempty"`
}
type WebSearchExaDeps ¶
type WebSearchExaDeps struct {
Credentials credentials.Store `json:"credentials,omitempty"`
}
type WebSearchHit ¶
type WebSearchInput ¶
type WebSearchOutput ¶
type WebSearchOutput struct {
Query string `json:"query"`
Provider string `json:"provider,omitempty"`
Results []WebSearchHit `json:"results"`
}
type WebSearchScriptedConfig ¶
type WebSearchScriptedConfig struct {
// Results are hits returned for any query ByQuery does not match.
Results []WebSearchHit `json:"results,omitempty"`
// ByQuery maps case-insensitive query substring to hits; keep keys mutually exclusive.
ByQuery map[string][]WebSearchHit `json:"byQuery,omitempty"`
// MaxResults is default cap on hits per call when the model does not ask for one.
MaxResults int `json:"maxResults,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.