httpadapter

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFileNotAllowed  = errors.New("file artifact references are not allowed")
	ErrFileOutsideRoot = errors.New("file artifact path is outside artifact root")
	ErrFileTooLarge    = errors.New("file artifact exceeds size limit")
)

Functions

func NewRestrictedArtifactReader added in v0.12.0

func NewRestrictedArtifactReader(root string, maxBytes int64) (promptkit.ArtifactReader, error)

NewRestrictedArtifactReader creates the HTTP artifact reader for a rooted filesystem and optional byte limit. An empty root permits inline artifacts but denies file references; a zero limit permits artifacts of any size.

Types

type Handler

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

func NewHandler

func NewHandler(runner Runner) *Handler

func NewHandlerWithOptions added in v0.11.0

func NewHandlerWithOptions(runner Runner, options HandlerOptions) *Handler

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type HandlerOptions added in v0.11.0

type HandlerOptions struct {
	MaxRequestBytes  int64
	MaxResponseBytes int64
}

type Runner

type Runner interface {
	Run(ctx context.Context, req promptkit.RunRequest) (*promptkit.RunResult, error)
}

Jump to

Keyboard shortcuts

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