Share via


TruncationStrategy Class

public final class TruncationStrategy
extends ExpandableStringEnum<TruncationStrategy>

Possible truncation strategies for the thread.

Field Summary

Modifier and Type Field and Description
static final TruncationStrategy AUTO

Default value.

static final TruncationStrategy LAST_MESSAGES

The thread will truncate to the `lastMessages` count of recent messages.

Constructor Summary

Constructor Description
TruncationStrategy()

Deprecated

Use the fromString(String name) factory method.

Creates a new instance of TruncationStrategy value.

Method Summary

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

Creates or finds a TruncationStrategy from its string representation.

static Collection<TruncationStrategy> values()

Gets known TruncationStrategy values.

Methods inherited from ExpandableStringEnum

Methods inherited from java.lang.Object

Field Details

AUTO

public static final TruncationStrategy AUTO

Default value. Messages in the middle of the thread will be dropped to fit the context length of the model.

LAST_MESSAGES

public static final TruncationStrategy LAST_MESSAGES

The thread will truncate to the `lastMessages` count of recent messages.

Constructor Details

TruncationStrategy

@Deprecated
public TruncationStrategy()

Deprecated

Use the fromString(String name) factory method.

Creates a new instance of TruncationStrategy value.

Method Details

fromString

public static TruncationStrategy fromString(String name)

Creates or finds a TruncationStrategy from its string representation.

Parameters:

name - a name to look for.

Returns:

the corresponding TruncationStrategy.

values

public static Collection<TruncationStrategy> values()

Gets known TruncationStrategy values.

Returns:

known TruncationStrategy values.

Applies to