Versions in this module Expand all Collapse all v1 v1.0.0 Sep 16, 2026 Changes in this version + const DefaultBM25B + const DefaultBM25K1 + const ToolFeedbackContinuationHint + func AllowConfiguredProxyFirstHop(req *http.Request, rt http.RoundTripper) + func AudioFormat(path string) (string, error) + func CalculateDefaultMaxContextRunes(contextWindow int) int + func CreateHTTPClient(proxyURL string, timeout time.Duration) (*http.Client, error) + func CreateSafeHTTPClient(opts SafeHTTPClientOptions) (*http.Client, error) + func DerefStr(s *string, fallback string) string + func DoRequestWithRetry(client *http.Client, req *http.Request) (*http.Response, error) + func DownloadFile(urlStr, filename string, opts DownloadOptions) string + func DownloadFileSimple(url, filename string) string + func DownloadToFile(ctx context.Context, client *http.Client, req *http.Request, maxBytes int64) (string, error) + func ExtractZipFile(zipPath string, targetDir string) error + func FitToolFeedbackMessage(content string, maxLen int) string + func FormatArgsJSON(args map[string]any, prettyPrint, disableEscapeHTML bool) string + func FormatToolFeedbackMessage(toolName, explanation, argsPreview string) string + func HtmlToMarkdown(htmlStr string) (string, error) + func IsAudioFile(filename, contentType string) bool + func IsObviousPrivateHost(host string, whitelist *PrivateHostWhitelist, allowPrivateHosts func() bool) bool + func IsPrivateOrRestrictedIP(ip net.IP) bool + func MeasureContextRunes(messages []providers.Message) int + func NewSafeDialContext(dialer *net.Dialer, whitelist *PrivateHostWhitelist, ...) func(context.Context, string, string) (net.Conn, error) + func ResolveMaxContextRunes(configValue, contextWindow int) int + func SanitizeFilename(filename string) string + func SanitizeMessageContent(input string) string + func SetDisableTruncation(enabled bool) + func ToolCallExplanationDuplicatesContent(content string, toolCalls []providers.ToolCall) bool + func Truncate(s string, maxLen int) string + func TruncateContextSmart(messages []providers.Message, maxRunes int) []providers.Message + func ValidateSafeHTTPURL(urlStr string, whitelist *PrivateHostWhitelist, allowPrivateHosts func() bool) error + func ValidateSkillIdentifier(identifier string) error + func VisibleToolCallArgumentsPreview(tc providers.ToolCall, maxLen int) string + func VisibleToolCallNameAndArguments(tc providers.ToolCall) (string, string) + type BM25Engine struct + func NewBM25Engine[T any](corpus []T, textFunc func(T) string, opts ...BM25Option) *BM25Engine[T] + func (e *BM25Engine[T]) Search(query string, topK int) []BM25Result[T] + type BM25Option func(*bm25Config) + func WithB(b float64) BM25Option + func WithK1(k1 float64) BM25Option + type BM25Result struct + Document T + Score float32 + type DownloadOptions struct + BlockPrivateTargets bool + ExtraHeaders map[string]string + LoggerPrefix string + ProxyURL string + Timeout time.Duration + type PrivateHostWhitelist struct + func NewPrivateHostWhitelist(entries []string) (*PrivateHostWhitelist, error) + func (w *PrivateHostWhitelist) Contains(ip net.IP) bool + type SafeHTTPClientOptions struct + AllowPrivateHosts func() bool + MaxRedirects int + PrivateHostWhitelist []string + ProxyURL string + Timeout time.Duration + type VisibleToolCall struct + ExtraContent *VisibleToolCallExtraContent + Function *VisibleToolCallFunction + ID string + Type string + func BuildVisibleToolCalls(toolCalls []providers.ToolCall, maxArgsLen int) []VisibleToolCall + type VisibleToolCallExtraContent struct + ToolFeedbackExplanation string + type VisibleToolCallFunction struct + Arguments string + Name string