aandrew-me / tgpt

AI Chatbots in terminal without needing API keys
GNU General Public License v3.0
2.04k stars 171 forks source link

Documentation for `~/.config/tgpt` files #231

Closed k12ish closed 8 months ago

k12ish commented 8 months ago

I'm struggling to find out which flags can be set through the configuration file -- a quick grep shows that apiKey probably can't be controlled through config files:

$ rg apiKey
helper.go
40:             ApiKey:      *apiKey,
205:    resp, err := providers.NewRequest(codePrompt, structs.Params{ApiKey: *apiKey, ApiModel: *apiModel, Provider: *provider, Max_length: *max_length, Temperature: *temperature, Top_p: *top_p, Preprompt: *preprompt}, structs.ExtraOptions{})
285:    resp, err := providers.NewRequest(shellPrompt, structs.Params{ApiKey: *apiKey, ApiModel: *apiModel, Provider: *provider, Max_length: *max_length, Temperature: *temperature, Top_p: *top_p, Preprompt: *preprompt}, structs.ExtraOptions{})
412:    resp, err := providers.NewRequest(input, structs.Params{ApiKey: *apiKey, ApiModel: *apiModel, Provider: *provider, Max_length: *max_length, Temperature: *temperature, Top_p: *top_p, Preprompt: *preprompt}, structs.ExtraOptions{})
477:    resp, err := providers.NewRequest(input, structs.Params{ApiKey: *apiKey, ApiModel: *apiModel, Provider: *provider, Max_length: *max_length, Temperature: *temperature, Top_p: *top_p, Preprompt: *preprompt}, structs.ExtraOptions{})

main.go
39:var apiKey *string
61:     apiKey = flag.String("key", "", "Use personal API Key")

$ rg config
README.md
147:If you want to use a proxy, create `proxy.txt` file in the same directory from where you are executing the file and write your proxy configuration there.
165:Configuration file is usually located in `~/.config/tgpt` on GNU/Linux Systems and in `"Library/Application Support/tgpt"` on MacOS

client/client.go
24:             proxyConfig, readErr := os.ReadFile("proxy.txt")
30:             proxyAddress := strings.TrimSpace(string(proxyConfig))

Could you help me understand how to set default values of flags through the configuration file?

Thanks,

aandrew-me commented 8 months ago

Everything is set with flags, no config files for that

k12ish commented 8 months ago

Thanks for you quick reply -- Perhaps I've misunderstood this section of the README:

https://github.com/aandrew-me/tgpt/blob/ec8dadf96e4c0a25319d621ef62ebbfd05b6a83c/README.md?plain=1#L165

Thanks,

aandrew-me commented 8 months ago

Config file was used in old versions, but not anymore