Class CompletionCreateParams.CompletionCreateBody.Builder
-
- All Implemented Interfaces:
public final class CompletionCreateParams.CompletionCreateBody.BuilderA builder for CompletionCreateBody.
-
-
Method Summary
-
-
Method Detail
-
maxTokensToSample
final CompletionCreateParams.CompletionCreateBody.Builder maxTokensToSample(Long maxTokensToSample)
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.
-
maxTokensToSample
final CompletionCreateParams.CompletionCreateBody.Builder maxTokensToSample(JsonField<Long> maxTokensToSample)
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.
-
model
final CompletionCreateParams.CompletionCreateBody.Builder model(Model model)
The model that will complete your prompt.\n\nSee models for additional details and options.
-
model
final CompletionCreateParams.CompletionCreateBody.Builder model(JsonField<Model> model)
The model that will complete your prompt.\n\nSee models for additional details and options.
-
model
final CompletionCreateParams.CompletionCreateBody.Builder model(String value)
The model that will complete your prompt.\n\nSee models for additional details and options.
-
prompt
final CompletionCreateParams.CompletionCreateBody.Builder prompt(String prompt)
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.
-
prompt
final CompletionCreateParams.CompletionCreateBody.Builder prompt(JsonField<String> prompt)
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.
-
metadata
final CompletionCreateParams.CompletionCreateBody.Builder metadata(Metadata metadata)
An object describing metadata about the request.
-
metadata
final CompletionCreateParams.CompletionCreateBody.Builder metadata(JsonField<Metadata> metadata)
An object describing metadata about the request.
-
stopSequences
final CompletionCreateParams.CompletionCreateBody.Builder stopSequences(List<String> stopSequences)
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.
-
stopSequences
final CompletionCreateParams.CompletionCreateBody.Builder stopSequences(JsonField<List<String>> stopSequences)
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.
-
addStopSequence
final CompletionCreateParams.CompletionCreateBody.Builder addStopSequence(String stopSequence)
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.
-
temperature
final CompletionCreateParams.CompletionCreateBody.Builder temperature(Double temperature)
Amount of randomness injected into the response.
Defaults to
1.0. Ranges from0.0to1.0. Usetemperaturecloser to0.0for analytical / multiple choice, and closer to1.0for creative and generative tasks.Note that even with
temperatureof0.0, the results will not be fully deterministic.
-
temperature
final CompletionCreateParams.CompletionCreateBody.Builder temperature(JsonField<Double> temperature)
Amount of randomness injected into the response.
Defaults to
1.0. Ranges from0.0to1.0. Usetemperaturecloser to0.0for analytical / multiple choice, and closer to1.0for creative and generative tasks.Note that even with
temperatureof0.0, the results will not be fully deterministic.
-
topK
final CompletionCreateParams.CompletionCreateBody.Builder topK(Long topK)
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.
-
topK
final CompletionCreateParams.CompletionCreateBody.Builder topK(JsonField<Long> topK)
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.
-
topP
final CompletionCreateParams.CompletionCreateBody.Builder topP(Double topP)
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 altertemperatureortop_p, but not both.Recommended for advanced use cases only. You usually only need to use
temperature.
-
topP
final CompletionCreateParams.CompletionCreateBody.Builder topP(JsonField<Double> topP)
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 altertemperatureortop_p, but not both.Recommended for advanced use cases only. You usually only need to use
temperature.
-
additionalProperties
final CompletionCreateParams.CompletionCreateBody.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final CompletionCreateParams.CompletionCreateBody.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final CompletionCreateParams.CompletionCreateBody.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final CompletionCreateParams.CompletionCreateBody.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final CompletionCreateParams.CompletionCreateBody.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final CompletionCreateParams.CompletionCreateBody build()
-
-
-
-