put

package
v0.0.0-...-20b2a55 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTool

func NewTool(ctx context.Context, config *Config) (tool.InvokableTool, error)

Types

type Config

type Config struct {
	// Inspired by the "Requests" tool from the LangChain project, specifically the RequestsPutTool.
	// For more details, visit: https://python.langchain.com/docs/integrations/tools/requests/
	// Optional. Default: "requests_put".
	ToolName string `json:"tool_name"`

	// Optional. Default:Use this when you want to PUT to a website.
	// Input should be a JSON string with two keys: "url" and "body".
	// The value of "url" should be a string, and the value of "body" should be a dictionary of
	// key-value pairs you want to PUT to the URL.
	// Be careful to always use double quotes for strings in the JSON string.
	// The output will be the text response of the PUT request.
	ToolDesc string `json:"tool_desc"`

	// Optional.
	// Headers is a map of HTTP header names to their corresponding values.
	// These headers will be included in every request made by the tool.
	Headers map[string]string `json:"headers"`

	// Optional.
	// HttpClient is the HTTP client used to perform the requests.
	// If not provided, a default client with a 30-second timeout and a standard transport
	// will be initialized and used.
	HttpClient *http.Client
}

type PutRequest

type PutRequest struct {
	URL  string `json:"url" jsonschema_description:"The URL to make the PUT request"`
	Body string `json:"body" jsonschema_description:"The body to send in the PUT request"`
}

type PutRequestTool

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

func (*PutRequestTool) Put

func (r *PutRequestTool) Put(ctx context.Context, req *PutRequest) (string, error)

Jump to

Keyboard shortcuts

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