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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2af39ad23ef30a9dcd09b5191da0079b2df3abbcb260a87efc26a04f6e8fbd2e
4
- data.tar.gz: e8fc3cb2c024f9036c88bcbfc4a42bf937f0833ac5f7079841123c592fd2d8f1
3
+ metadata.gz: 4ec2b8025a69a836d633b92ae23c86e8e6d8c6ce42ed6d2da08194909ade1de8
4
+ data.tar.gz: 8a29bfddd6bfef7973483d8efca2e182d3aced3b82bf771beb73f673fc7861a2
5
5
  SHA512:
6
- metadata.gz: 8315f007d4efe93b8c6123a76d4b3375930e1aaf6ff553f95ebfd82359080c63e46b4b118a6510a6bed035e74f3af62c189eeb37a47d829c63103acda097fca1
7
- data.tar.gz: a15d2594f61a285c76298cb360a89a93a584978cce95d0a8243c885a8796debb61f235ae0f272f96300586100233810ab98dd5d0c56d2adb88b208d4013ef3ed
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. Jump to the [Demos](#demos) section to see
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
- ## Demos
29
+ ## Demo
31
30
 
32
31
  <details>
33
- <summary><b>1. An introduction to tool calls</b></summary>
34
- <img src="share/llm-shell/examples/toolcalls.gif/">
32
+ <summary>Reveal demo</summary>
33
+ <img src="share/llm-shell/examples/demo.gif/">
35
34
  </details>
36
35
 
37
36
  <details>
38
- <summary><b>2. Add files as conversation context</b></summary>
39
- <img src="share/llm-shell/examples/files.gif">
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 &ndash; with one file per function. The functions are
57
- loaded at boot time. The functions are shared with the LLM and the LLM
58
- can request their execution. The LLM is also made aware of a function's
59
- return value after it has been called.
50
+ directory &ndash; 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
@@ -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)
@@ -4,5 +4,5 @@ module LLM
4
4
  end unless defined?(LLM)
5
5
 
6
6
  class LLM::Shell
7
- VERSION = "0.9.1"
7
+ VERSION = "0.9.2"
8
8
  end
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.1
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