struct

Anthropic::Completion

Inherits JSON::Serializable < Struct < Value < Object

[Legacy] Text Completion object returned by the Completions API.

The Text Completions API is a legacy API; prefer the Messages API for new code. Future models and features are not compatible with Text Completions. See the migration guide in the Anthropic docs for guidance on moving from Text Completions to Messages.

Constructors

new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

completion

The resulting completion text (up to max_tokens_to_sample tokens).

Source
id

Unique identifier for the completion.

Source
model

Model that completed the prompt.

Source
stop_reason

Reason generation stopped (nil while streaming intermediate chunks).

Source
type

Object type. Always "completion".

Source