intercept

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: AGPL-3.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActorHeadersAsAnthropicOpts

func ActorHeadersAsAnthropicOpts(actor *context.Actor) []ant_option.RequestOption

ActorHeadersAsAnthropicOpts produces a slice of headers using Anthropic's RequestOption type.

func ActorHeadersAsOpenAIOpts

func ActorHeadersAsOpenAIOpts(actor *context.Actor) []oai_option.RequestOption

ActorHeadersAsOpenAIOpts produces a slice of headers using OpenAI's RequestOption type.

func ActorIDHeader

func ActorIDHeader() string

func ActorMetadataHeader

func ActorMetadataHeader(name string) string

func IsActorHeader

func IsActorHeader(name string) bool

Types

type Interceptor

type Interceptor interface {
	// ID returns the unique identifier for this interception.
	ID() uuid.UUID
	// Setup injects some required dependencies. This MUST be called before using the interceptor
	// to process requests.
	Setup(logger slog.Logger, recorder recorder.Recorder, mcpProxy mcp.ServerProxier)
	// Model returns the model in use for this [Interceptor].
	Model() string
	// ProcessRequest handles the HTTP request.
	ProcessRequest(w http.ResponseWriter, r *http.Request) error
	// Specifies whether an interceptor handles streaming or not.
	Streaming() bool
	// TraceAttributes returns tracing attributes for this [Interceptor]
	TraceAttributes(*http.Request) []attribute.KeyValue
}

Interceptor describes a (potentially) stateful interaction with an AI provider.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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