relaykitbridge

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: AGPL-3.0 Imports: 13 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 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) NewResponseStream

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

func (*Session) Response

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

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) 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