 9bdcbe0447
			
		
	
	9bdcbe0447
	
	
	
		
			
			Major integrations and fixes: - Added BACKBEAT SDK integration for P2P operation timing - Implemented beat-aware status tracking for distributed operations - Added Docker secrets support for secure license management - Resolved KACHING license validation via HTTPS/TLS - Updated docker-compose configuration for clean stack deployment - Disabled rollback policies to prevent deployment failures - Added license credential storage (CHORUS-DEV-MULTI-001) Technical improvements: - BACKBEAT P2P operation tracking with phase management - Enhanced configuration system with file-based secrets - Improved error handling for license validation - Clean separation of KACHING and CHORUS deployment stacks 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
		
			
				
	
	
		
			66 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			66 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| package openai
 | |
| 
 | |
| import (
 | |
| 	"context"
 | |
| 	"net/http"
 | |
| )
 | |
| 
 | |
| type SpeechModel string
 | |
| 
 | |
| const (
 | |
| 	TTSModel1         SpeechModel = "tts-1"
 | |
| 	TTSModel1HD       SpeechModel = "tts-1-hd"
 | |
| 	TTSModelCanary    SpeechModel = "canary-tts"
 | |
| 	TTSModelGPT4oMini SpeechModel = "gpt-4o-mini-tts"
 | |
| )
 | |
| 
 | |
| type SpeechVoice string
 | |
| 
 | |
| const (
 | |
| 	VoiceAlloy   SpeechVoice = "alloy"
 | |
| 	VoiceAsh     SpeechVoice = "ash"
 | |
| 	VoiceBallad  SpeechVoice = "ballad"
 | |
| 	VoiceCoral   SpeechVoice = "coral"
 | |
| 	VoiceEcho    SpeechVoice = "echo"
 | |
| 	VoiceFable   SpeechVoice = "fable"
 | |
| 	VoiceOnyx    SpeechVoice = "onyx"
 | |
| 	VoiceNova    SpeechVoice = "nova"
 | |
| 	VoiceShimmer SpeechVoice = "shimmer"
 | |
| 	VoiceVerse   SpeechVoice = "verse"
 | |
| )
 | |
| 
 | |
| type SpeechResponseFormat string
 | |
| 
 | |
| const (
 | |
| 	SpeechResponseFormatMp3  SpeechResponseFormat = "mp3"
 | |
| 	SpeechResponseFormatOpus SpeechResponseFormat = "opus"
 | |
| 	SpeechResponseFormatAac  SpeechResponseFormat = "aac"
 | |
| 	SpeechResponseFormatFlac SpeechResponseFormat = "flac"
 | |
| 	SpeechResponseFormatWav  SpeechResponseFormat = "wav"
 | |
| 	SpeechResponseFormatPcm  SpeechResponseFormat = "pcm"
 | |
| )
 | |
| 
 | |
| type CreateSpeechRequest struct {
 | |
| 	Model          SpeechModel          `json:"model"`
 | |
| 	Input          string               `json:"input"`
 | |
| 	Voice          SpeechVoice          `json:"voice"`
 | |
| 	Instructions   string               `json:"instructions,omitempty"`    // Optional, Doesnt work with tts-1 or tts-1-hd.
 | |
| 	ResponseFormat SpeechResponseFormat `json:"response_format,omitempty"` // Optional, default to mp3
 | |
| 	Speed          float64              `json:"speed,omitempty"`           // Optional, default to 1.0
 | |
| }
 | |
| 
 | |
| func (c *Client) CreateSpeech(ctx context.Context, request CreateSpeechRequest) (response RawResponse, err error) {
 | |
| 	req, err := c.newRequest(
 | |
| 		ctx,
 | |
| 		http.MethodPost,
 | |
| 		c.fullURL("/audio/speech", withModel(string(request.Model))),
 | |
| 		withBody(request),
 | |
| 		withContentType("application/json"),
 | |
| 	)
 | |
| 	if err != nil {
 | |
| 		return
 | |
| 	}
 | |
| 
 | |
| 	return c.sendRequestRaw(req)
 | |
| }
 |