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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ebb363ba1641264fc3c57b883c1d7419db801343e1d8463eb8158887f31ae7e
|
4
|
+
data.tar.gz: fa041b97787b8bc6dbe318edeb547f86fff198ebae3d3632c9b8f1a9311b0ae0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
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.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-
|
11
|
+
date: 2025-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|