Class LLMChoice
java.lang.Object
com.sap.ai.sdk.orchestration.model.LLMChoice
LLMChoice
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceBuilder helper class.static interfaceBuilder helper class.static interfaceBuilder helper class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LLMChoice.Buildercreate()Create a type-safe, fluent-api builder object to construct a newLLMChoiceinstance with all required arguments.booleanfinishReason(String finishReason) Set the finishReason of thisLLMChoiceinstance and return the same instance.getCustomField(String name) Deprecated.Get the names of the unrecognizable properties of theLLMChoice.Reason the model stopped generating tokens.getIndex()Index of the choiceGet logprobsGet messageinthashCode()Set the index of thisLLMChoiceinstance and return the same instance.logprobs(ChoiceLogprobs logprobs) Set the logprobs of thisLLMChoiceinstance and return the same instance.message(ResponseChatMessage message) Set the message of thisLLMChoiceinstance and return the same instance.voidsetCustomField(String customFieldName, Object customFieldValue) Set an unrecognizable property of thisLLMChoiceinstance.voidsetFinishReason(String finishReason) Set the finishReason of thisLLMChoiceinstance.voidSet the index of thisLLMChoiceinstance.voidsetLogprobs(ChoiceLogprobs logprobs) Set the logprobs of thisLLMChoiceinstance.voidsetMessage(ResponseChatMessage message) Set the message of thisLLMChoiceinstance.toMap()Get the value of all properties of thisLLMChoiceinstance including unrecognized properties.toString()
-
Constructor Details
-
LLMChoice
protected LLMChoice()Default constructor for LLMChoice.
-
-
Method Details
-
index
Set the index of thisLLMChoiceinstance and return the same instance.- Parameters:
index- Index of the choice- Returns:
- The same instance of this
LLMChoiceclass
-
getIndex
Index of the choice- Returns:
- index The index of this
LLMChoiceinstance.
-
setIndex
Set the index of thisLLMChoiceinstance.- Parameters:
index- Index of the choice
-
message
Set the message of thisLLMChoiceinstance and return the same instance. -
getMessage
Get message- Returns:
- message The message of this
LLMChoiceinstance.
-
setMessage
Set the message of thisLLMChoiceinstance.- Parameters:
message- The message of thisLLMChoice
-
logprobs
Set the logprobs of thisLLMChoiceinstance and return the same instance. -
getLogprobs
Get logprobs- Returns:
- logprobs The logprobs of this
LLMChoiceinstance.
-
setLogprobs
Set the logprobs of thisLLMChoiceinstance.- Parameters:
logprobs- The logprobs of thisLLMChoice
-
finishReason
Set the finishReason of thisLLMChoiceinstance and return the same instance.- Parameters:
finishReason- Reason the model stopped generating tokens. 'stop' if the model hit a natural stop point or a provided stop sequence, 'length' if the maximum token number was reached, 'content_filter' if content was omitted due to a filter enforced by the LLM model provider or the content filtering module- Returns:
- The same instance of this
LLMChoiceclass
-
getFinishReason
Reason the model stopped generating tokens. 'stop' if the model hit a natural stop point or a provided stop sequence, 'length' if the maximum token number was reached, 'content_filter' if content was omitted due to a filter enforced by the LLM model provider or the content filtering module- Returns:
- finishReason The finishReason of this
LLMChoiceinstance.
-
setFinishReason
Set the finishReason of thisLLMChoiceinstance.- Parameters:
finishReason- Reason the model stopped generating tokens. 'stop' if the model hit a natural stop point or a provided stop sequence, 'length' if the maximum token number was reached, 'content_filter' if content was omitted due to a filter enforced by the LLM model provider or the content filtering module
-
getCustomFieldNames
Get the names of the unrecognizable properties of theLLMChoice.- Returns:
- The set of properties names
-
getCustomField
@Nullable @Deprecated public Object getCustomField(@Nonnull String name) throws NoSuchElementException Deprecated.UsetoMap()instead.Get the value of an unrecognizable property of thisLLMChoiceinstance.- Parameters:
name- The name of the property- Returns:
- The value of the property
- Throws:
NoSuchElementException- If no property with the given name could be found.
-
toMap
Get the value of all properties of thisLLMChoiceinstance including unrecognized properties.- Returns:
- The map of all properties
-
setCustomField
Set an unrecognizable property of thisLLMChoiceinstance. If the map previously contained a mapping for the key, the old value is replaced by the specified value.- Parameters:
customFieldName- The name of the propertycustomFieldValue- The value of the property
-
equals
-
hashCode
public int hashCode() -
toString
-
create
Create a type-safe, fluent-api builder object to construct a newLLMChoiceinstance with all required arguments.
-
toMap()instead.