ruby_conversations 1.0.3 → 1.0.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: 66cba45376a7d4f6693e33c4d3a3068173c4abfacd13a2753b75d2ea0a599613
4
- data.tar.gz: a2d487d00a241c2aab2c1fa8219cd6576f537961c388fc57c940947e811476d9
3
+ metadata.gz: b290c737d59d0eb2cefab58afdb2a1f87f9f52cbe4b3396a63fbcee88b3ab7fd
4
+ data.tar.gz: 951c13ba7e151aefaab4b5c8bff4dce2e1f783f43d4670ccc06a42f63b1d5245
5
5
  SHA512:
6
- metadata.gz: e0c2aaf50d7d657be4fdfcd3b0d659bbeddba654ea5b9d6a838acd132357baf29f89e4ed5135ad0a939c0f3b3213813cc7180a9c959daf6e98fb2b74d7e4cd17
7
- data.tar.gz: 4fe972a101eae9b177b70c3d14cd4bd651a0574e262cd3e7310fc7d029f8134aa443b0dc037065f9a495a88d22b8f0089c307792223a5eb500bd926ab2c85d1d
6
+ metadata.gz: f37b409fc142074098da0ac7cb94e7c7d14164bcbd654d6314e9c5f512f89d6d921deec70ef9cd6532a9bc594d5e29fbc2ec0b0328f15e0bbc510424fcf64dec
7
+ data.tar.gz: ab706df48294795c1064f2e36ccda7a151a6b2e1f0485b57acac140aad203fc13b7ac058004c3eb161286b579f277ba3f3e248f52774a68bbdffd9c8881258ee
@@ -55,6 +55,15 @@ module RubyConversations
55
55
  ai_messages.count
56
56
  end
57
57
 
58
+ def llm
59
+ case model_identifier
60
+ when 'claude-3-7-sonnet'
61
+ 'us.anthropic.claude-3-7-sonnet-20250219-v1:0'
62
+ else
63
+ model_identifier
64
+ end
65
+ end
66
+
58
67
  private
59
68
 
60
69
  def validate_messages
@@ -19,7 +19,7 @@ module RubyConversations
19
19
  end
20
20
 
21
21
  def build_from_multiple_prompts(prompt_inputs, description: nil)
22
- message = initialize_ai_message(description)
22
+ message = build_ai_message('', description)
23
23
 
24
24
  prompt_inputs.each do |prompt_name, inputs|
25
25
  process_single_prompt_input(message, prompt_name, inputs)
@@ -45,15 +45,6 @@ module RubyConversations
45
45
 
46
46
  private
47
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
-
57
48
  def validate_inputs!(prompt, inputs)
58
49
  return unless prompt.valid_placeholders.present?
59
50
 
@@ -92,11 +83,11 @@ module RubyConversations
92
83
  [missing_inputs, extra_inputs]
93
84
  end
94
85
 
95
- def build_ai_message(interpolated_message, description)
86
+ def build_ai_message(request, description)
96
87
  @conversation.ai_messages.build(
97
- request: interpolated_message,
88
+ request: request,
98
89
  change_description: description,
99
- llm: @conversation.model_identifier,
90
+ llm: @conversation.llm,
100
91
  tool: @conversation.tool
101
92
  )
102
93
  end
@@ -10,7 +10,7 @@ module RubyConversations
10
10
 
11
11
  # Associations
12
12
  has_many :versions, class_name: RubyConversations.configuration.prompt_version_class
13
- has_many :message_prompts, class_name: RubyConversations.configuration.message_prompt_class
13
+ has_many :message_prompts, class_name: RubyConversations.configuration.message_prompt_class, dependent: :nullify
14
14
  has_many :messages, through: :message_prompts, class_name: RubyConversations.configuration.message_class,
15
15
  source: :ai_message, dependent: :nullify
16
16
  belongs_to :organization, optional: true
@@ -3,7 +3,7 @@
3
3
  module RubyConversations
4
4
  MAJOR = 1
5
5
  MINOR = 0
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.0.3
4
+ version: 1.0.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-04-02 00:00:00.000000000 Z
11
+ date: 2025-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday