Documentation
¶
Overview ¶
Package responses adapts one explicitly selected own endpoint to SpeechKit's existing cascaded/native conversation pipeline. The application owns account, consent, funding and current endpoint admission; this adapter never selects a model, an agent, a credential or a fallback.
Stability: Experimental
Index ¶
- Constants
- func ValidateContext(messages []Message) error
- type Agent
- func (a *Agent) Run(ctx context.Context, input cascaded.AgentInput) (cascaded.AgentOutput, error)
- func (a *Agent) Stream(ctx context.Context, input cascaded.AgentInput, emit func(string) error) (cascaded.AgentOutput, error)
- func (a *Agent) StreamTurn(ctx context.Context, input cascaded.AgentInput, turnID string, ...) (cascaded.AgentOutput, error)
- type Config
- type Connection
- type Context
- type Message
- type TurnError
Constants ¶
const MaxContextBytes = 128 << 10
MaxContextBytes bounds the encoded conversation context.
const MaxContextMessages = 128
MaxContextMessages bounds the retained conversation length.
Variables ¶
This section is empty.
Functions ¶
func ValidateContext ¶
ValidateContext checks the bounded conversation accepted by this adapter.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent streams responses for one immutable endpoint binding.
func (*Agent) Run ¶
func (a *Agent) Run(ctx context.Context, input cascaded.AgentInput) (cascaded.AgentOutput, error)
Run collects the answer for one cascaded conversation turn.
func (*Agent) Stream ¶
func (a *Agent) Stream(ctx context.Context, input cascaded.AgentInput, emit func(string) error) (cascaded.AgentOutput, error)
Stream emits answer fragments for one cascaded conversation turn.
func (*Agent) StreamTurn ¶
func (a *Agent) StreamTurn(ctx context.Context, input cascaded.AgentInput, turnID string, emit func(string) error) (cascaded.AgentOutput, error)
StreamTurn consumes the observed turn identity before its HTTP effect.
type Config ¶
type Config struct {
URL string
Connection Connection
Messages []Message
Surface string
Headers func(context.Context, []byte) (http.Header, error)
Client *http.Client
}
Config is immutable for one voice lifetime. Messages are a bounded copy of the existing client-local direct chat, not a new durable conversation store.
type Connection ¶
type Connection struct {
Mode string `json:"mode"`
EndpointID string `json:"endpointId"`
Model string `json:"model"`
}
Connection binds the explicitly selected endpoint and model.
type Context ¶
type Context struct {
Connection Connection `json:"connection"`
Messages []Message `json:"messages"`
Surface string `json:"surface"`
ConversationID string `json:"conversationId"`
}
Context is the application-owned plain direct chat retained for this voice lifetime. ConversationID is a client correlation value, never a grant.