providerio

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 5 Imported by: 0 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

Overview

Package providerio implements shared, per-completion I/O policy for SDKs. Provider-specific message and terminal validation lives in each adapter.

Index

Constants

View Source
const MaxErrorBytes = 64 << 10

Variables

This section is empty.

Functions

func Decoder

func Decoder(reader io.Reader) ssestream.Decoder

Decoder reuses the maintained SDK framing implementation already used in the Messages adapter. Unlike the OpenAI v3.108.0 decoder it yields named events without data, including error events. No global decoder registration. The caller retains body ownership, bounds input and validates each frame.

Types

type Guard

type Guard struct {
	Client *http.Client
	// contains filtered or unexported fields
}

Guard is a per-call SDK HTTP doer. It refuses repeat attempts, preserves the HTTP status before the SDK parses error JSON and owns response cleanup.

func (*Guard) Close

func (g *Guard) Close()

func (*Guard) Do

func (g *Guard) Do(req *http.Request) (*http.Response, error)

func (*Guard) Status

func (g *Guard) Status() int

Jump to

Keyboard shortcuts

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