Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: env CHATGPT_LANGUAGE does not work (closes #53) #54

Merged
merged 7 commits into from
Mar 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.20
require (
github.com/go-zoox/chalk v1.0.2
github.com/go-zoox/chatbot-feishu v1.2.7
github.com/go-zoox/chatgpt-client v1.3.4
github.com/go-zoox/chatgpt-client v1.3.5
github.com/go-zoox/cli v1.2.0
github.com/go-zoox/core-utils v1.2.7
github.com/go-zoox/feishu v1.3.10
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ github.com/go-zoox/chalk v1.0.2 h1:DCWft37fogmvqF37JdbGSLg28L/tQeA8u0lMvb62KOg=
github.com/go-zoox/chalk v1.0.2/go.mod h1:z5+qvE9nEJI5uT4px2tyoFa/xxkqf3CUo22KmXLKbNI=
github.com/go-zoox/chatbot-feishu v1.2.7 h1:cfmmtXq2isorQUoNlRuHIxlXNbnREDKCbR1090GtN3o=
github.com/go-zoox/chatbot-feishu v1.2.7/go.mod h1:PC+7ZXdsXljFzIeTTxjKHne07kT3ospjfWx/aEGPI18=
github.com/go-zoox/chatgpt-client v1.3.4 h1:LGtDxgPETWVBFcnHDflTU/la+iy+hrBX/4zM4ywfxjc=
github.com/go-zoox/chatgpt-client v1.3.4/go.mod h1:LGuKGLhrNlMzSQDLz3pOukDTTiB1C5q1CnXShNlddhA=
github.com/go-zoox/chatgpt-client v1.3.5 h1:qDGZO0t4HiAY1PY9gjiwaV8tlkJZBko5hKHdC4N5KTI=
github.com/go-zoox/chatgpt-client v1.3.5/go.mod h1:LGuKGLhrNlMzSQDLz3pOukDTTiB1C5q1CnXShNlddhA=
github.com/go-zoox/cli v1.2.0 h1:qBDHwcv2o5xgqGpYokxSszs8MVdNzaNZJJroAhpevFM=
github.com/go-zoox/cli v1.2.0/go.mod h1:p2VJxwXFJRp3+nt29/LihKTNzwAFRkIhnFpf3hyVrmE=
github.com/go-zoox/compress v1.0.1 h1:EyNxo5NscMLua5fvUdiGSF+BwhuTfMeyppu7OwKAW7Q=
Expand Down
46 changes: 23 additions & 23 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ func main() {
&cli.StringFlag{
Name: "conversation-context",
Usage: "Custom chatgpt conversation context",
EnvVars: []string{"CHATGPT_CONTEXT_MESSAGE"},
EnvVars: []string{"CONVERSATION_CONTEXT"},
},
&cli.StringFlag{
Name: "conversation-language",
Usage: "Custom chatgpt conversation lanuage",
EnvVars: []string{"CHATGPT_LANGUAGE"},
EnvVars: []string{"CONVERSATION_LANGUAGE"},
},
&cli.StringFlag{
Name: "logs-dir",
Expand Down Expand Up @@ -128,27 +128,27 @@ func main() {

app.Command(func(ctx *cli.Context) (err error) {
return ServeFeishuBot(&FeishuBotConfig{
LogsDir: ctx.String("logs-dir"),
Port: ctx.Int64("port"),
APIPath: ctx.String("api-path"),
OpenAIAPIKey: ctx.String("openai-api-key"),
AppID: ctx.String("app-id"),
AppSecret: ctx.String("app-secret"),
EncryptKey: ctx.String("encrypt-key"),
VerificationToken: ctx.String("verification-token"),
ReportURL: ctx.String("report-url"),
SiteURL: ctx.String("site-url"),
OpenAIModel: ctx.String("openai-model"),
FeishuBaseURI: ctx.String("feishu-base-uri"),
ChatGPTContext: ctx.String("chatgpt-context"),
ChatGPTLanguage: ctx.String("chatgpt-language"),
OfflineMessage: ctx.String("offline-message"),
AdminEmail: ctx.String("admin-email"),
BotName: ctx.String("bot-name"),
Proxy: ctx.String("proxy"),
OpenAIAPIServer: ctx.String("openai-api-server"),
ProxyOpenAIAPIPath: ctx.String("proxy-openai-api-path"),
ProxyOpenAIAPIToken: ctx.String("proxy-openai-api-token"),
LogsDir: ctx.String("logs-dir"),
Port: ctx.Int64("port"),
APIPath: ctx.String("api-path"),
OpenAIAPIKey: ctx.String("openai-api-key"),
AppID: ctx.String("app-id"),
AppSecret: ctx.String("app-secret"),
EncryptKey: ctx.String("encrypt-key"),
VerificationToken: ctx.String("verification-token"),
ReportURL: ctx.String("report-url"),
SiteURL: ctx.String("site-url"),
OpenAIModel: ctx.String("openai-model"),
FeishuBaseURI: ctx.String("feishu-base-uri"),
ConversationContext: ctx.String("conversation-context"),
ConversationLanguage: ctx.String("conversation-language"),
OfflineMessage: ctx.String("offline-message"),
AdminEmail: ctx.String("admin-email"),
BotName: ctx.String("bot-name"),
Proxy: ctx.String("proxy"),
OpenAIAPIServer: ctx.String("openai-api-server"),
ProxyOpenAIAPIPath: ctx.String("proxy-openai-api-path"),
ProxyOpenAIAPIToken: ctx.String("proxy-openai-api-token"),
})
})

Expand Down
8 changes: 4 additions & 4 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ type FeishuBotConfig struct {
//
FeishuBaseURI string
//
ChatGPTContext string
ChatGPTLanguage string
ConversationContext string
ConversationLanguage string
//
LogsDir string
//
Expand Down Expand Up @@ -92,8 +92,8 @@ func ServeFeishuBot(cfg *FeishuBotConfig) (err error) {
client, err := chatgpt.New(&chatgpt.Config{
APIKey: cfg.OpenAIAPIKey,
APIServer: cfg.OpenAIAPIServer,
ConversationContext: cfg.ChatGPTContext,
ConversationLanguage: cfg.ChatGPTLanguage,
ConversationContext: cfg.ConversationContext,
ConversationLanguage: cfg.ConversationLanguage,
ChatGPTName: cfg.BotName,
Proxy: cfg.Proxy,
})
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main

// Version is the version of lighthouse
var Version = "1.6.4"
var Version = "1.6.7"