/
sgpt.rb
79 lines (69 loc) · 6.57 KB
/
sgpt.rb
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# lib/aia/tools/sgpt.rb
require_relative 'backend_common'
class AIA::Sgpt < AIA::Tools
include AIA::BackendCommon
meta(
name: 'sgpt',
role: :backend,
desc: "shell-gpt",
url: "https://github.com/TheR1D/shell_gpt",
install: "pip install shell-gpt",
)
DEFAULT_PARAMETERS = [
# "--verbose", # enable verbose logging (if applicable)
# Add default parameters here
].join(' ').freeze
DIRECTIVES = %w[
model
temperature
max_tokens
top_p
frequency_penalty
presence_penalty
stop_sequence
api_key
]
end
__END__
Usage: sgpt [OPTIONS] [PROMPT]
╭─ Arguments ─────────────────────────────────────────────────────────────────────────────────╮
│ prompt [PROMPT] The prompt to generate completions for. │
╰─────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ───────────────────────────────────────────────────────────────────────────────────╮
│ --model TEXT Large language model to use. │
│ [default: gpt-3.5-turbo] │
│ --temperature FLOAT RANGE [0.0<=x<=2.0] Randomness of generated │
│ output. │
│ [default: 0.1] │
│ --top-probability FLOAT RANGE [0.1<=x<=1.0] Limits highest probable │
│ tokens (words). │
│ [default: 1.0] │
│ --editor --no-editor Open $EDITOR to provide a │
│ prompt. │
│ [default: no-editor] │
│ --cache --no-cache Cache completion results. │
│ [default: cache] │
│ --help Show this message and exit. │
╰─────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Assistance Options ────────────────────────────────────────────────────────────────────────╮
│ --shell -s Generate and execute shell commands. │
│ --describe-shell -d Describe a shell command. │
│ --code --no-code Generate only code. [default: no-code] │
╰─────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Chat Options ──────────────────────────────────────────────────────────────────────────────╮
│ --chat TEXT Follow conversation with id, use "temp" for quick │
│ session. │
│ [default: None] │
│ --repl TEXT Start a REPL (Read–eval–print loop) session. │
│ [default: None] │
│ --show-chat TEXT Show all messages from provided chat id. │
│ [default: None] │
│ --list-chats --no-list-chats List all existing chat ids. │
│ [default: no-list-chats] │
╰─────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Role Options ──────────────────────────────────────────────────────────────────────────────╮
│ --role TEXT System role for GPT model. [default: None] │
│ --create-role TEXT Create role. [default: None] │
│ --show-role TEXT Show role. [default: None] │
│ --list-roles --no-list-roles List roles. [default: no-list-roles] │
╰─────────────────────────────────────────────────────────────────────────────────────────────╯