Documentation
¶
Overview ¶
Package model implements a graph-native process/remote model boundary.
The element is deliberately not an interaction policy or an architecture preset. It forwards exactly the descriptor ports selected by graph topology over a protocol-v4 session, confirms the live descriptor and capability identities, and preserves envelope timing/correlation metadata. Omni, duplex, and upstream are therefore graph arrangements over the same element rather than runtime species.
Index ¶
- Constants
- func ActivityType() element.Type
- func AudioInputType() element.Type
- func CancelType() element.Type
- func CommitType() element.Type
- func ContextType() element.Type
- func FactoryRegistrations() ([]graphruntime.FactoryRegistration, error)
- func GenerateType() element.Type
- func InteractionActType() element.Type
- func InteractionType() element.Type
- func NativeStateType() element.Type
- func OutcomeType() element.Type
- func PreparedAudioType() element.Type
- func PreparedTextType() element.Type
- func RegisterDescriptor(catalog *resolve.Catalog) error
- func RegisterFactory(registry *graphruntime.Registry) error
- func ResultType() element.Type
- func StandardDescriptor() element.Descriptor
- func TextInputType() element.Type
- func TickType() element.Type
- func ToolProposalType() element.Type
- func ToolResultType() element.Type
- func ToolsType() element.Type
- func TranscriptType() element.Type
- func TruncateType() element.Type
- func VideoInputType() element.Type
- type BinaryPayloadSource
- type Bootstrap
- type Config
- type DeploymentRegistry
- type Dialer
- type EncodedPayload
- type Factory
- type JSONCodec
- func (codec *JSONCodec) Decode(valueType element.Type, encoded EncodedPayload) (any, error)
- func (codec *JSONCodec) Encode(valueType element.Type, payload any) (EncodedPayload, error)
- func (codec *JSONCodec) Register(valueType element.Type, factory PayloadFactory) error
- func (codec *JSONCodec) RegisterAdapter(valueType element.Type, adapter PayloadAdapter) error
- func (codec *JSONCodec) Registered(valueType element.Type) bool
- func (codec *JSONCodec) Supports(valueType element.Type) bool
- type MediaPayloadReceiver
- type MediaPayloadSource
- type OpaquePayload
- type PayloadAdapter
- type PayloadCodec
- type PayloadFactory
- type Session
- type VideoInputFrame
Constants ¶
const ( DeploymentRegistryService = "model.external.deployments" PayloadCodecService = "model.external.payload-codec" ConfigSchema = "schema://openrealtime/model/external-config/v1" )
Variables ¶
This section is empty.
Functions ¶
func ActivityType ¶
func AudioInputType ¶
Public type helpers support gateways and adapters without exporting mutable package-level Type values.
func CancelType ¶
func CommitType ¶
func ContextType ¶
func FactoryRegistrations ¶
func FactoryRegistrations() ([]graphruntime.FactoryRegistration, error)
func GenerateType ¶
func InteractionActType ¶
func InteractionType ¶
func NativeStateType ¶
func OutcomeType ¶
func PreparedAudioType ¶
func PreparedTextType ¶
func RegisterDescriptor ¶
RegisterDescriptor and RegisterFactory are isolated integration hooks. The repository-wide catalog intentionally remains untouched in this slice.
func RegisterFactory ¶
func RegisterFactory(registry *graphruntime.Registry) error
func ResultType ¶
func StandardDescriptor ¶
func StandardDescriptor() element.Descriptor
StandardDescriptor is the capability superset used by the initial reference graphs. Every port is optional at the descriptor level: the mounted graph selects a subset, and the live handshake must prove every selected port. This avoids manufacturing one binding package per capability combination while preserving startup refusal for unavailable connections.
func TextInputType ¶
func ToolProposalType ¶
func ToolResultType ¶
func TranscriptType ¶
func TruncateType ¶
func VideoInputType ¶
Types ¶
type BinaryPayloadSource ¶
type BinaryPayloadSource interface{ BinaryPayload() []byte }
type Bootstrap ¶
type Bootstrap struct {
Deployments *DeploymentRegistry
Codec *JSONCodec
}
Bootstrap is the deployment-facing owner of external-model dialers and the default strict payload codec. It keeps transport credentials/configuration in services rather than graph values.
func NewBootstrap ¶
func NewBootstrap() *Bootstrap
func (*Bootstrap) Install ¶
func (bootstrap *Bootstrap) Install(services *graphruntime.ServiceSet) error
Install publishes both required services together. Existing registrations are refused so bootstrap cannot silently replace live deployment authority.
func (*Bootstrap) RegisterClient ¶
RegisterClient installs the concrete child-process/socket sidecar dialer. Remote provider adapters use RegisterDialer with their own Session.
type Config ¶
type Config struct {
Deployment string `json:"deployment"`
Settings json.RawMessage `json:"settings,omitempty"`
RequiredCapabilities []sidecar.CapabilityRequirement `json:"required_capabilities,omitempty"`
PortFormats map[string][]sidecar.WireFormat `json:"port_formats,omitempty"`
}
type DeploymentRegistry ¶
type DeploymentRegistry struct {
// contains filtered or unexported fields
}
DeploymentRegistry resolves symbolic node values to deployment-owned connection details and credentials. Those details never enter Graph IR.
func NewDeploymentRegistry ¶
func NewDeploymentRegistry() *DeploymentRegistry
type Dialer ¶
func ClientDialer ¶
ClientDialer adapts the repository's process/socket sidecar client. Remote Realtime adapters implement Dialer directly and therefore use the same graph contract and attestation path without pretending to be a binding.
type EncodedPayload ¶
type EncodedPayload struct {
JSON json.RawMessage
Binary []byte
Media *sidecar.MediaFrameMetadata
}
EncodedPayload is the complete language-neutral body of one element frame. JSON, binary data, and authenticated media metadata are kept together so an adapter cannot accidentally derive inconsistent wire evidence in two calls.
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory may wrap any descriptor that declares the external-model config schema and services. The zero value supplies StandardDescriptor.
func NewFactory ¶
func NewFactory(descriptor element.Descriptor) (Factory, error)
func (Factory) Descriptor ¶
func (factory Factory) Descriptor() element.Descriptor
func (Factory) ValidateConfig ¶
func (factory Factory) ValidateConfig(source json.RawMessage) error
type JSONCodec ¶
type JSONCodec struct {
// contains filtered or unexported fields
}
JSONCodec provides deterministic strict JSON transport and optional exact Go reconstruction. It owns returned buffers and is safe for concurrent use.
func NewJSONCodec ¶
func NewJSONCodec() *JSONCodec
NewJSONCodec returns an empty codec. NewStandardJSONCodec installs the repository's graph-native mappings for production use.
func NewStandardJSONCodec ¶
func NewStandardJSONCodec() *JSONCodec
NewStandardJSONCodec returns the production codec for graph-native model ports whose Go representation is established in this repository. Unknown extension types remain explicitly opaque and may be registered by the deployment before installation.
func (*JSONCodec) Register ¶
func (codec *JSONCodec) Register(valueType element.Type, factory PayloadFactory) error
func (*JSONCodec) RegisterAdapter ¶
func (codec *JSONCodec) RegisterAdapter(valueType element.Type, adapter PayloadAdapter) error
func (*JSONCodec) Registered ¶
Registered is retained as a readable alias for deployment code that wants to inspect the immutable codec registry before installing it as a service.
type MediaPayloadReceiver ¶
type MediaPayloadReceiver interface {
SetMediaFrameMetadata(sidecar.MediaFrameMetadata) error
}
type MediaPayloadSource ¶
type MediaPayloadSource interface {
MediaFrameMetadata() *sidecar.MediaFrameMetadata
}
type OpaquePayload ¶
type OpaquePayload struct {
JSON json.RawMessage
Binary []byte
Media *sidecar.MediaFrameMetadata
}
type PayloadAdapter ¶
type PayloadAdapter struct {
Factory PayloadFactory
MarshalJSON func(any) (json.RawMessage, error)
ExtractBinary func(any) ([]byte, *sidecar.MediaFrameMetadata, error)
AttachBinary func(any, []byte, *sidecar.MediaFrameMetadata) error
// contains filtered or unexported fields
}
PayloadAdapter owns reconstruction for one exact graph type. Nil hooks use strict JSON plus the generic BinaryPayload*/MediaPayload* interfaces.
type PayloadCodec ¶
type PayloadCodec interface {
Encode(element.Type, any) (EncodedPayload, error)
Decode(element.Type, EncodedPayload) (any, error)
Supports(element.Type) bool
}
PayloadCodec separates language-neutral wire representation from Go-native values. Unknown types remain OpaquePayload; registered types reconstruct an exact graph-native value.
type PayloadFactory ¶
type PayloadFactory func() any
type Session ¶
type Session interface {
Ready() sidecar.Message
Frames() <-chan sidecar.Message
Err() error
Send(sidecar.Message) error
Close() error
}
Session is the lifecycle and frame surface shared by a spawned sidecar, a persistent model server, and an upstream Realtime protocol adapter.
type VideoInputFrame ¶
type VideoInputFrame struct {
StreamID string `json:"stream_id"`
Frame perception.Frame `json:"frame"`
FrameRateMilliHz int `json:"frame_rate_millihz"`
}
VideoInputFrame is one directly observed image addressed to a live model stream. FrameRateMilliHz is explicit protocol evidence; it must not be guessed from arrival cadence by the transport adapter.