Method: Anthropic::Models::Message#content

Defined in:
lib/anthropic/models/message.rb

#contentArray<Anthropic::Models::TextBlock, Anthropic::Models::ThinkingBlock, Anthropic::Models::RedactedThinkingBlock, Anthropic::Models::ToolUseBlock, Anthropic::Models::ServerToolUseBlock, Anthropic::Models::WebSearchToolResultBlock, Anthropic::Models::WebFetchToolResultBlock, Anthropic::Models::CodeExecutionToolResultBlock, Anthropic::Models::BashCodeExecutionToolResultBlock, Anthropic::Models::TextEditorCodeExecutionToolResultBlock, Anthropic::Models::ToolSearchToolResultBlock, Anthropic::Models::ContainerUploadBlock>

Content generated by the model.

This is an array of content blocks, each of which has a type that determines its shape.

Example:

[{ "type": "text", "text": "Hi, I'm Claude." }]

If the request input messages ended with an assistant turn, then the response content will continue directly from that last turn. You can use this to constrain the model's output.

For example, if the input messages were:

[
  {
    "role": "user",
    "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
  },
  { "role": "assistant", "content": "The best answer is (" }
]

Then the response content might be:

[{ "type": "text", "text": "B)" }]


59
# File 'lib/anthropic/models/message.rb', line 59

required :content, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::ContentBlock] }