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 +4 -4
- data/lib/smart_prompt/engine.rb +7 -2
- data/lib/smart_prompt/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d88104358f1978296565f7e2ce7246771ee9fe13c6f046076a69a7854a68231c
|
4
|
+
data.tar.gz: 255105fadcbd20000a2fb179d2c9bcc17dab2a334afadc80c4200c78bdf5c5d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2c8edb5550a422c131afbc897fb23a953565f09c394e163bc9d4b424378006bee99d6933095a45dc1f638c97f9e5786f0b0ef244aac1d3dad6d4394813c54f0
|
7
|
+
data.tar.gz: 6a31dcbbc9bb838f2469f9167c839b3cff526ee48b5c7c2bc43714458690bfd68ef97c3a6792e1ae29fe37807088e1a76eb11a765e9ececac677f3ec52681e71
|
data/lib/smart_prompt/engine.rb
CHANGED
@@ -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 =
|
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
|
data/lib/smart_prompt/version.rb
CHANGED
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.
|
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.
|
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: []
|