Anthropic::Completions::Response
Inherits JSON::Serializable < Struct < Value < Object
Response model for the legacy completions API.
DEPRECATED: Use Anthropic::Messages::Response with the Messages API instead.
This endpoint is provided for backward compatibility only.
Example
response = client.completions.create(
model: "claude-2.1",
prompt: "\n\nHuman: Hello\n\nAssistant:",
max_tokens_to_sample: 100
)
puts response.completion
Constructors
new(pull : JSON::PullParser)
Sourcenew(*, __pull_for_json_serializable pull : JSON::PullParser)
SourceInstance methods
completion
Sourcelog_id
Sourcemodel
Sourcerequest_id
Request ID extracted from HTTP response headers (not part of JSON body). Set by Completions::API after parsing the response.
Request ID extracted from HTTP response headers (not part of JSON body). Set by Completions::API after parsing the response.
stop
Sourcestop_reason
Sourcetruncated
Source