smart_prompt 0.3.3 → 0.3.4

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: ced076006bec94a02a4612d9d86794c6a1468b50b386ce99e67f9905631db289
4
- data.tar.gz: f815ef18d7a297552db4aeb679d4213d03662f532876f2780b6374b59d9fb40a
3
+ metadata.gz: d88104358f1978296565f7e2ce7246771ee9fe13c6f046076a69a7854a68231c
4
+ data.tar.gz: 255105fadcbd20000a2fb179d2c9bcc17dab2a334afadc80c4200c78bdf5c5d3
5
5
  SHA512:
6
- metadata.gz: 003dbe0204b9eb84a04de6ac3520903fdf92e8621fe79cc7c9fd4360e1f4bb845a425ebd59b82cfe82b8c726ada32ba5dfc7576c2b66a16bf3f95f1e5f6fd9a0
7
- data.tar.gz: ef2887559b141422b9704a5f80076d10037b25c3d0d1d0d27fbb9d6b9a772419789c5d43bc9f68a15c429f19402ef99fe002cf11cfcf719082d37753f1aa8d6e
6
+ metadata.gz: b2c8edb5550a422c131afbc897fb23a953565f09c394e163bc9d4b424378006bee99d6933095a45dc1f638c97f9e5786f0b0ef244aac1d3dad6d4394813c54f0
7
+ data.tar.gz: 6a31dcbbc9bb838f2469f9167c839b3cff526ee48b5c7c2bc43714458690bfd68ef97c3a6792e1ae29fe37807088e1a76eb11a765e9ececac677f3ec52681e71
@@ -12,7 +12,7 @@ module SmartPrompt
12
12
  @history_messages = []
13
13
  load_config(config_file)
14
14
  SmartPrompt.logger.info "Started create the SmartPrompt engine."
15
- @stream_proc = Proc.new do |chunk, _bytesize|
15
+ @stream_proc = Proc.new do |chunk, _bytesize|
16
16
  if @stream_response.empty?
17
17
  @stream_response["id"] = chunk["id"]
18
18
  @stream_response["object"] = chunk["object"]
@@ -31,7 +31,7 @@ module SmartPrompt
31
31
  @stream_response["system_fingerprint"] = chunk["system_fingerprint"]
32
32
  end
33
33
  if chunk.dig("choices", 0, "delta", "reasoning_content")
34
- @stream_response["choices"][0]["message"]["reasoning_content"] += chunk.dig("choices", 0, "delta", "reasoning_content")
34
+ @stream_response["choices"][0]["message"]["reasoning_content"] += chunk.dig("choices", 0, "delta", "reasoning_content")
35
35
  end
36
36
  if chunk.dig("choices", 0, "delta", "content")
37
37
  @stream_response["choices"][0]["message"]["content"] += chunk.dig("choices", 0, "delta", "content")
@@ -115,6 +115,11 @@ module SmartPrompt
115
115
  SmartPrompt.logger.info "Calling worker: #{worker_name} with params: #{params}"
116
116
  worker = get_worker(worker_name)
117
117
  begin
118
+ unless params[:with_history]
119
+ if worker.conversation
120
+ worker.conversation.messages.clear
121
+ end
122
+ end
118
123
  result = worker.execute(params)
119
124
  SmartPrompt.logger.info "Worker #{worker_name} executed successfully"
120
125
  if result.class == String
@@ -1,3 +1,3 @@
1
1
  module SmartPrompt
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_prompt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - zhuang biaowei
@@ -93,6 +93,20 @@ dependencies:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
95
  version: 0.9.2.1
96
+ - !ruby/object:Gem::Dependency
97
+ name: better_prompt
98
+ requirement: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: 0.2.1
103
+ type: :runtime
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: 0.2.1
96
110
  description: SmartPrompt provides a flexible DSL for managing prompts, interacting
97
111
  with multiple LLMs, and creating composable task workers.
98
112
  email:
@@ -137,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
151
  - !ruby/object:Gem::Version
138
152
  version: '0'
139
153
  requirements: []
140
- rubygems_version: 3.6.9
154
+ rubygems_version: 3.7.1
141
155
  specification_version: 4
142
156
  summary: A smart prompt management and LLM interaction gem
143
157
  test_files: []