TruncationObject Class
- java.
lang. Object - com.
azure. ai. agents. persistent. models. TruncationObject
- com.
Implements
public final class TruncationObject
implements JsonSerializable<TruncationObject>
Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.
Constructor Summary
| Constructor | Description |
|---|---|
| TruncationObject(TruncationStrategy type) |
Creates an instance of Truncation |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
static
Truncation |
fromJson(JsonReader jsonReader)
Reads an instance of Truncation |
| Integer |
getLastMessages()
Get the last |
|
Truncation |
getType()
Get the type property: The truncation strategy to use for the thread. |
|
Truncation |
setLastMessages(Integer lastMessages)
Set the last |
|
Json |
toJson(JsonWriter jsonWriter) |
Methods inherited from java.lang.Object
Constructor Details
TruncationObject
public TruncationObject(TruncationStrategy type)
Creates an instance of TruncationObject class.
Parameters:
Method Details
fromJson
public static TruncationObject fromJson(JsonReader jsonReader)
Reads an instance of TruncationObject from the JsonReader.
Parameters:
Returns:
Throws:
getLastMessages
public Integer getLastMessages()
Get the lastMessages property: The number of most recent messages from the thread when constructing the context for the run.
Returns:
getType
public TruncationStrategy getType()
Get the type property: The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the `lastMessages` count most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`.
Returns:
setLastMessages
public TruncationObject setLastMessages(Integer lastMessages)
Set the lastMessages property: The number of most recent messages from the thread when constructing the context for the run.
Parameters:
Returns: