본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

AI 프롬프트 컴프레서 플러그인 구성 참조

원문 보기 위키 갱신

AI 프롬프트 컴프레서 플러그인 구성 참조 (AI Prompt Compressor Plugin Configuration Reference)

이 문서는 AI Prompt Compressor 플러그인에서 설정할 수 있는 옵션을 스키마 형태로 정리한 구성 참조 자료예요. 압축 방식(rate 또는 target_token)과 압축 범위(compression_ranges), 컴프레서 URL, 타임아웃 같은 핵심 파라미터가 각각 어떤 역할을 하는지 확인할 수 있어요. 특정 컨슈머나 컨슈머 그룹에만 플러그인을 적용하는 방법과 오류 발생 시 처리 중단 여부 같은 동작 제어 설정도 함께 다뤄요

출처: 문서

본문

{
  "properties": {
    "config": {
      "properties": {
        "compression_ranges": {
          "description": "What value to be used to compress with. The 'value' is interpreted as rate or target_token depending on compressor_type.",
          "items": {
            "properties": {
              "max_tokens": {
                "type": "integer"
              },
              "min_tokens": {
                "type": "integer"
              },
              "value": {
                "type": "number"
              }
            },
            "required": [
              "max_tokens",
              "min_tokens",
              "value"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "compressor_type": {
          "default": "rate",
          "description": "What compression type to use to compress with",
          "enum": [
            "rate",
            "target_token"
          ],
          "type": "string"
        },
        "compressor_url": {
          "default": "http://localhost:8080",
          "description": "The url of the compressor",
          "type": "string"
        },
        "keepalive_timeout": {
          "default": 60000,
          "description": "The keepalive timeout for the established http connnection",
          "type": "number"
        },
        "log_text_data": {
          "default": false,
          "description": "Log the text data",
          "type": "boolean"
        },
        "message_type": {
          "default": [
            "user"
          ],
          "items": {
            "enum": [
              "assistant",
              "system",
              "user"
            ],
            "type": "string"
          },
          "type": "array"
        },
        "stop_on_error": {
          "default": true,
          "description": "Stop processing if an error occurs",
          "type": "boolean"
        },
        "timeout": {
          "default": 10000,
          "description": "Connection timeout with the compressor",
          "type": "number"
        }
      },
      "required": [
        "compression_ranges"
      ],
      "type": "object"
    },
    "consumer": {
      "additionalProperties": false,
      "description": "If set, the plugin will activate only for requests where the specified has been authenticated. (Note that some plugins can not be restricted to consumers this way.). Leave unset for the plugin to activate regardless of the authenticated Consumer.",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "consumer_group": {
      "additionalProperties": false,
      "description": "If set, the plugin will activate only for requests where the specified consumer group has been authenticated. (Note that some plugins can not be restricted to consumers groups this way.). Leave unset for the plugin to activate regardless of the authenticated Consumer Groups",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "expressions": {
      "additionalProperties": true,
      "type": "object"
    },
    "protocols": {
      "default": [
        "grpc",
        "grpcs",
        "http",
        "https"
      ],
      "description": "A set of strings representing HTTP protocols.",
      "items": {
        "enum": [
          "grpc",
          "grpcs",
          "http",
          "https"
        ],
        "type": "string"
      },
      "type": "array"
    },
    "route": {
      "additionalProperties": false,
      "description": "If set, the plugin will only activate when receiving requests via the specified route. Leave unset for the plugin to activate regardless of the route being used.",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "service": {
      "additionalProperties": false,
      "description": "If set, the plugin will only activate when receiving requests via one of the routes belonging to the specified Service. Leave unset for the plugin to activate regardless of the Service being matched.",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "required": [
    "config"
  ]
}

관련 리소스

더 알아보기 (Learn more)

  • 프롬프트 압축을 실제로 적용하는 방법을 단계별로 따라 할 수 있는 실습 가이드예요 — Control prompt size with the AI Compressor plugin
  • AI Gateway에서 사용할 수 있는 다른 플러그인들도 한눈에 살펴볼 수 있어요 — All AI Gateway plugins
  • 플러그인 설정 전에 AI Gateway의 기본 개념을 먼저 짚고 가면 이해가 쉬워요 — About AI Gateway
  • 프롬프트에 지시문이나 컨텍스트를 추가하는 형제 플러그인의 설정도 참고할 만해요 — AI Prompt Decorator
  • 검색 결과를 프롬프트에 주입하는 AI RAG Injector 플러그인 정보도 함께 확인할 수 있어요 — AI RAG Injector