{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "#/components/schemas/AiPromptCompressorPluginConfig", "title": "AiPromptCompressorPluginConfig", "x-speakeasy-entity": "PluginAiPromptCompressor", "properties": { "config": { "type": "object", "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.", "type": "array", "items": { "properties": { "max_tokens": { "type": "integer" }, "min_tokens": { "type": "integer" }, "value": { "type": "number" } }, "required": [ "max_tokens", "min_tokens", "value" ], "type": "object" } }, "compressor_type": { "description": "What compression type to use to compress with", "type": "string", "default": "rate", "enum": [ "rate", "target_token" ] }, "compressor_url": { "description": "The url of the compressor", "type": "string", "default": "http://localhost:8080" }, "keepalive_timeout": { "description": "The keepalive timeout for the established http connnection", "type": "number", "default": 60000 }, "log_text_data": { "description": "Log the text data", "type": "boolean", "default": false }, "message_type": { "type": "array", "items": { "enum": [ "assistant", "system", "user" ], "type": "string" }, "default": [ "user" ] }, "stop_on_error": { "description": "Stop processing if an error occurs", "type": "boolean", "default": true }, "timeout": { "description": "Connection timeout with the compressor", "type": "number", "default": 10000 } }, "required": [ "compression_ranges" ] }, "consumer": { "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.", "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string" } } }, "consumer_group": { "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", "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string" } } }, "name": { "const": "ai-prompt-compressor" }, "protocols": { "description": "A set of strings representing HTTP protocols.", "type": "array", "items": { "enum": [ "grpc", "grpcs", "http", "https" ], "type": "string" }, "format": "set", "default": [ "grpc", "grpcs", "http", "https" ] }, "route": { "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.", "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string" } } }, "service": { "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.", "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string" } } } }, "required": [ "config" ] }