ai_runtime

package
v0.1.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: Apache-2.0 Imports: 9 Imported by: ? modules, 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 EnableTerminal

func EnableTerminal(next http.Handler) http.Handler

func MarkFirstToken

func MarkFirstToken(r *http.Request, started time.Time)

func MarkLLMRequestDone

func MarkLLMRequestDone(r *http.Request, started time.Time)

func RegisterLogging

func RegisterLogging(
	r *http.Request,
	summaries bool,
	payloads bool,
	protocol ai_protocols.Protocol,
	requestBody []byte,
)

func SelectedInstanceName

func SelectedInstanceName(r *http.Request) (string, bool)

func StartLLMRequest

func StartLLMRequest(r *http.Request) time.Time

func TerminalEnabled

func TerminalEnabled(r *http.Request) bool

func TerminalHandler

func TerminalHandler(next http.Handler) http.Handler

func WithExecution

func WithExecution(r *http.Request, instanceName string, execute ExecuteFunc) *http.Request

func WithSelectedInstanceName

func WithSelectedInstanceName(r *http.Request, instanceName string) *http.Request

Types

type ExecuteFunc

type ExecuteFunc func(http.ResponseWriter, *http.Request)

type State

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

func FromRequest

func FromRequest(r *http.Request) *State

func (*State) AdvanceRateLimitTarget

func (s *State) AdvanceRateLimitTarget() bool

func (*State) ConfigureRateLimitFallback

func (s *State) ConfigureRateLimitFallback(enabled bool, advance func() bool)

func (*State) Consume

func (s *State) Consume(w http.ResponseWriter, r *http.Request) bool

Consume executes the request-local AI operation at most once. The route response plan owns protocol execution; this guard keeps direct compatibility handlers from forwarding the same request twice when both layers observe it.

func (*State) Execute

func (s *State) Execute(w http.ResponseWriter, r *http.Request) bool

func (*State) InstanceName

func (s *State) InstanceName() string

func (*State) RateLimitFallbackEnabled

func (s *State) RateLimitFallbackEnabled() bool

func (*State) SetInstanceName

func (s *State) SetInstanceName(instanceName string)

func (*State) SetStreamingIntent

func (s *State) SetStreamingIntent(streaming bool)

func (*State) StreamingIntent

func (s *State) StreamingIntent() bool

Jump to

Keyboard shortcuts

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