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 ¶
- Variables
- type Diagnostic
- type Format
- type Session
- func (s *Session) ConversionDetails() any
- func (s *Session) DiagnosticsSummary() []Diagnostic
- func (s *Session) NewResponseStream() (*Stream, error)
- func (s *Session) Quality() relayconvert.RequestConverterQuality
- func (s *Session) Response(ctx context.Context, raw []byte) ([]byte, error)
- func (s *Session) Steps() []relayconvert.RequestStep
- type Stream
Constants ¶
This section is empty.
Variables ¶
var ErrConversion = errors.New("RelayKit protocol conversion failed")
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 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
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 (*Session) Quality ¶ added in v0.29.0
func (s *Session) Quality() relayconvert.RequestConverterQuality
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) 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) ResponsesFailureEvents ¶ added in v0.29.0
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.