Class: Anthropic::Models::CompletionCreateParams
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Anthropic::Models::CompletionCreateParams
- Extended by:
- Internal::Type::RequestParameters::Converter
- Includes:
- Internal::Type::RequestParameters
- Defined in:
- lib/anthropic/models/completion_create_params.rb
Overview
Instance Attribute Summary collapse
-
#betas ⇒ Array<String, Symbol, Anthropic::Models::AnthropicBeta>?
Optional header to specify the beta version(s) you want to use.
-
#max_tokens_to_sample ⇒ Integer
The maximum number of tokens to generate before stopping.
-
#metadata ⇒ Anthropic::Models::Metadata?
An object describing metadata about the request.
-
#model ⇒ Symbol, ...
The model that will complete your prompt.\n\nSee models for additional details and options.
-
#prompt ⇒ String
The prompt that you want Claude to complete.
-
#stop_sequences ⇒ Array<String>?
Sequences that will cause the model to stop generating.
-
#temperature ⇒ Float?
Amount of randomness injected into the response.
-
#top_k ⇒ Integer?
Only sample from the top K options for each subsequent token.
-
#top_p ⇒ Float?
Use nucleus sampling.
Attributes included from Internal::Type::RequestParameters
Instance Method Summary collapse
-
#initialize(max_tokens_to_sample: , model: , prompt: , metadata: nil, stop_sequences: nil, temperature: nil, top_k: nil, top_p: nil, betas: nil, request_options: {}) ⇒ void
constructor
Some parameter documentations has been truncated, see CompletionCreateParams for more details.
Methods included from Internal::Type::RequestParameters::Converter
Methods included from Internal::Type::RequestParameters
Methods inherited from Internal::Type::BaseModel
==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(max_tokens_to_sample: , model: , prompt: , metadata: nil, stop_sequences: nil, temperature: nil, top_k: nil, top_p: nil, betas: nil, request_options: {}) ⇒ void
Some parameter documentations has been truncated, see Anthropic::Models::CompletionCreateParams for more details.
|
# File 'lib/anthropic/models/completion_create_params.rb', line 108
|
Instance Attribute Details
#betas ⇒ Array<String, Symbol, Anthropic::Models::AnthropicBeta>?
Optional header to specify the beta version(s) you want to use.
106 |
# File 'lib/anthropic/models/completion_create_params.rb', line 106 optional :betas, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::AnthropicBeta] } |
#max_tokens_to_sample ⇒ Integer
The maximum number of tokens to generate before stopping.
Note that our models may stop before reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate.
19 |
# File 'lib/anthropic/models/completion_create_params.rb', line 19 required :max_tokens_to_sample, Integer |
#metadata ⇒ Anthropic::Models::Metadata?
An object describing metadata about the request.
51 |
# File 'lib/anthropic/models/completion_create_params.rb', line 51 optional :metadata, -> { Anthropic::Metadata } |
#model ⇒ Symbol, ...
The model that will complete your prompt.\n\nSee models for additional details and options.
27 |
# File 'lib/anthropic/models/completion_create_params.rb', line 27 required :model, union: -> { Anthropic::Model } |
#prompt ⇒ String
The prompt that you want Claude to complete.
For proper response generation you will need to format your prompt using
alternating \n\nHuman:
and \n\nAssistant:
conversational turns. For example:
"\n\nHuman: {userQuestion}\n\nAssistant:"
See prompt validation and our guide to prompt design for more details.
45 |
# File 'lib/anthropic/models/completion_create_params.rb', line 45 required :prompt, String |
#stop_sequences ⇒ Array<String>?
Sequences that will cause the model to stop generating.
Our models stop on "\n\nHuman:"
, and may include additional built-in stop
sequences in the future. By providing the stop_sequences parameter, you may
include additional strings that will cause the model to stop generating.
61 |
# File 'lib/anthropic/models/completion_create_params.rb', line 61 optional :stop_sequences, Anthropic::Internal::Type::ArrayOf[String] |
#temperature ⇒ Float?
Amount of randomness injected into the response.
Defaults to 1.0
. Ranges from 0.0
to 1.0
. Use temperature
closer to 0.0
for analytical / multiple choice, and closer to 1.0
for creative and
generative tasks.
Note that even with temperature
of 0.0
, the results will not be fully
deterministic.
74 |
# File 'lib/anthropic/models/completion_create_params.rb', line 74 optional :temperature, Float |
#top_k ⇒ Integer?
Only sample from the top K options for each subsequent token.
Used to remove "long tail" low probability responses. Learn more technical details here.
Recommended for advanced use cases only. You usually only need to use
temperature
.
86 |
# File 'lib/anthropic/models/completion_create_params.rb', line 86 optional :top_k, Integer |
#top_p ⇒ Float?
Use nucleus sampling.
In nucleus sampling, we compute the cumulative distribution over all the options
for each subsequent token in decreasing probability order and cut it off once it
reaches a particular probability specified by top_p
. You should either alter
temperature
or top_p
, but not both.
Recommended for advanced use cases only. You usually only need to use
temperature
.
100 |
# File 'lib/anthropic/models/completion_create_params.rb', line 100 optional :top_p, Float |