From 7a40d8d51ea88b143181a668247eb2a2895739bb Mon Sep 17 00:00:00 2001 From: asrul10 Date: Thu, 19 Sep 2024 00:53:48 -0400 Subject: [PATCH] feat: update prompt and model --- gpt/gpt.go | 7 +++++-- main.go | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gpt/gpt.go b/gpt/gpt.go index 926e30c..6337856 100644 --- a/gpt/gpt.go +++ b/gpt/gpt.go @@ -18,6 +18,7 @@ type Gpt3 struct { HomeDir string ApiKeyFile string ApiKey string + Temperature float64 } type Chat struct { @@ -26,8 +27,9 @@ type Chat struct { } type Gpt3Request struct { - Model string `json:"model"` - Messages []Chat `json:"messages"` + Model string `json:"model"` + Messages []Chat `json:"messages"` + Temperature float64 `json:"temperature"` } type Gpt3Response struct { @@ -139,6 +141,7 @@ func (gpt3 *Gpt3) Completions(ask string) string { payload := Gpt3Request{ gpt3.Model, messages, + gpt3.Temperature, } payloadJson, err := json.Marshal(payload) if err != nil { diff --git a/main.go b/main.go index 883e31b..3737565 100644 --- a/main.go +++ b/main.go @@ -16,8 +16,8 @@ import ( const ( HOST = "https://api.openai.com/v1/" COMPLETIONS = "chat/completions" - MODEL = "gpt-3.5-turbo" - PROMPT = "I want you to reply with linux command and nothing else. Do not write explanations." + MODEL = "gpt-4o-mini" + PROMPT = "Reply with linux command and nothing else. No need explanation. No need code blocks" // This file is created in the user's home directory // Example: /home/username/.openai_api_key @@ -136,6 +136,7 @@ func main() { Prompt: PROMPT, HomeDir: currentUser.HomeDir, ApiKeyFile: API_KEY_FILE, + Temperature: 0.01, } if h == CMD_UPDATE {