llm-shell 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +11 -16
- data/lib/llm/shell/commands/show_version.rb +33 -0
- data/lib/llm/shell/repl.rb +1 -1
- data/lib/llm/shell/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ec2b8025a69a836d633b92ae23c86e8e6d8c6ce42ed6d2da08194909ade1de8
|
4
|
+
data.tar.gz: 8a29bfddd6bfef7973483d8efca2e182d3aced3b82bf771beb73f673fc7861a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6595412e81ab721f64ab2275ed087e8d01321a8d56c5d4b2566d31f1c0fa0a59c01ddd8981c6c4771c0896481586244bffa642ed8275416c8b2e93010a43956c
|
7
|
+
data.tar.gz: 3ad0f23e6fabc847984b750d86e4adcefb46f2f0748416bcabd91ad5664b4745acb04d80e4faf0e63cd7e2b3747d555e0fe921d961ef611f886a6ba0c34bfa0a
|
data/README.md
CHANGED
@@ -4,8 +4,7 @@ llm-shell is an extensible, developer-oriented command-line
|
|
4
4
|
console that can interact with multiple Large Language Models
|
5
5
|
(LLMs). It serves as both a demo of the [llmrb/llm](https://github.com/llmrb/llm)
|
6
6
|
library and a tool to help improve the library through real-world
|
7
|
-
usage and feedback.
|
8
|
-
it in action.
|
7
|
+
usage and feedback.
|
9
8
|
|
10
9
|
## Features
|
11
10
|
|
@@ -27,21 +26,16 @@ it in action.
|
|
27
26
|
- 📄 Deploys the less pager for long outputs
|
28
27
|
- 📝 Advanced Markdown formatting and output
|
29
28
|
|
30
|
-
##
|
29
|
+
## Demo
|
31
30
|
|
32
31
|
<details>
|
33
|
-
<summary
|
34
|
-
<img src="share/llm-shell/examples/
|
32
|
+
<summary>Reveal demo</summary>
|
33
|
+
<img src="share/llm-shell/examples/demo.gif/">
|
35
34
|
</details>
|
36
35
|
|
37
36
|
<details>
|
38
|
-
<summary
|
39
|
-
<img src="share/llm-shell/examples/
|
40
|
-
</details>
|
41
|
-
|
42
|
-
<details>
|
43
|
-
<summary><b>3. Advanced features: markdown, syntax highlighting</b></summary>
|
44
|
-
<img src="share/llm-shell/examples/codegen.gif">
|
37
|
+
<summary>Reveal demo</summary>
|
38
|
+
<img src="share/llm-shell/examples/demo.png/">
|
45
39
|
</details>
|
46
40
|
|
47
41
|
## Customization
|
@@ -53,10 +47,11 @@ it in action.
|
|
53
47
|
|
54
48
|
llm-shell can be extended with your own functions (also known as tool calls).
|
55
49
|
This can be done by creating a Ruby file in the `~/.llm-shell/functions/`
|
56
|
-
directory – with one file per function.
|
57
|
-
|
58
|
-
|
59
|
-
|
50
|
+
directory – with one file per function.
|
51
|
+
|
52
|
+
The functions are loaded at boot time. The functions are shared with
|
53
|
+
the LLM and the LLM can request their execution. The LLM is also made
|
54
|
+
aware of a function's return value after it has been called.
|
60
55
|
See the
|
61
56
|
[functions/](lib/llm/shell/functions/)
|
62
57
|
directory for more examples:
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class LLM::Shell::Command
|
4
|
+
class ShowVersion
|
5
|
+
require_relative "utils"
|
6
|
+
include Utils
|
7
|
+
|
8
|
+
##
|
9
|
+
# @param [LLM::Shell::Context] context
|
10
|
+
# The context of the command
|
11
|
+
# @return [LLM::Shell::Command::ShowVersion]
|
12
|
+
def initialize(context)
|
13
|
+
@context = context
|
14
|
+
end
|
15
|
+
|
16
|
+
##
|
17
|
+
# Shows the current llm-shell version
|
18
|
+
# @return [void]
|
19
|
+
def call
|
20
|
+
pager do |io|
|
21
|
+
io.write("llm-shell version: #{LLM::Shell::VERSION}\n")
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
LLM.command "show-version" do |cmd|
|
28
|
+
cmd.description "Show the llm-shell version"
|
29
|
+
cmd.register(self)
|
30
|
+
cmd.builtin!
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/llm/shell/repl.rb
CHANGED
@@ -73,7 +73,7 @@ class LLM::Shell
|
|
73
73
|
functions.each do |function|
|
74
74
|
print Paint["system", :bold, :red], " says: ", "\n"
|
75
75
|
print "function: ", function.name, "\n"
|
76
|
-
print "arguments: ", function.arguments, "\n"
|
76
|
+
print "arguments: ", function.arguments.to_h.size, "\n"
|
77
77
|
input = Readline.readline("Do you want to call it ? ", true)
|
78
78
|
puts
|
79
79
|
if %w(y yes yep yeah ok).include?(input)
|
data/lib/llm/shell/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: llm-shell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antar Azri
|
@@ -243,6 +243,7 @@ files:
|
|
243
243
|
- lib/llm/shell/commands/file_import.rb
|
244
244
|
- lib/llm/shell/commands/help.rb
|
245
245
|
- lib/llm/shell/commands/show_chat.rb
|
246
|
+
- lib/llm/shell/commands/show_version.rb
|
246
247
|
- lib/llm/shell/commands/system_prompt.rb
|
247
248
|
- lib/llm/shell/commands/utils.rb
|
248
249
|
- lib/llm/shell/completion.rb
|