ruby_llm 1.13.1 → 1.13.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.
@@ -312,14 +312,15 @@ module RubyLLM
312
312
  modalities = normalize_models_dev_modalities(model_data[:modalities])
313
313
  capabilities = models_dev_capabilities(model_data, modalities)
314
314
 
315
- created_date = model_data[:release_date] || model_data[:last_updated]
315
+ created_date = [model_data[:release_date], model_data[:last_updated]]
316
+ .find { |value| !value.to_s.strip.empty? }
316
317
 
317
318
  data = {
318
319
  id: model_data[:id],
319
320
  name: model_data[:name] || model_data[:id],
320
321
  provider: provider_slug,
321
322
  family: model_data[:family],
322
- created_at: "#{created_date} 00:00:00 UTC",
323
+ created_at: created_date ? "#{created_date} 00:00:00 UTC" : nil,
323
324
  context_window: model_data.dig(:limit, :context),
324
325
  max_output_tokens: model_data.dig(:limit, :output),
325
326
  knowledge_cutoff: normalize_models_dev_knowledge(model_data[:knowledge]),
@@ -30,7 +30,7 @@ module RubyLLM
30
30
 
31
31
  def handle_stream(&block)
32
32
  build_on_data_handler do |data|
33
- block.call(build_chunk(data)) if data
33
+ block.call(build_chunk(data)) if data.is_a?(Hash)
34
34
  end
35
35
  end
36
36
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyLLM
4
- VERSION = '1.13.1'
4
+ VERSION = '1.13.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_llm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.1
4
+ version: 1.13.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carmine Paolino