struct

Anthropic::Messages::Request

Inherits Struct < Value < Object

Constructors

new(model : Model | String, messages : Array(Message), max_tokens : Int32, system : String | Nil = nil, temperature : Float64 | Nil = nil, top_p : Float64 | Nil = nil, top_k : Int32 | Nil = nil, stop_sequences : Array(String) | Nil = nil, stream : Bool | Nil = nil, metadata : Metadata | Nil = nil, tools : Array(ToolDefinition) | Nil = nil, tool_choice : ToolChoice | Nil = nil, thinking : ThinkingConfig | Nil = nil)
Source

Instance methods

max_tokens
Source
messages
Source
metadata
Source
model
Source
stop_sequences
Source
stream
Source
stream=(stream : Bool | Nil)
Source
system
Source
temperature
Source
thinking
Source
to_json(json : JSON::Builder) : Nil
Source
tool_choice
Source
tools
Source
top_k
Source
top_p
Source
with_stream(stream : Bool) : Request

Returns a copy of this request with the stream flag set. Does not mutate the original request.

Source