Documentation
¶
Index ¶
- func CollapseWhitespace(s string) string
- func HTMLToText(rawHTML string) string
- func NewSafeHTTPClient(timeout time.Duration) *http.Client
- func NewSafeHTTPClientWithOptions(timeout time.Duration, opts URLSecurityOptions) *http.Client
- func ValidateHTTPURL(ctx context.Context, rawURL string, opts URLSecurityOptions) (*url.URL, error)
- func ValidatePublicHTTPURL(ctx context.Context, rawURL string) (*url.URL, error)
- type FetchTool
- func (t *FetchTool) Description() string
- func (t *FetchTool) Execute(ctx context.Context, input json.RawMessage, _ string) (agentsdk.ToolResult, error)
- func (t *FetchTool) InputSchema() json.RawMessage
- func (t *FetchTool) IsEnabled(_ *agentsdk.RunContext) bool
- func (t *FetchTool) IsReadOnly() bool
- func (t *FetchTool) Name() string
- func (t *FetchTool) NeedsApproval() bool
- func (t *FetchTool) TimeoutSeconds() int
- type URLSecurityOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollapseWhitespace ¶
CollapseWhitespace reduces runs of whitespace and blank lines.
func HTMLToText ¶
HTMLToText converts HTML to simplified readable text.
func NewSafeHTTPClient ¶
NewSafeHTTPClient returns an HTTP client that revalidates every dial target and refuses private/local destinations.
func NewSafeHTTPClientWithOptions ¶
func NewSafeHTTPClientWithOptions(timeout time.Duration, opts URLSecurityOptions) *http.Client
NewSafeHTTPClientWithOptions returns an HTTP client that revalidates every dial target using explicit URL security options.
func ValidateHTTPURL ¶
ValidateHTTPURL validates an agent-supplied HTTP(S) URL. Private/local destinations are rejected unless opts explicitly allows them.
Types ¶
type FetchTool ¶
type FetchTool struct {
AllowPrivateNetworkURLs bool
}
FetchTool fetches a URL and converts HTML to readable text.
func (*FetchTool) Description ¶
func (*FetchTool) Execute ¶
func (t *FetchTool) Execute(ctx context.Context, input json.RawMessage, _ string) (agentsdk.ToolResult, error)
func (*FetchTool) InputSchema ¶
func (t *FetchTool) InputSchema() json.RawMessage
func (*FetchTool) IsReadOnly ¶
func (*FetchTool) NeedsApproval ¶
func (*FetchTool) TimeoutSeconds ¶
type URLSecurityOptions ¶
type URLSecurityOptions struct {
AllowPrivateNetworkURLs bool
}
Click to show internal directories.
Click to hide internal directories.