> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentscope.io/llms.txt
> Use this file to discover all available pages before exploring further.

# JSON Schema for the KB middleware's tunable parameters

> Return the parameter schema for
:class:`agentscope.middleware.RAGMiddleware`.

The schema is shaped like every other ``parameter_schema`` served
by this service — title / description / default / enum / minimum
/ maximum — so the front-end can render the session-level KB
attachment form with the same schema-driven component used for
model parameters.

Args:
    _ (`str`):
        Injected authenticated user ID; only used to gate the
        endpoint behind authentication.

Returns:
    `KbMiddlewareParametersSchemaResponse`:
        The JSON Schema describing the middleware's
        user-tunable parameters.



## OpenAPI

````yaml /versions/2.0.4dev/en/deploy/openapi.json get /knowledge_bases/middleware/parameters_schema
openapi: 3.1.0
info:
  title: AgentScope
  version: 2.0.3
servers: []
security: []
paths:
  /knowledge_bases/middleware/parameters_schema:
    get:
      tags:
        - knowledge_bases
      summary: JSON Schema for the KB middleware's tunable parameters
      description: |-
        Return the parameter schema for
        :class:`agentscope.middleware.RAGMiddleware`.

        The schema is shaped like every other ``parameter_schema`` served
        by this service — title / description / default / enum / minimum
        / maximum — so the front-end can render the session-level KB
        attachment form with the same schema-driven component used for
        model parameters.

        Args:
            _ (`str`):
                Injected authenticated user ID; only used to gate the
                endpoint behind authentication.

        Returns:
            `KbMiddlewareParametersSchemaResponse`:
                The JSON Schema describing the middleware's
                user-tunable parameters.
      operationId: >-
        get_kb_middleware_parameters_schema_knowledge_bases_middleware_parameters_schema_get
      parameters:
        - name: x-user-id
          in: header
          required: true
          schema:
            type: string
            description: >-
              Caller's user ID. Temporary header-based identity; will be
              replaced by JWT auth.
            title: X-User-Id
          description: >-
            Caller's user ID. Temporary header-based identity; will be replaced
            by JWT auth.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KbMiddlewareParametersSchemaResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    KbMiddlewareParametersSchemaResponse:
      properties:
        parameter_schema:
          additionalProperties: true
          type: object
          title: Parameter Schema
          description: >-
            JSON Schema produced by
            `RAGMiddleware.Parametersmodel_json_schema()`.  Shaped identically
            to the `parameter_schema` field on `ModelCard`.
      type: object
      required:
        - parameter_schema
      title: KbMiddlewareParametersSchemaResponse
      description: |-
        Response body exposing the KB middleware's parameters schema.

        The schema is derived from
        :class:`agentscope.middleware.RAGMiddleware.Parameters`
        via ``model_json_schema()`` so the front-end can render the
        session-level KB attachment form with the same schema-driven
        component used for model parameters.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````