Compact an objective
client.objectives.compact(stringobjectiveID, ObjectiveCompactParams { compactionConfig } body, RequestOptionsoptions?): ObjectiveCompactResponse { contextWindow }
POST/v1/objectives/{objectiveId}/compact
Triggers compaction on a running objective. Optionally override the variation's compaction config.
Compact an objective
import Cadenya from '@cadenya/cadenya';
const client = new Cadenya({
apiKey: process.env['CADENYA_API_KEY'], // This is the default and can be omitted
});
const response = await client.objectives.compact('objectiveId');
console.log(response.contextWindow);{
"contextWindow": {
"completionTokens": 0,
"objectiveId": "objectiveId",
"previousWindowContinueInstructions": "previousWindowContinueInstructions",
"promptTokens": 0,
"sequence": 0
}
}Returns Examples
{
"contextWindow": {
"completionTokens": 0,
"objectiveId": "objectiveId",
"previousWindowContinueInstructions": "previousWindowContinueInstructions",
"promptTokens": 0,
"sequence": 0
}
}