Link Search Menu Expand Document Documentation Menu

You're viewing version 3.5 of the OpenSearch documentation. This version is no longer maintained. For the latest version, see the current documentation. For information about OpenSearch version maintenance, see Release Schedule and Maintenance Policy.

Get Context Management API

Introduced 3.5

Use this API to retrieve a context management configuration by its name.

Endpoints

GET /_plugins/_ml/context_management/<context_management_name>

Path parameters

The following table lists the available path parameters.

Parameter Data type Required/Optional Description
context_management_name String Required The name of the context management to retrieve.

Example request

GET /_plugins/_ml/context_management/token-aware-truncation

Example response

{
  "description": "Context management that truncates tool outputs longer than 100,000 characters and applies sliding window to keep last 6 messages when tokens exceed 200,000",
  "hooks": {
    "post_tool": [
      {
        "type": "ToolsOutputTruncateManager",
        "config": {
          "max_output_length": 100000
        }
      }
    ],
    "pre_llm": [
      {
        "type": "SlidingWindowManager",
        "config": {
          "max_messages": 6,
          "activation": {
            "tokens_exceed": 200000
          }
        }
      }
    ]
  },
  "created_time": 1754943902286,
  "last_modified": 1754943902286,
  "created_by": "admin"
}

For more information, see Context management.

350 characters left

Have a question? .

Want to contribute? or .