Documentation
¶
Index ¶
- func BuildKeyterms(words []speechcustomize.Word) []string
- func BuildPrompt(words []speechcustomize.Word) string
- func BuildVoiceAgentHint(words []speechcustomize.Word) string
- func CanonicalTerms(words []speechcustomize.Word) []string
- func PublicActions(actions []Action) []speechkit.CustomizationAction
- func ReplacementsFromDictionary(entries []DictionaryEntry) []speechcustomize.Replacement
- func StorageScopeForRef(base speechstorage.Scope, ref speechcustomize.ScopeRef) (speechstorage.Scope, bool)
- func WordsFromDictionary(entries []DictionaryEntry) []speechcustomize.Word
- type Action
- type ApplyResult
- type CompiledApplier
- type DictionaryEntry
- type MatchRecord
- type ProviderBias
- type ProviderBiasPreview
- type ReplacementStore
- type ResolvedSet
- type Service
- type ServiceOptions
- type Set
- type WordStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildKeyterms ¶
func BuildKeyterms(words []speechcustomize.Word) []string
func BuildPrompt ¶
func BuildPrompt(words []speechcustomize.Word) string
func BuildVoiceAgentHint ¶
func BuildVoiceAgentHint(words []speechcustomize.Word) string
func CanonicalTerms ¶
func CanonicalTerms(words []speechcustomize.Word) []string
func PublicActions ¶ added in v0.47.0
func PublicActions(actions []Action) []speechkit.CustomizationAction
func ReplacementsFromDictionary ¶
func ReplacementsFromDictionary(entries []DictionaryEntry) []speechcustomize.Replacement
func StorageScopeForRef ¶
func StorageScopeForRef(base speechstorage.Scope, ref speechcustomize.ScopeRef) (speechstorage.Scope, bool)
func WordsFromDictionary ¶
func WordsFromDictionary(entries []DictionaryEntry) []speechcustomize.Word
Types ¶
type Action ¶ added in v0.47.0
type Action struct {
ReplacementID string `json:"replacement_id,omitempty"`
Kind speechcustomize.Kind `json:"kind"`
Intent string `json:"intent,omitempty"`
Text string `json:"text,omitempty"`
Template string `json:"template,omitempty"`
Payload map[string]any `json:"payload,omitempty"`
MatchedText string `json:"matched_text,omitempty"`
Count int `json:"count"`
}
type ApplyResult ¶
type ApplyResult struct {
Text string
Matches []MatchRecord
Actions []Action
}
func Apply ¶
func Apply(text string, replacements []speechcustomize.Replacement, stage speechcustomize.Stage) (ApplyResult, error)
type CompiledApplier ¶
type CompiledApplier struct {
Replacements []speechcustomize.Replacement
// contains filtered or unexported fields
}
func CompileApplier ¶
func CompileApplier(replacements []speechcustomize.Replacement, context speechcustomize.Context) (*CompiledApplier, error)
func (*CompiledApplier) Apply ¶
func (a *CompiledApplier) Apply(text string) ApplyResult
type DictionaryEntry ¶
type DictionaryEntry struct {
Spoken string
Canonical string
Language string
Source string
Enabled bool
UsageCount int
}
func DictionaryFromSet ¶
func DictionaryFromSet(set Set) []DictionaryEntry
type MatchRecord ¶
type ProviderBias ¶ added in v0.47.0
type ProviderBias struct {
Prompt string
Keyterms []string
ByProvider map[string]provideropts.Values
Preview []ProviderBiasPreview
}
func BuildProviderBias ¶ added in v0.47.0
func BuildProviderBias(words []speechcustomize.Word) ProviderBias
func BuildProviderBiasForModality ¶ added in v0.47.0
func BuildProviderBiasForModality(words []speechcustomize.Word, modality string) ProviderBias
type ProviderBiasPreview ¶ added in v0.47.0
type ReplacementStore ¶
type ReplacementStore interface {
ListReplacements(ctx context.Context, opts speechcustomize.ListOptions) ([]speechcustomize.Replacement, error)
}
type ResolvedSet ¶
type ResolvedSet struct {
Context speechcustomize.Context
Words []speechcustomize.Word
Replacements []speechcustomize.Replacement
Prompt string
Keyterms []string
VoiceAgentHint string
ProviderBias ProviderBias
Applier *CompiledApplier
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(opts ServiceOptions) *Service
func (*Service) Apply ¶
func (s *Service) Apply(ctx context.Context, request speechcustomize.Context, text string) (ApplyResult, error)
func (*Service) Invalidate ¶
func (s *Service) Invalidate()
func (*Service) Resolve ¶
func (s *Service) Resolve(ctx context.Context, request speechcustomize.Context) (ResolvedSet, error)
type ServiceOptions ¶
type ServiceOptions struct {
Store any
ScopeOrder []speechcustomize.ScopeRef
ActiveTemplateIDs []string
DisableBuiltinTemplates bool
}
type Set ¶
type Set struct {
Words []speechcustomize.Word
Replacements []speechcustomize.Replacement
}
type WordStore ¶
type WordStore interface {
ListWords(ctx context.Context, opts speechcustomize.ListOptions) ([]speechcustomize.Word, error)
}
Click to show internal directories.
Click to hide internal directories.