searchcap

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ToolWebSearch = "web_search"

	WireShapeAnthropicServerWebSearch HostedWireShape = "anthropic_server_web_search"

	ExternalProviderBrave = "brave"
)

Variables

This section is empty.

Functions

func ValidateCapability

func ValidateCapability(providerID string, capability Capability) error

func ValidateRawCapability

func ValidateRawCapability(providerID string, capability Capability) error

func ValidateWireShape

func ValidateWireShape(shape HostedWireShape) error

Types

type BraveConfig

type BraveConfig struct {
	Provider string `json:"provider,omitempty"`
}

type Capability

type Capability struct {
	Source WebSearchSource `json:"source,omitempty"`
	Hosted HostedConfig    `json:"hosted,omitempty"`
	Brave  BraveConfig     `json:"brave,omitempty"`
}

func DefaultCapability

func DefaultCapability(providerID string) Capability

func NormalizeCapability

func NormalizeCapability(providerID string, capability Capability) Capability

func ProviderPresetCapability

func ProviderPresetCapability(providerID string) Capability

type HostedConfig

type HostedConfig struct {
	WireShape HostedWireShape `json:"wire_shape,omitempty"`
}

type HostedWireShape

type HostedWireShape string

func AvailableWireShapes

func AvailableWireShapes() []HostedWireShape

func SupportedWireShapes

func SupportedWireShapes(providerID string) []HostedWireShape

type ResolveInput

type ResolveInput struct {
	Provider       string
	Capability     Capability
	BraveAvailable bool
}

type ResolveStatus

type ResolveStatus string
const (
	ResolveReady       ResolveStatus = "ready"
	ResolveUnavailable ResolveStatus = "unavailable"
	ResolveInvalid     ResolveStatus = "invalid"
)

type Resolved

type Resolved struct {
	Source             WebSearchSource                 `json:"source"`
	Status             ResolveStatus                   `json:"status"`
	Available          bool                            `json:"available"`
	LocalToolNames     []string                        `json:"local_tool_names,omitempty"`
	HostedTools        []provider.HostedToolDefinition `json:"hosted_tools,omitempty"`
	UnavailableReasons []string                        `json:"unavailable_reasons,omitempty"`
	WireShape          HostedWireShape                 `json:"wire_shape,omitempty"`
	ExternalProvider   string                          `json:"external_provider,omitempty"`
}

func Resolve

func Resolve(input ResolveInput) (Resolved, error)

IMPORTANT: Web search source selection must be derived from provider profile capability plus explicit wire shape support. Do not add provider-name special cases, substitute unrequested sources, or probe at runtime here; callers must surface unavailable capability state instead of exposing guaranteed-failing tools.

type WebSearchSource

type WebSearchSource string
const (
	WebSearchProviderHosted WebSearchSource = "provider_hosted"
	WebSearchExternalBrave  WebSearchSource = "external_brave"
	WebSearchDisabled       WebSearchSource = "disabled"
)

Jump to

Keyboard shortcuts

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