relaykitbridge

package
v0.29.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: AGPL-3.0 Imports: 15 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

Overview

Package relaykitbridge adapts RelayKit's four conversational protocols to the gateway's byte-oriented conversion boundary. It owns no transport or billing.

Index

Constants

This section is empty.

Variables

View Source
var ErrConversion = errors.New("RelayKit protocol conversion failed")
View Source
var ErrSpecialized = errors.New("request requires a specialized protocol bridge")

ErrSpecialized is returned only by pre-conversion feature selection. Callers may select an existing specialized bridge for it, never for conversion errors.

Functions

This section is empty.

Types

type Diagnostic added in v0.29.0

type Diagnostic struct {
	Phase      string `json:"phase"`
	Code       string `json:"code"`
	Severity   string `json:"severity"`
	FieldClass string `json:"fieldClass"`
}

Diagnostic is the public, content-free classification of a conversion loss.

type Format

type Format string
const (
	Chat      Format = "chat"
	Responses Format = "responses"
	Messages  Format = "messages"
	Gemini    Format = "gemini"
)

type Session

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

Session owns exactly one request attempt and its reverse response. It is not shared between attempts, users or streams, and is not concurrency-safe.

func ConvertRequest

func ConvertRequest(ctx context.Context, from, to Format, model string, raw []byte) (*Session, []byte, error)

ConvertRequest selects the engine before invoking RelayKit. Native requests keep their exact bytes and do not enter a DTO decoder. model is the selected upstream model; Gemini carries this identity in its URL rather than its body.

func (*Session) ConversionDetails added in v0.29.0

func (s *Session) ConversionDetails() any

ConversionDetails projects only library-owned route labels and reviewed diagnostic classes. Return detached slices for asynchronous log writers.

func (*Session) DiagnosticsSummary added in v0.29.0

func (s *Session) DiagnosticsSummary() []Diagnostic

func (*Session) NewResponseStream

func (s *Session) NewResponseStream() (*Stream, error)

func (*Session) Quality added in v0.29.0

Quality and Steps describe the request route selected by RelayKit. Native pass-through has no converter. Callers own the slices returned by accessors.

func (*Session) Response

func (s *Session) Response(ctx context.Context, raw []byte) ([]byte, error)

func (*Session) Steps added in v0.29.0

func (s *Session) Steps() []relayconvert.RequestStep

type Stream

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

Stream consumes complete SSE frames. The transport owns reading/framing and cancellation; the request context is also checked before every library call.

func (*Stream) Finish

func (s *Stream) Finish() ([]byte, error)

func (*Stream) ResponsesFailureEvents added in v0.29.0

func (s *Stream) ResponsesFailureEvents(message string, delivered ...int) []byte

ResponsesFailureEvents emits a bounded terminal pair once. RelayKit may also return partial tools/text in done events and response.output, so project only error fields and response identity. The transport can supply its delivered frame count when a wire budget discards already converted events.

func (*Stream) TransformEvent

func (s *Stream) TransformEvent(frame []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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