Class: DSPy::LM::GeminiResponseMetadata

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dspy/lm/response.rb

Overview

Gemini-specific metadata with additional fields

Instance Method Summary collapse

Instance Method Details

#to_hObject



101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/dspy/lm/response.rb', line 101

def to_h
  hash = {
    provider: provider,
    model: model
  }
  hash[:response_id] = response_id if response_id
  hash[:created] = created if created
  hash[:structured_output] = structured_output unless structured_output.nil?
  hash[:finish_reason] = finish_reason if finish_reason
  hash[:safety_ratings] = safety_ratings if safety_ratings
  hash[:streaming] = streaming unless streaming.nil?
  hash
end