CompletionsFinishReason Class

public final class CompletionsFinishReason
extends ExpandableStringEnum<CompletionsFinishReason>

Representation of the manner in which a completions response concluded.

Field Summary

Modifier and Type Field and Description
static final CompletionsFinishReason CONTENT_FILTERED

Completions generated a response that was identified as potentially sensitive per content moderation policies.

static final CompletionsFinishReason FUNCTION_CALL

Completion ended normally, with the model requesting a function to be called.

static final CompletionsFinishReason STOPPED

Completions ended normally and reached its end of token generation.

static final CompletionsFinishReason TOKEN_LIMIT_REACHED

Completions exhausted available token limits before generation could complete.

static final CompletionsFinishReason TOOL_CALLS

Completion ended with the model calling a provided tool for output.

Constructor Summary

Constructor Description
CompletionsFinishReason()

Deprecated

Use the fromString(String name) factory method.

Creates a new instance of CompletionsFinishReason value.

Method Summary

Modifier and Type Method and Description
static CompletionsFinishReason fromString(String name)

Creates or finds a CompletionsFinishReason from its string representation.

static Collection<CompletionsFinishReason> values()

Gets known CompletionsFinishReason values.

Methods inherited from ExpandableStringEnum

Methods inherited from java.lang.Object

Field Details

CONTENT_FILTERED

public static final CompletionsFinishReason CONTENT_FILTERED

Completions generated a response that was identified as potentially sensitive per content moderation policies.

FUNCTION_CALL

public static final CompletionsFinishReason FUNCTION_CALL

Completion ended normally, with the model requesting a function to be called.

STOPPED

public static final CompletionsFinishReason STOPPED

Completions ended normally and reached its end of token generation.

TOKEN_LIMIT_REACHED

public static final CompletionsFinishReason TOKEN_LIMIT_REACHED

Completions exhausted available token limits before generation could complete.

TOOL_CALLS

public static final CompletionsFinishReason TOOL_CALLS

Completion ended with the model calling a provided tool for output.

Constructor Details

CompletionsFinishReason

@Deprecated
public CompletionsFinishReason()

Deprecated

Use the fromString(String name) factory method.

Creates a new instance of CompletionsFinishReason value.

Method Details

fromString

public static CompletionsFinishReason fromString(String name)

Creates or finds a CompletionsFinishReason from its string representation.

Parameters:

name - a name to look for.

Returns:

the corresponding CompletionsFinishReason.

values

public static Collection values()

Gets known CompletionsFinishReason values.

Returns:

known CompletionsFinishReason values.

Applies to