soka 0.0.6 → 0.0.7

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: 07c69024bab6c364c20dfdea14e2a9b2dddc6248c6c3c741c1d917fdad0e31b2
4
- data.tar.gz: f89d4e6f71c833f340dda97dbb281d21b7ff586aa8df3de0ebcda419dc947576
3
+ metadata.gz: 484709d85e7835138e502ed9a795257f46289df28f7f3fef31c3e048b62cdc20
4
+ data.tar.gz: 74fa32be0296709abe5dd18480a6fabb6ae9dd0f17aa608a7e1e9f51f3934b37
5
5
  SHA512:
6
- metadata.gz: e10b7c4eb7428b4eec647d26c767af0a9fd87a38f639b5925c12784a3feaad4f9ef2abb907e2eb73e46a271305c14a8d75dca37c0d559758bf5f64d43faf5c1e
7
- data.tar.gz: b34810a3566fd70bddbd0b0922f321c2a7a9aecf2b914b2cf08d613e0f3c5ee9aedb0a8e2ae4d8b4cf8b8551db4b2f2d1ff14d4d47b10f0f0b9b825a595e5854
6
+ metadata.gz: 7665b62bd029b2b29c3cba25c42326160176b5426435fce0e37e4c7929afa33acacb29a5efb431f480efb7e94960d9406feb3467c30b8f284f7ef94cf8e8e5c7
7
+ data.tar.gz: 1af86f19c9d89d156826e676816908f8c56a443586281a744c75a3ba9f0f1c461989a223c82e79204042801147f81710cbb5224059d988de984f18a595c95aac
data/CHANGELOG.md CHANGED
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.0.7] - 2025-08-15
11
+
12
+ ### Features
13
+ - feat: add execution time tracking to ReAct engine (eea5efb)
14
+
15
+ ### Code Refactoring
16
+ - refactor: reduce thought tag word limit for better conciseness (7b3290c)
17
+
10
18
  ## [0.0.6] - 2025-08-12
11
19
 
12
20
  ### Features
@@ -32,7 +32,8 @@ 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
35
+ error: engine_result.error,
36
+ execution_time: engine_result.execution_time
36
37
  )
37
38
  end
38
39
 
@@ -54,7 +54,7 @@ module Soka
54
54
  <<~STRUCTURE
55
55
  🔧 REACT FRAMEWORK STRUCTURE:
56
56
  You MUST use XML-style tags to structure your response. Each tag has a specific purpose:
57
- - <Thought>: Your first-person reasoning (max 30 words)
57
+ - <Thought>: Your first-person reasoning (max 20 words)
58
58
  - <Action>: Tool invocation with JSON parameters
59
59
  - <Observation>: Tool results (provided by system)
60
60
  - <FinalAnswer>: Your complete solution (direct & concise)
@@ -41,7 +41,7 @@ module Soka
41
41
 
42
42
  1️⃣ THINKING PHASE (Required):
43
43
  <Thought>
44
- MAXIMUM 30 WORDS - Be extremely concise!
44
+ MAXIMUM 20 WORDS - Be extremely concise!
45
45
  Use first-person perspective (I, me, my).
46
46
  NEVER mention: "LLM", "AI", "formatting for", "organizing for someone".
47
47
  NEVER say: "I will act as", "I will play the role of", "as an expert".
@@ -9,7 +9,7 @@ module Soka
9
9
  include Concerns::ResponseParser
10
10
  include Concerns::ResultBuilder
11
11
 
12
- ReasonResult = Struct.new(:input, :thoughts, :final_answer, :status, :error,
12
+ ReasonResult = Struct.new(:input, :thoughts, :final_answer, :status, :error, :execution_time,
13
13
  keyword_init: true) do
14
14
  def successful?
15
15
  status == :success
@@ -21,12 +21,18 @@ module Soka
21
21
  # @yield [event] Optional block to handle events during execution
22
22
  # @return [ReasonResult] The result of the reasoning process
23
23
  def reason(task, &block)
24
+ start_time = Time.now
24
25
  context = ReasoningContext.new(task: task, event_handler: block, max_iterations: max_iterations,
25
26
  think_in: think_in)
26
27
  context.messages = build_messages(task)
27
28
 
28
29
  result = iterate_reasoning(context)
29
- result || max_iterations_result(context)
30
+ result ||= max_iterations_result(context)
31
+
32
+ # Add execution time to the result
33
+ execution_time = Time.now - start_time
34
+ result.execution_time = execution_time if result.respond_to?(:execution_time=)
35
+ result
30
36
  end
31
37
 
32
38
  # Iterate through reasoning cycles
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.6'
4
+ VERSION = '0.0.7'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - jiunjiun
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-08-12 00:00:00.000000000 Z
11
+ date: 2025-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday