ruby_conversations 1.1.3 → 1.1.5

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: 65450a67b9c5b73041bae92b1888a1ed62fbaf2e7877cdbf333ffef9f22c66ee
4
- data.tar.gz: 60255ec9205d6f84cedb7b9f733fce0121b8f4bc8db4e8adb14cfa58bd745550
3
+ metadata.gz: 1e11f8141a2518bdd6a90d3708f66fe6a1c84b7e1544340be228815d80bbcad7
4
+ data.tar.gz: 1c49363d89c613d2950f36e1a25a28ab2a2ea99d9ef0289111f53b1ad0d386ef
5
5
  SHA512:
6
- metadata.gz: 704bd3d750ae71b30890fe19ab9cbe9d2416b881845eee9193dbb8b6bd5b9f6bdcec232715c82b113064977211e7801b64f9bd00fd7e20d020225895526f851c
7
- data.tar.gz: efcda7a901213aa9b5ec5e71196aadc2d319d79432ae21d624d3b3d63e45c8f92079e89041c107c7caf36ca513c7b006969163e88f7effbd3342b219e4f02855
6
+ metadata.gz: 6a272512411b1f93c9c41ce997b5fdb583f464effd5b7457c7ae7a4e6355c650ae9bc2dda0cf7d1c227c456b17b488c20def1b0bebbdb7b7faf41e453d2ab3e6
7
+ data.tar.gz: 70623074136a4b67d4dee25f50c9f6d815eec9087eb1664e1e0110880f4085dc86232170f6c71a067b25cfcce315e196068840fe77526adf2b1fa7a31fdcb472
@@ -18,12 +18,14 @@ module RubyConversations
18
18
  end
19
19
 
20
20
  def with_prompts(prompt_inputs, description: nil)
21
- MessageBuilder.new(self).build_from_multiple_prompts(prompt_inputs, description: description)
21
+ message = MessageBuilder.new(self).build_from_multiple_prompts(prompt_inputs, description: description)
22
+ chat.with_model(message.message_prompts.first.llm) if message.message_prompts.first.llm.present?
22
23
  self
23
24
  end
24
25
 
25
26
  def with_prompt(name, description: nil, inputs: {})
26
- MessageBuilder.new(self).build_from_single_prompt(name, description: description, inputs: inputs)
27
+ message = MessageBuilder.new(self).build_from_single_prompt(name, description: description, inputs: inputs)
28
+ chat.with_model(message.message_prompts.first.llm) if message.message_prompts.first.llm.present?
27
29
  self
28
30
  end
29
31
 
@@ -68,6 +68,7 @@ module RubyConversations
68
68
  prompt_attrs[:message] = message
69
69
  prompt_attrs[:name] = prompt.name
70
70
  prompt_attrs[:role] = prompt.role
71
+ prompt_attrs[:llm] = prompt.llm
71
72
  prompt = RubyConversations::MessagePrompt.new(prompt_attrs)
72
73
  message.message_prompts << prompt
73
74
  prompt
@@ -10,7 +10,7 @@ module RubyConversations
10
10
 
11
11
  # Define attributes
12
12
  attr_accessor :id, :message_id, :prompt_version_id, :name, :role, :content, :metadata,
13
- :created_at, :updated_at, :message_inputs, :draft, :message
13
+ :created_at, :updated_at, :message_inputs, :draft, :message, :llm
14
14
 
15
15
  # Define nested attributes writer
16
16
  def message_inputs_attributes=(attributes)
@@ -9,7 +9,7 @@ module RubyConversations
9
9
 
10
10
  # Define attributes
11
11
  attr_accessor :id, :name, :role, :message, :valid_placeholders, :temperature, :metadata, :created_at, :updated_at,
12
- :latest_version_id
12
+ :latest_version_id, :llm
13
13
 
14
14
  # Constants
15
15
  ROLES = %w[system user assistant].freeze
@@ -10,7 +10,7 @@ module RubyConversations
10
10
  attr_reader :client
11
11
 
12
12
  PROMPT_ATTRIBUTES = %w[
13
- id name message role temperature valid_placeholders created_at updated_at latest_version_id
13
+ id name message role temperature valid_placeholders created_at updated_at latest_version_id llm
14
14
  ].freeze
15
15
 
16
16
  # Initialize a new API client
@@ -3,7 +3,7 @@
3
3
  module RubyConversations
4
4
  MAJOR = 1
5
5
  MINOR = 1
6
- PATCH = 3
6
+ PATCH = 5
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.1.3
4
+ version: 1.1.5
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-05-02 00:00:00.000000000 Z
11
+ date: 2025-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport