Compact an objective
objectives.compact(objective_id, **kwargs) -> ObjectiveCompactResponse { context_window }
POST/v1/workspaces/{workspaceId}/objectives/{objectiveId}/compact
Triggers compaction on a running objective. Optionally override the variation’s compaction config.
Compact an objective
require "cadenya"
cadenya = Cadenya::Client.new(api_key: "My API Key")
response = cadenya.objectives.compact("objectiveId", workspace_id: "workspaceId")
puts(response){
"contextWindow": {
"completionTokens": 0,
"objectiveId": "objectiveId",
"previousWindowContinueInstructions": "previousWindowContinueInstructions",
"promptTokens": 0,
"sequence": 0
}
}Returns Examples
{
"contextWindow": {
"completionTokens": 0,
"objectiveId": "objectiveId",
"previousWindowContinueInstructions": "previousWindowContinueInstructions",
"promptTokens": 0,
"sequence": 0
}
}