Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 086d853

Browse files
committed
fix: update no env error and add config
1 parent 3ea485d commit 086d853

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
APP_ID=
22
APP_SECRET=
33
CHATGPT_API_KEY=
4-
CHATGPT_API_URL=
4+
CHATGPT_API_URL=
5+
ENABLE_SESSION_FOR_LARK_GROUP=true

main.go

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import (
44
"log"
55
"os"
66

7-
"github.com/joho/godotenv"
8-
97
"github.com/bytemate/larkgpt/larkgpt"
108
)
119

@@ -22,15 +20,12 @@ func main() {
2220
}
2321

2422
func loadConfig() (*larkgpt.ClientConfig, error) {
25-
err := godotenv.Load(".env", "../.env")
26-
if err != nil {
27-
return nil, err
28-
}
2923
return &larkgpt.ClientConfig{
30-
AppID: os.Getenv("APP_ID"),
31-
AppSecret: os.Getenv("APP_SECRET"),
32-
ChatGPTAPIKey: os.Getenv("CHATGPT_API_KEY"),
33-
ChatGPTAPIURL: os.Getenv("CHATGPT_API_URL"),
34-
Maintained: os.Getenv("MAINTAINED") == "true",
24+
AppID: os.Getenv("APP_ID"),
25+
AppSecret: os.Getenv("APP_SECRET"),
26+
ChatGPTAPIKey: os.Getenv("CHATGPT_API_KEY"),
27+
ChatGPTAPIURL: os.Getenv("CHATGPT_API_URL"),
28+
Maintained: os.Getenv("MAINTAINED") == "true",
29+
EnableSessionForLarkGroup: os.Getenv("ENABLE_SESSION_FOR_LARK_GROUP") == "true",
3530
}, nil
3631
}

0 commit comments

Comments
 (0)