Files
Memoh/internal/tts/types.go
T
2026-04-22 00:10:36 +08:00

63 lines
2.2 KiB
Go

package tts
import "time"
// ProviderMetaResponse exposes adapter metadata (from the registry, not DB).
type ProviderMetaResponse struct {
Provider string `json:"provider"`
DisplayName string `json:"display_name"`
Description string `json:"description"`
ConfigSchema ConfigSchema `json:"config_schema,omitempty"`
DefaultModel string `json:"default_model"`
Models []ModelInfo `json:"models"`
}
// SpeechProviderResponse represents a speech-capable provider from the unified providers table.
type SpeechProviderResponse struct {
ID string `json:"id"`
Name string `json:"name"`
ClientType string `json:"client_type"`
Icon string `json:"icon,omitempty"`
Enable bool `json:"enable"`
Config map[string]any `json:"config,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
// SpeechModelResponse represents a speech model from the unified models table.
type SpeechModelResponse struct {
ID string `json:"id"`
ModelID string `json:"model_id"`
Name string `json:"name"`
ProviderID string `json:"provider_id"`
ProviderType string `json:"provider_type,omitempty"`
Config map[string]any `json:"config,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
// UpdateSpeechProviderRequest is used for updating a speech provider.
type UpdateSpeechProviderRequest struct {
Name *string `json:"name,omitempty"`
Enable *bool `json:"enable,omitempty"`
}
// UpdateSpeechModelRequest is used for updating a speech model.
type UpdateSpeechModelRequest struct {
Name *string `json:"name,omitempty"`
Config map[string]any `json:"config,omitempty"`
}
// TestSynthesizeRequest represents a text-to-speech test request.
type TestSynthesizeRequest struct {
Text string `json:"text"`
Config map[string]any `json:"config,omitempty"`
}
// ImportModelsResponse represents the response for importing speech models.
type ImportModelsResponse struct {
Created int `json:"created"`
Skipped int `json:"skipped"`
Models []string `json:"models"`
}