struct

Anthropic::Messages

Inherits Anthropic::API / Struct / Value / Object

Constants

CREATE_HEADERS = HTTP::Headers {"anthropic-beta" => {"tools-2024-04-04", "max-tokens-3-5-sonnet-2024-07-15", "prompt-caching-2024-07-31"}.join(',')}

Instance methods

create(*, model : String, max_tokens : Int32, messages : Array(Anthropic::Message), system : String | Anthropic::MessageContent | Array | Nil = nil, temperature : Float64 | Nil = nil, top_k : Int64 | Nil = nil, top_p : Float64 | Nil = nil)
Source
create(*, model : String, max_tokens : Int32, messages : Array(Anthropic::Message), system : String | Anthropic::MessageContent | Array | Nil = nil, temperature : Float64 | Nil = nil, top_k : Int64 | Nil = nil, top_p : Float64 | Nil = nil, tools : Array, run_tools : Bool = true) : Array(GeneratedMessage)
Source
create(*, model : String, max_tokens : Int32, messages : Array(Anthropic::Message), system : String | Nil = nil, temperature : Float64 | Nil = nil, top_k : Int64 | Nil = nil, top_p : Float64 | Nil = nil, &block : Event -> T) forall T

Send your prompt to the API and yield Events as they are fed back in.

Source

Nested types