Replace Groq/Llama with OpenAI API: - Text model: gpt-4o-mini - Vision model: gpt-4o - Rename GEMINI_API_KEY → OPENAI_API_KEY env var - Rename callGroq → callOpenAI, update all related constants and comments Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
36 lines
961 B
Go
36 lines
961 B
Go
package config
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/kelseyhightower/envconfig"
|
|
)
|
|
|
|
type Config struct {
|
|
Port int `envconfig:"PORT" default:"8080"`
|
|
DatabaseURL string `envconfig:"DATABASE_URL" required:"true"`
|
|
|
|
// Firebase
|
|
FirebaseCredentialsFile string `envconfig:"FIREBASE_CREDENTIALS_FILE" required:"true"`
|
|
|
|
// JWT
|
|
JWTSecret string `envconfig:"JWT_SECRET" required:"true"`
|
|
JWTAccessDuration time.Duration `envconfig:"JWT_ACCESS_DURATION" default:"15m"`
|
|
JWTRefreshDuration time.Duration `envconfig:"JWT_REFRESH_DURATION" default:"720h"`
|
|
|
|
// CORS
|
|
AllowedOrigins []string `envconfig:"ALLOWED_ORIGINS" default:"http://localhost:3000"`
|
|
|
|
// External APIs
|
|
OpenAIAPIKey string `envconfig:"OPENAI_API_KEY" required:"true"`
|
|
PexelsAPIKey string `envconfig:"PEXELS_API_KEY" required:"true"`
|
|
}
|
|
|
|
func Load() (*Config, error) {
|
|
var cfg Config
|
|
if err := envconfig.Process("", &cfg); err != nil {
|
|
return nil, err
|
|
}
|
|
return &cfg, nil
|
|
}
|