ruby_llm 1.13.0 → 1.13.1
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: e037afc338572ce65ca4ff1d7db24005a13d07852421bbdcc33a0a75eab9dcca
|
|
4
|
+
data.tar.gz: 7d7faf8f14d05a8b9fb384d7a3d88379a6def691a0c420eeccfac2df91ff0257
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4dc5e45a77b4158568a6992e18b5f73cf01a59b51a5aea1cde3117f2714dc72f08ba84aee4f75584c021101ce0b13622dfb364a138279c2cd21e7e836ac5e98d
|
|
7
|
+
data.tar.gz: 3b31148c54a256e11796c4b7a07f77f887637d651b43a6930e8e5f03ca760c3001c714e06b153fe0a8edab83934afb0577e3c8da0f260a77fc15fb30244e538f
|
data/lib/ruby_llm/attachment.rb
CHANGED
data/lib/ruby_llm/chat.rb
CHANGED
|
@@ -152,7 +152,7 @@ module RubyLLM
|
|
|
152
152
|
|
|
153
153
|
@on[:new_message]&.call unless block_given?
|
|
154
154
|
|
|
155
|
-
if @schema && response.content.is_a?(String)
|
|
155
|
+
if @schema && response.content.is_a?(String) && !response.tool_call?
|
|
156
156
|
begin
|
|
157
157
|
response.content = JSON.parse(response.content)
|
|
158
158
|
rescue JSON::ParserError
|
|
@@ -120,6 +120,7 @@ module RubyLLM
|
|
|
120
120
|
tool_calls: tool_calls,
|
|
121
121
|
input_tokens: data.dig('usageMetadata', 'promptTokenCount'),
|
|
122
122
|
output_tokens: calculate_output_tokens(data),
|
|
123
|
+
cached_tokens: data.dig('usageMetadata', 'cachedContentTokenCount'),
|
|
123
124
|
thinking_tokens: data.dig('usageMetadata', 'thoughtsTokenCount'),
|
|
124
125
|
model_id: data['modelVersion'] || response.env.url.path.split('/')[3].split(':')[0],
|
|
125
126
|
raw: response
|
|
@@ -22,6 +22,7 @@ module RubyLLM
|
|
|
22
22
|
),
|
|
23
23
|
input_tokens: extract_input_tokens(data),
|
|
24
24
|
output_tokens: extract_output_tokens(data),
|
|
25
|
+
cached_tokens: data.dig('usageMetadata', 'cachedContentTokenCount'),
|
|
25
26
|
thinking_tokens: data.dig('usageMetadata', 'thoughtsTokenCount'),
|
|
26
27
|
tool_calls: extract_tool_calls(data)
|
|
27
28
|
)
|
data/lib/ruby_llm/version.rb
CHANGED