struct

Anthropic::Completions::Request

Inherits Struct < Value < Object

Request model for the legacy completions API.

DEPRECATED: Use Anthropic::Messages::Request with the Messages API instead. This endpoint is provided for backward compatibility only.

Example

request = Anthropic::Completions::Request.new(
  model: "claude-2.1",
  prompt: "\n\nHuman: Hello\n\nAssistant:",
  max_tokens_to_sample: 100
)

Constructors

new(model : String, prompt : String, max_tokens_to_sample : Int32, stop_sequences : Array(String) | Nil = nil, temperature : Float64 | Nil = nil, top_p : Float64 | Nil = nil, top_k : Int32 | Nil = nil, metadata : Metadata | Nil = nil)
Source

Instance methods

max_tokens_to_sample
Source
metadata
Source
model
Source
prompt
Source
stop_sequences
Source
temperature
Source
to_json(json : JSON::Builder) : Nil
Source
top_k
Source
top_p
Source