Class: RubyLLM::Providers::Anthropic::Content

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_llm/providers/anthropic/content.rb

Overview

Helper for constructing Anthropic native content blocks.

Class Method Summary collapse

Class Method Details

.new(text = nil, cache: false, cache_control: nil, parts: nil, **extras) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/ruby_llm/providers/anthropic/content.rb', line 9

def new(text = nil, cache: false, cache_control: nil, parts: nil, **extras)
  payload = resolve_payload(
    text: text,
    parts: parts,
    cache: cache,
    cache_control: cache_control,
    extras: extras
  )

  RubyLLM::Content::Raw.new(payload)
end