soka 0.0.4 → 0.0.5

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: 63bed0cf9c1546d9269d2a3118ece5d9b601c9b98f12aac3399d259d952ce870
4
- data.tar.gz: 22f07f6f2ff084169a9645b1b290968528f1686c97cef898b584228edac9d432
3
+ metadata.gz: eb5c0a25160f948f0514c8297166706adef7b1d1921854e95cedef2466b561f0
4
+ data.tar.gz: afe45e214ea6077f81d3d21a56474213db820124d1bc46652a960d6a8c524e59
5
5
  SHA512:
6
- metadata.gz: b68243391052669708b953a4cbfd45741070c2305a421741287aebcfc934b93fcc133da9a8137471deb874ee09aaa3e1a4776f308aeb58176ee0d2aa1367f0e9
7
- data.tar.gz: 22a2225e56bc4ef89dfdb130b15c0dcf3254a6ddb4d3c4e9913861e1b264078adc51db545d6c0c9a421eb9d50f46034031ca9d21781a8be59400e8048d119cf3
6
+ metadata.gz: 687b999469d40246dd5c224ec433d634089b81ee8f46d3ba85b6fa469317f2e1d1b65fba7e196905bee7060f41ab73423d054bce86ee432a3126f6868121dbe4
7
+ data.tar.gz: fc52a74769adc232e881019aad8b3d4edc9f72e60a42bc2ecf3178f06591f24a7f9a38830f4c98a0f0048783a8b42ac5854a1e8caf0aac6a5baadbb8357d2d77
data/.rubocop.yml CHANGED
@@ -10,7 +10,7 @@ plugins:
10
10
  - rubocop-rspec
11
11
 
12
12
  AllCops:
13
- TargetRubyVersion: 3.4
13
+ TargetRubyVersion: 3.1
14
14
  SuggestExtensions: false
15
15
 
16
16
  Exclude:
data/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.0.5] - 2025-08-05
11
+
12
+ ### Bug Fixes
13
+ - fix: remove confidence_score from examples and hook manager (12d9e8b)
14
+
15
+ ### Tests
16
+ - test: fix Hash#inspect format compatibility for Ruby 3.4 (c9f1a31)
17
+
18
+ ### Chores
19
+ - chore: update CI workflows to test multiple Ruby versions (d2e1b9a)
20
+ - chore: downgrade minimum Ruby version to 3.1 (8a3d7f0)
21
+
10
22
  ## [0.0.4] - 2025-08-04
11
23
 
12
24
  ### Features
data/examples/1_basic.rb CHANGED
@@ -90,5 +90,4 @@ puts '-' * 50
90
90
 
91
91
  result = agent.run('What time is it now?')
92
92
  puts "✅ Answer: #{result.final_answer}"
93
- puts "📊 Confidence: #{(result.confidence_score * 100).round(1)}%"
94
93
  puts "⏱️ Iterations: #{result.iterations}"
data/examples/3_memory.rb CHANGED
@@ -136,7 +136,6 @@ result = agent_with_memory.run(
136
136
  "Please calculate 15 * 8, and remember this calculation result with key 'first_calc'"
137
137
  )
138
138
  puts "Agent: #{result.final_answer}"
139
- puts "Confidence: #{(result.confidence_score * 100).round(1)}%"
140
139
  puts "Iterations: #{result.iterations}"
141
140
  puts '-' * 50
142
141
 
@@ -10,12 +10,12 @@ module Soka
10
10
  # @param hook_type [Symbol] The type of hook (:before_action, :after_action, :on_error)
11
11
  # @param args [Array] Arguments to pass to the hook methods
12
12
  # @return [Object, nil] The result from on_error hooks, or nil
13
- def run_hooks(hook_type, *)
13
+ def run_hooks(hook_type, ...)
14
14
  return unless self.class._hooks && self.class._hooks[hook_type]
15
15
 
