Update Context Management API
출처: 문서
본문
컨텍스트 관리 업데이트 API
3.5에 도입 {: .label .label-purple }
이 API를 사용하면 기존 컨텍스트 관리 구성을 업데이트할 수 있어요. 설명, hooks 구성, 컨텍스트 매니저 설정을 수정할 수 있답니다.
엔드포인트
PUT /_plugins/_ml/context_management/{context_management_name}
경로 파라미터
사용 가능한 경로 파라미터는 다음 표와 같아요.
| 파라미터 | 데이터 타입 | 필수/선택 | 설명 |
|---|---|---|---|
context_management_name |
String | 필수 | 업데이트할 컨텍스트 관리의 이름이에요. |
요청 본문 필드
사용 가능한 요청 본문 필드는 다음 표와 같아요.
| 필드 | 데이터 타입 | 필수/선택 | 설명 |
|---|---|---|---|
description |
String | 선택 | 이 컨텍스트 관리가 하는 일에 대한 사람이 읽기 쉬운 설명이에요. |
hooks |
Object | 선택 | 훅 이름을 컨텍스트 매니저 구성 리스트에 매핑한 맵이에요. 자세한 내용은 hooks 객체를 참고하세요. |
요청 본문은 컨텍스트 관리 생성 API와 같은 구조를 따라요.
예제 요청: 설명 업데이트
PUT /_plugins/_ml/context_management/advanced-context-management
{
"description": "Updated description for advanced context management with multiple strategies"
}
{% include copy-curl.html %}
예제 요청: hooks 구성 업데이트
PUT /_plugins/_ml/context_management/sliding_window_max_40000_tokens_managers
{
"description": "Context management for truncating tool outputs to prevent input length issues",
"hooks": {
"pre_llm": [
{
"type": "SlidingWindowManager",
"config": {
"max_messages": 8,
"activation": {
"rule_type": "always"
}
}
}
],
"post_tool": [
{
"type": "ToolsOutputTruncateManager",
"config": {
"max_output_length": 40000,
"activation": {
"rule_type": "always"
}
}
}
]
}
}
{% include copy-curl.html %}
예제 응답
{
"_index": ".plugins-ml-context-management-templates",
"_id": "sliding_window_max_40000_tokens_managers",
"_version": 2,
"result": "updated",
"forced_refresh": true,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"_seq_no": 4,
"_primary_term": 1
}
관련 문서
자세한 내용은 컨텍스트 관리를 참고하세요.