httputil

package
v1.3.10 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package httputil provides shared HTTP client construction utilities for the PromptKit project. It centralizes timeout defaults and client creation so that every module uses consistent configuration.

Index

Constants

View Source
const (
	// DefaultProviderTimeout is the HTTP timeout for LLM provider calls
	// (e.g. OpenAI, Claude, Gemini). Provider requests can involve large
	// payloads and long inference times, so they use a longer timeout.
	DefaultProviderTimeout = 60 * time.Second

	// DefaultToolTimeout is the HTTP timeout for tool / webhook calls
	// made by the SDK HTTP executor. These are typically shorter-lived
	// API requests.
	DefaultToolTimeout = 30 * time.Second

	// DefaultStreamingTimeout is the HTTP timeout for streaming provider
	// responses (e.g. SSE streams). Streaming connections stay open much
	// longer than regular request/response cycles.
	DefaultStreamingTimeout = 300 * time.Second
)

Standard timeout defaults used across the project.

Variables

This section is empty.

Functions

func NewHTTPClient

func NewHTTPClient(timeout time.Duration) *http.Client

NewHTTPClient returns an *http.Client configured with the given timeout. Pass one of the Default*Timeout constants, or a custom duration.

Types

This section is empty.

Jump to

Keyboard shortcuts

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