16
16
  self.class._hooks[hook_type].each do |method_name|
17
17
  if respond_to?(method_name, true)
18
- result = send(method_name, *)
18
+ result = send(method_name, ...)
19
19
  return result if hook_type == :on_error && result
20
20
  end
21
21
  end
@@ -32,8 +32,7 @@ module Soka
32
32
  thoughts: engine_result.thoughts,
33
33
  final_answer: engine_result.final_answer,
34
34
  status: engine_result.status,
35
- error: engine_result.error,
36
- confidence_score: engine_result.confidence_score
35
+ error: engine_result.error
37
36
  )
38
37
  end
39
38
 
@@ -59,8 +58,7 @@ module Soka
59
58
  thoughts: [],
60
59
  final_answer: nil,
61
60
  status: :failed,
62
- error: error.message,
63
- confidence_score: 0.0
61
+ error: error.message
64
62
  )
65
63
  end
66
64
  end
@@ -11,7 +11,7 @@ module Soka
11
11
  include Concerns::ResponseParser
12
12
  include Concerns::ResultBuilder
13
13
 
14
- ReasonResult = Struct.new(:input, :thoughts, :final_answer, :status, :error, :confidence_score,
14
+ ReasonResult = Struct.new(:input, :thoughts, :final_answer, :status, :error,
15
15
  keyword_init: true) do
16
16
  def successful?
17
17
  status == :success
data/lib/soka/llm.rb CHANGED
@@ -69,14 +69,14 @@ module Soka
69
69
  # @param provider_name [Symbol] Provider type
70
70
  # @param options [Hash] Provider options
71
71
  # @return [LLMs::Base] Provider instance
72
- def create_provider(provider_name, **)
72
+ def create_provider(provider_name, ...)
73
73
  case provider_name.to_sym
74
74
  when :gemini
75
- LLMs::Gemini.new(**)
75
+ LLMs::Gemini.new(...)
76
76
  when :openai
77
- LLMs::OpenAI.new(**)
77
+ LLMs::OpenAI.new(...)
78
78
  when :anthropic
79
- LLMs::Anthropic.new(**)
79
+ LLMs::Anthropic.new(...)
80
80
  else
81
81
  raise LLMError, "Unknown LLM provider: #{provider_name}"
82
82
  end
data/lib/soka/result.rb CHANGED
@@ -65,8 +65,8 @@ module Soka
65
65
 
66
66
  # Convert to JSON string
67
67
  # @return [String]
68
- def to_json(*)
69
- to_h.to_json(*)
68
+ def to_json(...)
69
+ to_h.to_json(...)
70
70
  end
71
71
 
72
72
  # Get a summary of the result
data/lib/soka/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Soka
4
- VERSION = '0.0.4'
4
+ VERSION = '0.0.5'
5
5
  end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - jiunjiun
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2025-08-05 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: faraday
@@ -98,6 +99,7 @@ metadata:
98
99
  source_code_uri: https://github.com/jiunjiun/soka
99
100
  changelog_uri: https://github.com/jiunjiun/soka/blob/main/CHANGELOG.md
100
101
  rubygems_mfa_required: 'true'
102
+ post_install_message:
101
103
  rdoc_options: []
102
104
  require_paths:
103
105
  - lib
@@ -105,14 +107,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
105
107
  requirements:
106
108
  - - ">="
107
109
  - !ruby/object:Gem::Version
108
- version: '3.4'
110
+ version: '3.1'
109
111
  required_rubygems_version: !ruby/object:Gem::Requirement
110
112
  requirements:
111
113
  - - ">="
112
114
  - !ruby/object:Gem::Version
113
115
  version: '0'
114
116
  requirements: []
115
- rubygems_version: 3.6.9
117
+ rubygems_version: 3.3.27
118
+ signing_key:
116
119
  specification_version: 4
117
120
  summary: A Ruby ReAct Agent Framework with multi-LLM support
118
121
  test_files: []