From ec2486ce3dee13dea4580d738a97910e5615f02b Mon Sep 17 00:00:00 2001 From: Anton Kuznetcov Date: Thu, 5 Dec 2024 15:48:53 +0600 Subject: [PATCH] release v1.0.4 --- VERSION.txt | 2 +- main.go | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index e946d6b..3e7bcf0 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -v1.0.3 +v1.0.4 diff --git a/main.go b/main.go index a1ab2cf..b02815e 100644 --- a/main.go +++ b/main.go @@ -104,7 +104,7 @@ func getCommands() []*cli.Command { Aliases: []string{"u"}, Usage: "Update the API key", Action: func(c *cli.Context) error { - gpt3 := initGPT() + gpt3 := initGPT(PROMPT) gpt3.UpdateKey() fmt.Println("API key updated.") return nil @@ -115,7 +115,7 @@ func getCommands() []*cli.Command { Aliases: []string{"d"}, Usage: "Delete the API key", Action: func(c *cli.Context) error { - gpt3 := initGPT() + gpt3 := initGPT(PROMPT) gpt3.DeleteKey() fmt.Println("API key deleted.") return nil @@ -138,8 +138,12 @@ func executeMain(file, system, commandInput string) { os.MkdirAll(RESULT_FOLDER, 0755) } - gpt3 := initGPT() + gpt3 := initGPT(system) + // if system != PROMPT { + // commandInput += ". " + system + // } + fmt.Println(commandInput) response, elapsed := getCommand(gpt3, commandInput) if response == "" { fmt.Println("No response received.") @@ -150,12 +154,12 @@ func executeMain(file, system, commandInput string) { handlePostResponse(response, gpt3, system, commandInput) } -func initGPT() gpt.Gpt3 { +func initGPT(system string) gpt.Gpt3 { currentUser, _ := user.Current() return gpt.Gpt3{ CompletionUrl: HOST + COMPLETIONS, Model: MODEL, - Prompt: PROMPT, + Prompt: system, HomeDir: currentUser.HomeDir, ApiKeyFile: API_KEY_FILE, Temperature: 0.01,