ruby_conversations 1.0.1 → 1.0.2

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: 3994d5897446552014de346528c5d0c1806fba6c39995fec45d451103e07bece
4
- data.tar.gz: c53dceb24ddfa2535d0a3ebe47380bb6e9f79f2ec890335dbc2ec5b13d20a95d
3
+ metadata.gz: 6928d1d487d9e5a716b8e9bcdf4f0e4363ae2bb2d2cc1ee4939df4e4aee7764a
4
+ data.tar.gz: ab759bb89535426def0743f50e7e0711adc9012f3c61bd7a2daf7e722d7644e1
5
5
  SHA512:
6
- metadata.gz: 86db4d62c0f983cf59ef3bc61e2e60d632ac45d86998e0dfb6263f390b3632d8477f556824dcfc572c8368ea33694a031cc23bdad00326ac876b67d78c1bee7b
7
- data.tar.gz: 2b9a5f579db56d1d66c3cb147d47a282169680223e5e400d745a8543e9beaacef75e2c3ef339beec494741543781090b986d1435236d3c96a807c299013769a9
6
+ metadata.gz: d875c52d737a2dcf105d5be833c1168282a2c92f3df6f9c781cbe7975778b1916d8b067e0a95a4a5cfc733e656c49390d2453d02889253ea8622985826b800a6
7
+ data.tar.gz: 4ec9eea20a8a9c61535bd4fdfa487c040fa07a779e43adda68baaac59a6a00a44967cf54bdc1c440ae5543e113c8fed988cdf969e9a2e0408afe966a2dba75ac
@@ -19,18 +19,14 @@ module RubyConversations
19
19
  end
20
20
 
21
21
  def build_from_multiple_prompts(prompt_inputs, description: nil)
22
- message = @conversation.ai_messages.build(
23
- request: '',
24
- change_description: description,
25
- llm: @conversation.model_identifier,
26
- tool: @conversation.tool
27
- )
22
+ message = initialize_ai_message(description)
28
23
 
29
24
  prompt_inputs.each do |prompt_name, inputs|
30
25
  process_single_prompt_input(message, prompt_name, inputs)
31
26
  end
32
27
 
33
- message # Return the built message
28
+ message.request = message.request.strip
29
+ message
34
30
  end
35
31
 
36
32
  def process_single_prompt_input(message, prompt_name, inputs)
@@ -38,7 +34,7 @@ module RubyConversations
38
34
  validate_inputs!(prompt, inputs)
39
35
 
40
36
  interpolated_message = prompt.interpolate(inputs)
41
- message.request += interpolated_message
37
+ message.request += "#{interpolated_message}\n\n"
42
38
 
43
39
  message_prompt = message.ai_message_prompts.build(
44
40
  prompt_version_id: prompt.latest_version_id,
@@ -49,6 +45,15 @@ module RubyConversations
49
45
 
50
46
  private
51
47
 
48
+ def initialize_ai_message(description)
49
+ @conversation.ai_messages.build(
50
+ request: '',
51
+ change_description: description,
52
+ llm: @conversation.model_identifier,
53
+ tool: @conversation.tool
54
+ )
55
+ end
56
+
52
57
  def validate_inputs!(prompt, inputs)
53
58
  return unless prompt.valid_placeholders.present?
54
59
 
@@ -3,7 +3,7 @@
3
3
  module RubyConversations
4
4
  MAJOR = 1
5
5
  MINOR = 0
6
- PATCH = 1
6
+ PATCH = 2
7
7
 
8
8
  VERSION = "#{RubyConversations::MAJOR}.#{RubyConversations::MINOR}.#{RubyConversations::PATCH}".freeze
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_conversations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Shippy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-01 00:00:00.000000000 Z
11
+ date: 2025-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday