fix: load .env file with godotenv for config
This commit is contained in:
+6
-1
@@ -1,6 +1,10 @@
|
||||
package config
|
||||
|
||||
import "os"
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/joho/godotenv"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
OpenAIAPIKey string
|
||||
@@ -12,6 +16,7 @@ type Config struct {
|
||||
}
|
||||
|
||||
func Load() *Config {
|
||||
_ = godotenv.Load()
|
||||
return &Config{
|
||||
OpenAIAPIKey: getEnv("OPENAI_API_KEY", ""),
|
||||
OpenAIBaseURL: getEnv("OPENAI_BASE_URL", "https://api.openai.com/v1"),
|
||||
|
||||
Reference in New Issue
Block a user