Documentation
¶
Overview ¶
Package realtime defines explicit duplex model sessions. It owns no audio device, tool executor, transcript store, or endpoint selection.
Index ¶
Constants ¶
const APIVersion = "intelligence.realtime/v1"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AudioControl ¶
type AudioControl interface {
ClearInputAudio(context.Context) error
TruncateAudio(context.Context, string, int, int) error
}
AudioControl is optional. Canceling output and truncating conversation audio to what was played are distinct caller decisions.
type Event ¶
type Event struct {
Kind string `json:"kind"`
NativeType string `json:"nativeType,omitempty"`
ID string `json:"id,omitempty"`
ItemID string `json:"itemId,omitempty"`
ResponseID string `json:"responseId,omitempty"`
Status string `json:"status,omitempty"`
Text string `json:"text,omitempty"`
Audio []byte `json:"audio,omitempty"`
Call *inference.ToolCall `json:"call,omitempty"`
Usage *inference.TokenUsage `json:"usage,omitempty"`
OccurredAt time.Time `json:"occurredAt"`
Raw []byte `json:"raw,omitempty"`
}
type OpenRequest ¶
type OpenRequest struct {
APIVersion string `json:"apiVersion"`
Model string `json:"model"`
Options json.RawMessage `json:"options,omitempty"`
}
OpenRequest starts a caller-selected model session. Options are interpreted only by the selected provider; no endpoint or credential is implicit.
func (OpenRequest) Validate ¶
func (r OpenRequest) Validate() error
type Session ¶
type Session interface {
SendText(context.Context, string) error
SendAudio(context.Context, []byte) error
CommitAudio(context.Context) error
Respond(context.Context) error
Interrupt(context.Context) error
SendToolResult(context.Context, string, []byte) error
Receive(context.Context) (Event, error)
Close() error
}
Session sends caller-selected turns and receives provider events. A tool proposal is data; it is never executed by this interface.