struct Anthropic::Messages
- Anthropic::Messages
- Anthropic::API
- Struct
- Value
- Object
Defined in:
messages.crConstant Summary
-
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 Method Summary
- #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)
- #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)
-
#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
Event
s as they are fed back in.EXPERIMENTAL Streaming message events kinda/sorta works, but needs further testing
Instance methods inherited from struct Anthropic::API
client : Client
client
Constructor methods inherited from struct Anthropic::API
new(client : Anthropic::Client)
new
Instance Method Detail
def 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)
#
def 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)
#
def 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 Event
s as they are fed back in.
EXPERIMENTAL Streaming message events kinda/sorta works, but needs further testing