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 +4 -4
- data/app/models/ruby_conversations/concerns/conversation_messages.rb +4 -2
- data/app/models/ruby_conversations/message_builder.rb +1 -0
- data/app/models/ruby_conversations/message_prompt.rb +1 -1
- data/app/models/ruby_conversations/prompt.rb +1 -1
- data/lib/ruby_conversations/client.rb +1 -1
- data/lib/ruby_conversations/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e11f8141a2518bdd6a90d3708f66fe6a1c84b7e1544340be228815d80bbcad7
|
4
|
+
data.tar.gz: 1c49363d89c613d2950f36e1a25a28ab2a2ea99d9ef0289111f53b1ad0d386ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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-
|
11
|
+
date: 2025-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|