config

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package config provides configuration management for agentcomms.

Index

Constants

View Source
const (
	ProviderElevenLabs = "elevenlabs"
	ProviderDeepgram   = "deepgram"
	ProviderOpenAI     = "openai"
)

Provider constants.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Server settings
	Port int

	// Phone provider settings (Twilio)
	PhoneProvider   string // "twilio" or "telnyx"
	PhoneAccountSID string
	PhoneAuthToken  string
	PhoneNumber     string // E.164 format, e.g., +15551234567
	UserPhoneNumber string // E.164 format

	// Voice provider selection
	TTSProvider string // "elevenlabs", "deepgram", or "openai"
	STTProvider string // "elevenlabs", "deepgram", or "openai"

	// ElevenLabs settings
	ElevenLabsAPIKey string

	// Deepgram settings
	DeepgramAPIKey string

	// OpenAI settings
	OpenAIAPIKey string

	// TTS settings (provider-agnostic)
	TTSVoice string // Voice ID (provider-specific)
	TTSModel string // Model ID (provider-specific)

	// STT settings (provider-agnostic)
	STTModel             string // Model ID (provider-specific)
	STTLanguage          string // BCP-47 language code (e.g., "en-US")
	STTSilenceDurationMS int    // milliseconds of silence to detect end of speech

	// ngrok settings
	NgrokAuthToken string
	NgrokDomain    string // optional custom domain

	// Timeouts
	TranscriptTimeoutMS int

	// Chat provider settings
	WhatsAppEnabled bool
	WhatsAppDBPath  string

	DiscordEnabled bool
	DiscordToken   string
	DiscordGuildID string

	TelegramEnabled bool
	TelegramToken   string
}

Config holds all configuration for the agentcomms server.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a Config with sensible defaults.

func LoadFromEnv

func LoadFromEnv() (*Config, error)

LoadFromEnv loads configuration from environment variables. Supports both AGENTCOMMS_ and legacy AGENTCALL_ prefixes with AGENTCOMMS_ taking precedence.

func (*Config) ChatEnabled

func (c *Config) ChatEnabled() bool

ChatEnabled returns true if any chat provider is enabled.

func (*Config) NeedsDeepgram

func (c *Config) NeedsDeepgram() bool

NeedsDeepgram returns true if any provider uses Deepgram.

func (*Config) NeedsElevenLabs

func (c *Config) NeedsElevenLabs() bool

NeedsElevenLabs returns true if any provider uses ElevenLabs.

func (*Config) NeedsOpenAI

func (c *Config) NeedsOpenAI() bool

NeedsOpenAI returns true if any provider uses OpenAI.

func (*Config) STTAPIKey

func (c *Config) STTAPIKey() string

STTAPIKey returns the API key for the configured STT provider.

func (*Config) TTSAPIKey

func (c *Config) TTSAPIKey() string

TTSAPIKey returns the API key for the configured TTS provider.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks that required configuration is present.

func (*Config) VoiceEnabled

func (c *Config) VoiceEnabled() bool

VoiceEnabled returns true if voice calling is configured.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL