ruby_conversations 1.1.6 → 1.1.7

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: 72a2c42a9020a74eae5198be30e88bfa3a91461a0b836322faae6adbb8132e9d
4
- data.tar.gz: 32deefe742f5eda9c4fa6984a5cc343991541bfc9ac14eaf4f999af29919974c
3
+ metadata.gz: 2ebb363ba1641264fc3c57b883c1d7419db801343e1d8463eb8158887f31ae7e
4
+ data.tar.gz: fa041b97787b8bc6dbe318edeb547f86fff198ebae3d3632c9b8f1a9311b0ae0
5
5
  SHA512:
6
- metadata.gz: b8f1ff92c04b3a206e40ab067b872af65436d91384fb0304f7423866f3e08b5936cabc19331ddab55dc12840af4af893e501063e42328bd43de69b5f87ec9ada
7
- data.tar.gz: 4b5af4e32ae1783dac4ca93c907d186ef7c4e3decde3d2978734f4dc9169ed0c3fdd004ca5b38766da6850f6019fe081cb4360944ea14d91d493f7e73f45bc0d
6
+ metadata.gz: 06e4c6c77049cda35384763920f278869ddfdd2e93eb2e7ed660c25686ebbd10407b96c9da37bbfb9f36186da0a75c53845a6eee85b06cd0ded8ba513c231d9d
7
+ data.tar.gz: 47fe53756c3312e24d1b9396c8c102bd79aebc7244b6547397345fb7e9b276d070150d07224bfac11e63223ffa4297c066b015566172650a44835f17c9758419
@@ -21,7 +21,14 @@ module RubyConversations
21
21
  return unless tools_configured?
22
22
  return if tool_calls?(chat_messages)
23
23
 
24
- raise "No tool call found for tool(s): '#{tool_names}'. Please check the prompt."
24
+ last_message = chat_messages.last&.content
25
+ error_message = "No tool call found for tool(s): '#{tool_names}'. Please check the prompt."
26
+
27
+ raise RubyConversations::ToolCallValidationError.new(
28
+ error_message,
29
+ last_message: last_message,
30
+ tool_names: tool_names
31
+ )
25
32
  end
26
33
 
27
34
  def tools_configured?
@@ -19,4 +19,15 @@ module RubyConversations
19
19
 
20
20
  # Error raised when a template is not found
21
21
  class TemplateNotFoundError < Error; end
22
+
23
+ # Error raised when tool calls are expected but not found in LLM response
24
+ class ToolCallValidationError < Error
25
+ attr_reader :last_message, :tool_names
26
+
27
+ def initialize(message, last_message: nil, tool_names: nil)
28
+ super(message)
29
+ @last_message = last_message
30
+ @tool_names = tool_names
31
+ end
32
+ end
22
33
  end
@@ -3,7 +3,7 @@
3
3
  module RubyConversations
4
4
  MAJOR = 1
5
5
  MINOR = 1
6
- PATCH = 6
6
+ PATCH = 7
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.6
4
+ version: 1.1.7
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-16 00:00:00.000000000 Z
11
+ date: 2025-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport