riffer 0.57.1 → 0.57.2

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: 413379b400d10372b4eb673675c999aed843ebfb22cd7de813f51ddae08a7694
4
- data.tar.gz: 724816e163e06e211531cba968f9e53411fa0d1efd2b9e979d540046354caacd
3
+ metadata.gz: 5a0b2c4a5de151eb7d6b04fcdb294109ec985016e3c0a664518215c0056b6b3d
4
+ data.tar.gz: 2b07877eead03fca26a9f59418c9b590cbb4b65fcfc9d39c947c470e79c3b48f
5
5
  SHA512:
6
- metadata.gz: 29444cee33ea8877b2b5d749f19d46bb87440b51c68e117a5dd70ce3f204ec98949a76e7b0b9212e0454da216832ceb99614cc115d5662ee6d7b2299f15ce44e
7
- data.tar.gz: 308a9191574b0a850d5231e5470f6b0b07c6c3c307c6ed79a3877d158bc8b8c149977d7b4f3ac2a1f75dcedceef13a501abcca7630172f555929aa5841f0fe6f
6
+ metadata.gz: a815d376b2ade4129f162ae0ae2e1c526fcc0fabe6a29901a26ee0a621c1c17b3ec7452faf379e880f0c4d08fc3ee8b783f1bad6d0242645a8890c9ce7aadb30
7
+ data.tar.gz: c15a1e4521e950f9d6b11565e0cfbfeeff25950beaf2ad3445a90074fce85f8fa652ae89a8e2e30f52ec84a60643b7057564fbfaff4e5fd1ed8b8ee46592d3e2
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.57.1"
2
+ ".": "0.57.2"
3
3
  }
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 4.0.9
1
+ 4.0.10
data/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.57.2](https://github.com/janeapp/riffer/compare/riffer/v0.57.1...riffer/v0.57.2) (2026-11-20)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **messages:** raise Riffer::ArgumentError for message hashes missing fields ([#590](https://github.com/janeapp/riffer/issues/590)) ([e85e6c2](https://github.com/janeapp/riffer/commit/e85e6c2392ecdc9e26f7bbdb09da2364176e35c7))
14
+
8
15
  ## [0.57.1](https://github.com/janeapp/riffer/compare/riffer/v0.57.0...riffer/v0.57.1) (2026-11-13)
9
16
 
10
17
 
@@ -22,7 +22,7 @@ class Riffer::Messages::Assistant::ReasoningPart
22
22
  return part if part.is_a?(Riffer::Messages::Assistant::ReasoningPart)
23
23
 
24
24
  new(
25
- type: part[:type].to_sym,
25
+ type: part[:type]&.to_sym,
26
26
  text: part[:text],
27
27
  data: part[:data],
28
28
  signature: part[:signature],
@@ -23,9 +23,13 @@ class Riffer::Messages::Assistant::ServerToolPart
23
23
  def self.from_hash(part)
24
24
  return part if part.is_a?(Riffer::Messages::Assistant::ServerToolPart)
25
25
 
26
+ if part.values_at(:name, :data).any?(&:nil?)
27
+ raise Riffer::ArgumentError, "Server tool part hash must include :name and :data"
28
+ end
29
+
26
30
  new(
27
31
  name: part[:name],
28
- kind: part[:kind].to_sym,
32
+ kind: part[:kind]&.to_sym,
29
33
  data: part[:data],
30
34
  id: part[:id],
31
35
  format: part[:format],
@@ -14,11 +14,12 @@ class Riffer::Messages::Assistant::ToolCall
14
14
  def self.from_hash(call)
15
15
  return call if call.is_a?(Riffer::Messages::Assistant::ToolCall)
16
16
 
17
- if call.values_at(:call_id, :name, :arguments).any?(&:nil?)
18
- raise Riffer::ArgumentError, "Tool call hash must include :call_id, :name, and :arguments"
17
+ if call.values_at(:call_id, :name).any?(&:nil?)
18
+ raise Riffer::ArgumentError, "Tool call hash must include :call_id and :name"
19
19
  end
20
20
 
21
- new(call_id: call[:call_id], name: call[:name], arguments: call[:arguments])
21
+ # A call without arguments can carry "", which a source that drops blank strings omits.
22
+ new(call_id: call[:call_id], name: call[:name], arguments: call[:arguments] || "")
22
23
  end
23
24
 
24
25
  #--
@@ -7,7 +7,8 @@ class Riffer::Messages::System < Riffer::Messages::Base
7
7
  def self.from_hash(msg)
8
8
  return msg if msg.is_a?(Riffer::Messages::System)
9
9
 
10
- new(msg[:content], id: msg[:id])
10
+ # An empty prompt is "", which a source that drops blank strings omits.
11
+ new(msg[:content] || "", id: msg[:id])
11
12
  end
12
13
 
13
14
  #--
@@ -7,8 +7,13 @@ class Riffer::Messages::Tool < Riffer::Messages::Base
7
7
  def self.from_hash(msg)
8
8
  return msg if msg.is_a?(Riffer::Messages::Tool)
9
9
 
10
+ if msg.values_at(:tool_call_id, :name).any?(&:nil?)
11
+ raise Riffer::ArgumentError, "Tool message hash must include :tool_call_id and :name"
12
+ end
13
+
14
+ # An empty result is "", which a source that drops blank strings omits.
10
15
  new(
11
- msg[:content],
16
+ msg[:content] || "",
12
17
  id: msg[:id],
13
18
  tool_call_id: msg[:tool_call_id],
14
19
  name: msg[:name],
@@ -8,7 +8,8 @@ class Riffer::Messages::User < Riffer::Messages::Base
8
8
  return msg if msg.is_a?(Riffer::Messages::User)
9
9
 
10
10
  files = (msg[:files] || []).map { |f| Riffer::Messages::User::FilePart.from_hash(f) }
11
- new(msg[:content], id: msg[:id], files: files)
11
+ # An empty prompt is "", which a source that drops blank strings omits.
12
+ new(msg[:content] || "", id: msg[:id], files: files)
12
13
  end
13
14
 
14
15
  attr_reader :files #: Array[Riffer::Messages::User::FilePart] # @dynamic files
@@ -2,5 +2,5 @@
2
2
  # rbs_inline: enabled
3
3
 
4
4
  module Riffer
5
- VERSION = "0.57.1" #: String
5
+ VERSION = "0.57.2" #: String
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riffer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.57.1
4
+ version: 0.57.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Bottrall