Documentation
¶
Overview ¶
Package keenable provides a web search tool backed by the Keenable Search API.
Search queries are sent to Keenable, a third-party service. The tool works without an API key: requests then go to Keenable's keyless public endpoint, which allows 1,000 requests per hour per IP address, shared by everything calling from that IP. Pass a key (for example from KEENABLE_API_KEY) to use the keyed endpoint, which lifts the hourly cap and is billed in Keenable credits.
It is a drop-in alternative to the Google Custom Search based websearch tool: it uses the same tool name ("web_search"), the same parameters (query, num_results) and the same plain-text result format, so register one or the other.
Index ¶
- Constants
- type Option
- type Tool
- func (t *Tool) Description() string
- func (t *Tool) DisplayName() string
- func (t *Tool) Execute(ctx context.Context, args string) (string, error)
- func (t *Tool) Internal() bool
- func (t *Tool) Name() string
- func (t *Tool) Parameters() map[string]interfaces.ParameterSpec
- func (t *Tool) Run(ctx context.Context, input string) (string, error)
Constants ¶
const (
// DefaultBaseURL is the Keenable API base URL.
DefaultBaseURL = "https://api.keenable.ai"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Tool)
Option configures the tool.
func WithBaseURL ¶
WithBaseURL overrides the API base URL (useful for tests or proxies).
func WithHTTPClient ¶
WithHTTPClient sets the HTTP client used for requests.
type Tool ¶
type Tool struct {
// contains filtered or unexported fields
}
Tool implements a web search tool using Keenable.
func New ¶
New creates a Keenable search tool. apiKey may be empty to use the keyless public endpoint.
func (*Tool) Description ¶
Description returns a description of what the tool does.
func (*Tool) DisplayName ¶
DisplayName implements interfaces.ToolWithDisplayName.
func (*Tool) Parameters ¶
func (t *Tool) Parameters() map[string]interfaces.ParameterSpec
Parameters returns the parameters that the tool accepts.