-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsgpt.lua.cfg
More file actions
31 lines (27 loc) · 1.08 KB
/
sgpt.lua.cfg
File metadata and controls
31 lines (27 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name = "SGPT"
url = "https://github.com/tbckr/sgpt/releases/latest"
--curl -sL https://github.com/tbckr/sgpt/releases/latest/download/sgpt_Linux_x86_64.tar.gz | tar xz sgpt -O | sudo tee /usr/local/bin/sgpt1 >/dev/null && sudo chmod +x /usr/local/bin/sgpt1
exe = "sgpt"
env = {
apikey = "OPENAI_API_KEY",
apibase = "OPENAI_API_BASE",
}
sets = {
OPENAI_API_BASE = {"model", "apikey"}
}
local CONFIG_HOME = _isWindows and _env"APPDATA" or _env"HOME".."/.config" -- MacOS: ~/Library/Application Support
config = _pathjoin(CONFIG_HOME, "sgpt", "config.yaml")
local CACHE_HOME = _isWindows and _env"LOCALAPPDATA" or _env"HOME".."/.cache"
sessionFile = _pathjoin(CACHE_HOME, "sgpt", "%s.jsonl")
return function (session, stream, model, temperature, top_p, role, extra)
return _pipeOut(exe, _context) {
"stdin",
_optional("--chat", session),
stream and "--stream" or "", --https://sgpt.readthedocs.io/en/latest/configuration/
_optional("--model", model),
_optional("--temperature", temperature),
_optional("--top-p", top_p),
_quote(role),
_optional(extra)
}
end