Documentation
¶
Overview ¶
Package provider holds what the model clients share and no provider's rules: the HTTP request, the server-sent event reader, the stream of response chunks, the error of an HTTP failure, and its telemetry.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrIncompleteStream is a stream that closed before its terminal event. ErrIncompleteStream = errors.New("incomplete provider stream") // ErrMalformedStream is a stream event that is not valid JSON. ErrMalformedStream = errors.New("malformed provider stream") )
Functions ¶
func EmitFailed ¶
EmitFailed records a failed model request as a span-correlated log event. inputItems summarizes the request's input for diagnosis.
Types ¶
type APIStatusError ¶
APIStatusError is an HTTP error answer from a model API. Find it in a wrapped chain with errors.As.
func (*APIStatusError) Error ¶
func (e *APIStatusError) Error() string
func (*APIStatusError) ProviderErrorCode ¶
func (e *APIStatusError) ProviderErrorCode() string
ProviderErrorCode implements telemetry.ProviderStatus.
func (*APIStatusError) ProviderHTTPStatus ¶
func (e *APIStatusError) ProviderHTTPStatus() int
ProviderHTTPStatus implements telemetry.ProviderStatus.
type Chunks ¶
type Chunks struct {
C chan tacklr.LLMResponseChunk
// contains filtered or unexported fields
}
Chunks is a stream of response chunks that stops sending once its context ends, so a client goroutine never blocks on a reader that left.