We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
to_h
as_json
1 parent 82313aa commit 8b16d38Copy full SHA for 8b16d38
lib/ruby_llm/attachment.rb
@@ -78,7 +78,7 @@ def text?
78
RubyLLM::MimeType.text? mime_type
79
end
80
81
- def as_json
+ def to_h
82
{ type: a.type, source: a.source }
83
84
lib/ruby_llm/content.rb
@@ -28,8 +28,8 @@ def format
28
29
30
# For Rails serialization
31
32
- { text: @text, attachments: @attachments.map(&:as_json) }
+ { text: @text, attachments: @attachments.map(&:to_h) }
33
34
35
private
0 commit comments