soka 0.0.6 → 0.0.8

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: 222783fa72ada5e52bb3ad666afb50ec9bf47184cf87e7268cc85f1bcdf38aad
4
+ data.tar.gz: d0f95b6933141e1e992f13321733956430e8619648ccda945246e3ac6b86b234
5
5
  SHA512:
6
- metadata.gz: e10b7c4eb7428b4eec647d26c767af0a9fd87a38f639b5925c12784a3feaad4f9ef2abb907e2eb73e46a271305c14a8d75dca37c0d559758bf5f64d43faf5c1e
7
- data.tar.gz: b34810a3566fd70bddbd0b0922f321c2a7a9aecf2b914b2cf08d613e0f3c5ee9aedb0a8e2ae4d8b4cf8b8551db4b2f2d1ff14d4d47b10f0f0b9b825a595e5854
6
+ metadata.gz: 6b505b2e25f6ac3216d750ef5c0e411c8141c6c5d6dfc5deecae75f799c42fd21b831a873e0602c3e4f8398aacf4e4757947e61a11925b2a22967b98930c3068
7
+ data.tar.gz: 0f62b55320302343f1ba30dabbef068f31d66545b100f691533e96ed9c2d4eb3d4c6851a81e43d5248b83e2d81398f9b49fa24ceb4e19f494d948ae8c75e89db
data/CHANGELOG.md CHANGED
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.0.8] - 2025-08-15
11
+
12
+ ### Tests
13
+ - test: update specs to match reduced thought word limit (73564ae)
14
+
15
+ ## [0.0.7] - 2025-08-15
16
+
17
+ ### Features
18
+ - feat: add execution time tracking to ReAct engine (eea5efb)
19
+
20
+ ### Code Refactoring
21
+ - refactor: reduce thought tag word limit for better conciseness (7b3290c)
22
+
10
23
  ## [0.0.6] - 2025-08-12
11
24
 
12
25
  ### 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".
@@ -56,7 +56,7 @@ module Soka
56
56
 
57
57
  2. 💭 THINKING PHASE:
58
58
  - Always start with <Thought>...</Thought>
59
- - MAXIMUM 30 WORDS per thought
59
+ - MAXIMUM 20 WORDS per thought
60
60
  - Use first-person perspective (I, me, my)
61
61
  - AVOID: "LLM", "AI", "formatting for", "organizing for"
62
62
  - AVOID: "act as", "play role of", "as an expert", "I will be"
@@ -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.8'
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.8
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