// Package messages re-exports protobuf message types and provides NATS // subject constants plus helper functions. // // The canonical type definitions live in the generated package // gen/messagespb (from proto/messages/v1/messages.proto). // This package provides type aliases so existing callers can keep using // messages.ChatRequest, etc., while the wire format is now protobuf. package messages import ( "time" pb "git.daviestechlabs.io/daviestechlabs/handler-base/gen/messagespb" ) // ════════════════════════════════════════════════════════════════════════════ // Type aliases — use these or import gen/messagespb directly. // ════════════════════════════════════════════════════════════════════════════ // Common type ErrorResponse = pb.ErrorResponse // Chat type LoginEvent = pb.LoginEvent type GreetingRequest = pb.GreetingRequest type GreetingResponse = pb.GreetingResponse type ChatRequest = pb.ChatRequest type ChatResponse = pb.ChatResponse type ChatStreamChunk = pb.ChatStreamChunk // Voice type VoiceRequest = pb.VoiceRequest type VoiceResponse = pb.VoiceResponse type DocumentSource = pb.DocumentSource // TTS type TTSRequest = pb.TTSRequest type TTSAudioChunk = pb.TTSAudioChunk type TTSFullResponse = pb.TTSFullResponse type TTSStatus = pb.TTSStatus type TTSVoiceInfo = pb.TTSVoiceInfo type TTSVoiceListResponse = pb.TTSVoiceListResponse type TTSVoiceRefreshResponse = pb.TTSVoiceRefreshResponse // STT type STTStreamMessage = pb.STTStreamMessage type STTTranscription = pb.STTTranscription type STTInterrupt = pb.STTInterrupt // Pipeline type PipelineTrigger = pb.PipelineTrigger type PipelineStatus = pb.PipelineStatus // ════════════════════════════════════════════════════════════════════════════ // Helpers // ════════════════════════════════════════════════════════════════════════════ // EffectiveQuery returns Message or falls back to Query. func EffectiveQuery(c *ChatRequest) string { if c.GetMessage() != "" { return c.GetMessage() } return c.GetQuery() } // Timestamp returns the current Unix timestamp. func Timestamp() int64 { return time.Now().Unix() }