#  Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
#  SPDX-License-Identifier: Apache-2.0
$schema: "https://json-schema.org/draft-07/schema#"
$id: "infra/v1#llm-cache-params"
title: LlmCacheMiddlewareParams
description: >
  Constructor kwargs for the ``llm_cache`` infra middleware plugin.
  Selected when the sibling ``middleware`` id is ``llm_cache``.
type: object
additionalProperties: false
properties:
  enabled:
    type: boolean
  allow_read:
    type: boolean
  allow_write:
    type: boolean
  raise_on_miss:
    type: boolean
  include_preview:
    type: boolean
  replay_delay_min_s:
    type: number
    minimum: 0
  replay_delay_max_s:
    type: number
    minimum: 0
  miss_log_path:
    type: [string, "null"]
    x-filesystem-path: true
  write_mode:
    type: string
    enum: [append, replace]
    description: >
      append (default) keeps existing cache keys and records misses.
      replace truncates cache_path once at process start (startup recording)
      so a gold replay file is not mixed with a previous failed run.
  cache_path:
    type: [string, "null"]
    x-filesystem-path: true
  path:
    type: string
    x-filesystem-path: true
    description: Alias for cache_path.
