Documentation
¶
Overview ¶
Package client provides a typed HTTP client for talking to a remote SpeechKit Server (the `cmd/speechkit-server` Linux container or any compatible deployment).
Use it from any Go program — desktop, server, or test harness — that wants to consume Dictation, Assist, or Voice Agent endpoints over the network without embedding the kernel.
Auth ¶
The client supports the same bearer-token flow as the server: pass the token via [Options.Token] (or the equivalent env var documented for the server you are calling). For local trusted setups, the server may be configured without a token; the client tolerates that mode.
Timeouts and retries ¶
Per-request timeouts are configured via [Options.Timeout]. The client does not retry by default — host apps own the retry policy because the right behavior differs between idempotent reads (safe to retry) and non-idempotent writes (which may need a higher-level dedupe key).
Index ¶
- type AudioAsset
- type CatalogReadiness
- type Client
- func (c *Client) CatalogContracts(ctx context.Context) ([]framework.ModeContract, error)
- func (c *Client) CatalogProfiles(ctx context.Context, mode string) ([]framework.ProviderProfile, error)
- func (c *Client) CatalogReadiness(ctx context.Context) ([]CatalogReadiness, error)
- func (c *Client) Config(ctx context.Context) (map[string]any, error)
- func (c *Client) CreatePersona(ctx context.Context, payload any) (json.RawMessage, error)
- func (c *Client) CreateRole(ctx context.Context, payload any) (json.RawMessage, error)
- func (c *Client) CreateSequence(ctx context.Context, payload any) (json.RawMessage, error)
- func (c *Client) DeletePersona(ctx context.Context, id string) error
- func (c *Client) DeleteRole(ctx context.Context, id string) error
- func (c *Client) DeleteSequence(ctx context.Context, id string) error
- func (c *Client) DoJSON(ctx context.Context, method, path string, body, out any) error
- func (c *Client) Persona(ctx context.Context, id string) (json.RawMessage, error)
- func (c *Client) Personas(ctx context.Context) (json.RawMessage, error)
- func (c *Client) PersonasList(ctx context.Context) (json.RawMessage, error)
- func (c *Client) ProviderReadiness(ctx context.Context, id string) (*CatalogReadiness, error)
- func (c *Client) RawJSON(ctx context.Context, method, path string, body any) (json.RawMessage, error)
- func (c *Client) ReplaceVocabularyEntries(ctx context.Context, language string, entries []DictionaryEntry) ([]DictionaryEntry, error)
- func (c *Client) Role(ctx context.Context, id string) (json.RawMessage, error)
- func (c *Client) Roles(ctx context.Context) (json.RawMessage, error)
- func (c *Client) Sequence(ctx context.Context, id string) (json.RawMessage, error)
- func (c *Client) Sequences(ctx context.Context) (json.RawMessage, error)
- func (c *Client) Status(ctx context.Context) (*Status, error)
- func (c *Client) TTSSynthesize(ctx context.Context, input TTSSynthesizeRequest) (*TTSSynthesizeResponse, error)
- func (c *Client) TTSVoices(ctx context.Context) ([]Voice, error)
- func (c *Client) TranscribeFile(ctx context.Context, path string, opts TranscribeOptions) (*TranscribeResponse, error)
- func (c *Client) Transcript(ctx context.Context, id int64) (*Transcript, error)
- func (c *Client) Transcripts(ctx context.Context, limit int) ([]Transcript, error)
- func (c *Client) UpdatePersona(ctx context.Context, id string, payload any) (json.RawMessage, error)
- func (c *Client) UpdateRole(ctx context.Context, id string, payload any) (json.RawMessage, error)
- func (c *Client) UpdateSequence(ctx context.Context, id string, payload any) (json.RawMessage, error)
- func (c *Client) VocabularyEntries(ctx context.Context, language string) ([]DictionaryEntry, error)
- func (c *Client) VoiceAgentSessionSummary(ctx context.Context, id int64) (*VoiceAgentSummary, error)
- func (c *Client) VoiceAgentSessionTranscript(ctx context.Context, id int64) (*VoiceAgentTranscript, error)
- type ConfigSummary
- type DictionaryEntry
- type HTTPError
- type Options
- type PersonaResource
- type RoleResource
- type SequenceResource
- type Status
- type TTSSynthesizeRequest
- type TTSSynthesizeResponse
- type TranscribeOptions
- type TranscribeResponse
- type Transcript
- type Voice
- type VoiceAgentSummary
- type VoiceAgentTranscript
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AudioAsset ¶
type CatalogReadiness ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CatalogContracts ¶
func (*Client) CatalogProfiles ¶
func (*Client) CatalogReadiness ¶
func (c *Client) CatalogReadiness(ctx context.Context) ([]CatalogReadiness, error)
func (*Client) CreatePersona ¶
func (*Client) CreateRole ¶
func (*Client) CreateSequence ¶
func (*Client) DeleteSequence ¶
func (*Client) PersonasList ¶
func (*Client) ProviderReadiness ¶
func (*Client) ReplaceVocabularyEntries ¶
func (c *Client) ReplaceVocabularyEntries(ctx context.Context, language string, entries []DictionaryEntry) ([]DictionaryEntry, error)
func (*Client) TTSSynthesize ¶
func (c *Client) TTSSynthesize(ctx context.Context, input TTSSynthesizeRequest) (*TTSSynthesizeResponse, error)
func (*Client) TranscribeFile ¶
func (c *Client) TranscribeFile(ctx context.Context, path string, opts TranscribeOptions) (*TranscribeResponse, error)
func (*Client) Transcript ¶
func (*Client) Transcripts ¶
func (*Client) UpdatePersona ¶
func (*Client) UpdateRole ¶
func (*Client) UpdateSequence ¶
func (*Client) VocabularyEntries ¶
func (*Client) VoiceAgentSessionSummary ¶
func (*Client) VoiceAgentSessionTranscript ¶
type ConfigSummary ¶
type DictionaryEntry ¶
type DictionaryEntry struct {
ID int64 `json:"id,omitempty"`
Spoken string `json:"spoken"`
Canonical string `json:"canonical"`
Language string `json:"language"`
Source string `json:"source,omitempty"`
Enabled bool `json:"enabled"`
UsageCount int `json:"usageCount,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
}
type PersonaResource ¶
type RoleResource ¶
type SequenceResource ¶
type TTSSynthesizeRequest ¶
type TTSSynthesizeResponse ¶
type TranscribeOptions ¶
type TranscribeResponse ¶
type TranscribeResponse struct {
Text string `json:"text"`
Language string `json:"language,omitempty"`
DurationMs int64 `json:"duration_ms"`
LatencyMs int64 `json:"latency_ms"`
Provider string `json:"provider,omitempty"`
Model string `json:"model,omitempty"`
Confidence float64 `json:"confidence,omitempty"`
}
type Transcript ¶
type Transcript struct {
ID int64 `json:"id"`
Text string `json:"text"`
Language string `json:"language"`
Provider string `json:"provider"`
Model string `json:"model"`
DurationMs int64 `json:"durationMs"`
LatencyMs int64 `json:"latencyMs"`
AudioPath string `json:"audioPath,omitempty"`
Audio *AudioAsset `json:"audio,omitempty"`
CreatedAt time.Time `json:"createdAt"`
OwnerUserID string `json:"ownerUserId,omitempty"`
OwnerOrgID string `json:"ownerOrgId,omitempty"`
OwnerSource string `json:"ownerSource,omitempty"`
}