Class CompletionCreateParams.Body.Builder
-
- All Implemented Interfaces:
public final class CompletionCreateParams.Body.BuilderA builder for Body.
-
-
Method Summary
Modifier and Type Method Description final CompletionCreateParams.Body.BuildermaxTokensToSample(Long maxTokensToSample)The maximum number of tokens to generate before stopping. final CompletionCreateParams.Body.BuildermaxTokensToSample(JsonField<Long> maxTokensToSample)The maximum number of tokens to generate before stopping. final CompletionCreateParams.Body.Buildermodel(Model model)The model that will complete your prompt. final CompletionCreateParams.Body.Buildermodel(JsonField<Model> model)The model that will complete your prompt. final CompletionCreateParams.Body.Buildermodel(String value)The model that will complete your prompt. final CompletionCreateParams.Body.Builderprompt(String prompt)The prompt that you want Claude to complete. final CompletionCreateParams.Body.Builderprompt(JsonField<String> prompt)The prompt that you want Claude to complete. final CompletionCreateParams.Body.Buildermetadata(Metadata metadata)An object describing metadata about the request. final CompletionCreateParams.Body.Buildermetadata(JsonField<Metadata> metadata)An object describing metadata about the request. final CompletionCreateParams.Body.BuilderstopSequences(List<String> stopSequences)Sequences that will cause the model to stop generating. final CompletionCreateParams.Body.BuilderstopSequences(JsonField<List<String>> stopSequences)Sequences that will cause the model to stop generating. final CompletionCreateParams.Body.BuilderaddStopSequence(String stopSequence)Sequences that will cause the model to stop generating. final CompletionCreateParams.Body.Buildertemperature(Double temperature)Amount of randomness injected into the response. final CompletionCreateParams.Body.Buildertemperature(JsonField<Double> temperature)Amount of randomness injected into the response. final CompletionCreateParams.Body.BuildertopK(Long topK)Only sample from the top K options for each subsequent token. final CompletionCreateParams.Body.BuildertopK(JsonField<Long> topK)Only sample from the top K options for each subsequent token. final CompletionCreateParams.Body.BuildertopP(Double topP)Use nucleus sampling. final CompletionCreateParams.Body.BuildertopP(JsonField<Double> topP)Use nucleus sampling. final CompletionCreateParams.Body.BuilderadditionalProperties(Map<String, JsonValue> additionalProperties)final CompletionCreateParams.Body.BuilderputAdditionalProperty(String key, JsonValue value)final CompletionCreateParams.Body.BuilderputAllAdditionalProperties(Map<String, JsonValue> additionalProperties)final CompletionCreateParams.Body.BuilderremoveAdditionalProperty(String key)final CompletionCreateParams.Body.BuilderremoveAllAdditionalProperties(Set<String> keys)final CompletionCreateParams.Bodybuild()-
-
Method Detail
-
maxTokensToSample
final CompletionCreateParams.Body.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.Body.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.Body.Builder model(Model model)
The model that will complete your prompt.\n\nSee models for additional details and options.
-
model
final CompletionCreateParams.Body.Builder model(JsonField<Model> model)
The model that will complete your prompt.\n\nSee models for additional details and options.
-
model
final CompletionCreateParams.Body.Builder model(String value)
The model that will complete your prompt.\n\nSee models for additional details and options.
-
prompt
final CompletionCreateParams.Body.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.Body.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.Body.Builder metadata(Metadata metadata)
An object describing metadata about the request.
-
metadata
final CompletionCreateParams.Body.Builder metadata(JsonField<Metadata> metadata)
An object describing metadata about the request.
-
stopSequences
final CompletionCreateParams.Body.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.Body.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.Body.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.Body.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.Body.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.Body.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.Body.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.Body.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.Body.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.Body.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final CompletionCreateParams.Body.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final CompletionCreateParams.Body.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final CompletionCreateParams.Body.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final CompletionCreateParams.Body.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final CompletionCreateParams.Body build()
-
-
-
-