feat: 重构项目以符合 Go 规范,添加 OpenAI 接口适配,优化长文本朗读功能(切割后合并)

This commit is contained in:
王锦强
2025-03-09 13:02:28 +08:00
parent 539f6d9ef5
commit 8f2fd68ebe
31 changed files with 2487 additions and 647 deletions

16
internal/models/tts.go Normal file
View File

@@ -0,0 +1,16 @@
package models
// TTSRequest 表示一个语音合成请求
type TTSRequest struct {
Text string `json:"text"` // 要转换的文本
Voice string `json:"voice"` // 语音ID
Rate string `json:"rate"` // 语速 (-100% 到 +100%)
Pitch string `json:"pitch"` // 语调 (-100% 到 +100%)
}
// TTSResponse 表示一个语音合成响应
type TTSResponse struct {
AudioContent []byte `json:"audio_content"` // 音频数据
ContentType string `json:"content_type"` // MIME类型
CacheHit bool `json:"cache_hit"` // 是否命中缓存
}