Documentation
¶
Overview ¶
Package http provides an explicitly installed, allowlisted HTTP Tool.
Index ¶
Constants ¶
View Source
const (
Key = "http_request"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
AllowedHosts []string
AllowedMethods []string
AllowHTTP bool
FixedHeaders map[string]string
Timeout time.Duration
MaxRequestBytes int
MaxResponseBytes int
Transport nethttp.RoundTripper
}
Config fixes the network authority available to the model. Hosts include an explicit port when one is required (for example, api.example.com:8443).
type HTTP ¶
type HTTP struct {
// contains filtered or unexported fields
}
func New ¶
New validates and constructs one HTTP Tool. It never reads proxy or credential settings from the process environment.
func (*HTTP) Definition ¶
func (h *HTTP) Definition() tool.Definition
func (*HTTP) Invoke ¶
func (h *HTTP) Invoke(ctx context.Context, invocation tool.ToolInvocation) tool.ToolResult
func (*HTTP) ParallelSafety ¶
func (*HTTP) ParallelSafety() tool.ParallelSafety
type Output ¶
type Output struct {
StatusCode int `json:"status_code"`
ContentType string `json:"content_type,omitempty"`
Body string `json:"body"`
Truncated bool `json:"truncated"`
}
Output is the bounded HTTP response returned to the model. A non-2xx status is still a successfully observed HTTP outcome.
Click to show internal directories.
Click to hide internal directories.