webfetch

package
v7.68.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package webfetch provides Floret's secure public-text URL fetch tool.

Index

Constants

View Source
const (
	ToolName = "web_fetch"
)

Variables

This section is empty.

Functions

func New

func New(options Options) tools.Tool

New returns a secure web_fetch tool. The default permission is ask because the tool is open-world; hosts may resolve a narrower per-invocation policy through Options.PermissionFor.

func NewDeepSeek added in v7.66.0

func NewDeepSeek(options DeepSeekOptions) (tools.Tool, error)

NewDeepSeek returns the selected remote web_fetch implementation. It never falls back to Direct.

Types

type DeepSeekClient added in v7.66.0

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

DeepSeekClient performs explicit remote Markdown fetches with public-URL admission checks.

func NewDeepSeekClient added in v7.66.0

func NewDeepSeekClient(options DeepSeekOptions) (*DeepSeekClient, error)

func (*DeepSeekClient) Fetch added in v7.66.0

func (c *DeepSeekClient) Fetch(ctx context.Context, rawURL string) (DeepSeekResult, error)

type DeepSeekOptions added in v7.66.0

type DeepSeekOptions struct {
	Options
	BaseURL string
	APIKey  string
	// ResolveAPIKey optionally resolves a live credential immediately before each call.
	ResolveAPIKey func(context.Context) (string, error)
	HTTPClient    *http.Client
}

DeepSeekOptions binds paid remote Fetch to one connection. Options retains host authorization.

type DeepSeekResult added in v7.66.0

type DeepSeekResult struct {
	URL     string `json:"url"`
	Title   string `json:"title"`
	Content string `json:"content"`
	Format  string `json:"format"`
}

DeepSeekResult contains only facts returned by Fetch and the requested URL.

type HTTPError added in v7.66.0

type HTTPError = webapi.HTTPError

HTTPError is a sanitized tool-service error, independent of model provider failures.

type Options

type Options struct {
	Permission                tools.PermissionSpec
	PermissionFor             tools.PermissionResolver
	AllowResolvedBenchmarkIPs bool
}

Options configures host-owned permission policy and the narrowly scoped transparent-proxy compatibility exception. Network limits are fixed so the provider cannot weaken them through tool arguments.

Jump to

Keyboard shortcuts

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