rbs_goose 0.2.0 → 0.2.1

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: 10bed3f0456e4a9262ed23aa377238af9fa6297fabc1792aac15146c6ef20325
4
- data.tar.gz: 5b7ac52a808a4a62b71e9bb603f14c92d5dadb897b897fde004e9dcc1cbb9fff
3
+ metadata.gz: e0b8c7bfd0c2fc9e55cce1f96ec6049b84bebddf51f0ff12ed4b37ff92f4707d
4
+ data.tar.gz: aea4e28ded2e9c0c949a05b0dea9906b23a790937f9957da7e1675827d9236e0
5
5
  SHA512:
6
- metadata.gz: 9f9e69a4443e9f08cb98f4282df0b4787f13a07563e74debea467da6216bb0e7034f9661c68896f1083e3edad2c9d61c2aa01c11b5864ca7368a1dd9abcd5d48
7
- data.tar.gz: c92d6b1a3c4ac8b6988a8b33192b44a41404cc0e122d13323e945d2a44ba08a39bc261aa33b3c5c99bd9bc45d83c1d24f0702a1412880bafa542ebf6346747e8
6
+ metadata.gz: 590bc72265e0ec354e41767107fa56468a17dd3c458dae461909c4c5460a3213f1620ae642c3db9c0bbbe61a4cf6c7866f056492c6aefbef329f558bf6cb315b
7
+ data.tar.gz: 22e5dbccd22117e3cb7efbf0fac45569c0c0d1e336859c34b91b4509b46672a47dbeea2115067eeb5e7e7adacb94faf8084bbf1a3e5ed5de6e9d12dd99ea53e5
data/Gemfile.lock CHANGED
@@ -121,7 +121,7 @@ GEM
121
121
  diff-lcs (>= 1.2.0, < 2.0)
122
122
  rspec-support (~> 3.13.0)
123
123
  rspec-support (3.13.0)
124
- rubocop (1.63.4)
124
+ rubocop (1.63.5)
125
125
  json (~> 2.3)
126
126
  language_server-protocol (>= 3.17.0)
127
127
  parallel (~> 1.10)
@@ -48,7 +48,7 @@ module RbsGoose
48
48
  end.chat_completion
49
49
  end
50
50
 
51
- def llm_debug(prompt)
51
+ def llm_debug(prompt) # rubocop:disable Metrics/MethodLength
52
52
  return yield if ENV['DEBUG'].nil?
53
53
 
54
54
  puts "!!!!!!!! Prompt !!!!!!!!\n\n#{prompt}\n\n"
@@ -56,8 +56,20 @@ module RbsGoose
56
56
  sec = Benchmark.realtime do
57
57
  result = yield
58
58
  end
59
- puts "!!!!!!!! Stats !!!!!!!!\n\n spend: #{sec}[s]\n prompt_tokens: #{result.prompt_tokens}\n completion_tokens: #{result.completion_tokens}\n" # rubocop:disable Layout/LineLength
60
- puts "!!!!!!!! Result !!!!!!!!\n\n#{result.chat_completion}\n\n"
59
+ puts "!!!!!!!! Stats !!!!!!!!\n\n spend: #{sec}[s]"
60
+ # prompt_token はOllamaなどでサポートされないため、rescueして無視する
61
+ begin
62
+ puts " prompt_tokens: #{result.prompt_tokens}\n completion_tokens: #{result.completion_tokens}\n"
63
+ rescue NoMethodError
64
+ nil
65
+ end
66
+
67
+ # Ollama ではchat_completionではなくcompletionなのでrescueでフォールバックする
68
+ begin
69
+ puts "!!!!!!!! Result !!!!!!!!\n\n#{result.chat_completion}\n\n"
70
+ rescue NoMethodError
71
+ puts "!!!!!!!! Result !!!!!!!!\n\n#{result.completion}\n\n"
72
+ end
61
73
  result
62
74
  end
63
75
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RbsGoose
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbs_goose
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kokuyouwind
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-09 00:00:00.000000000 Z
11
+ date: 2024-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday