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

# Revise metric configuration with AI ("Update With AI")

> Given a metric config the caller already has (name, description, judge prompt, evaluation params, evaluation type) plus one line of feedback, returns a revised judge prompt, evaluation parameters, and description. Persists nothing — the caller decides whether to apply the result.



## OpenAPI

````yaml https://api.galtea.ai/openapi.json post /metrics/update-config
openapi: 3.0.0
info:
  version: 1.0.0
  title: Product Management Service API
  description: API documentation for Product Management Service
  contact:
    name: Galtea AI
servers:
  - url: https://api.galtea.ai
security:
  - bearerAuth: []
tags: []
externalDocs:
  description: Galtea Platform Documentation
  url: https://docs.galtea.ai
paths:
  /metrics/update-config:
    post:
      tags:
        - metrics
      summary: Revise metric configuration with AI ("Update With AI")
      description: >-
        Given a metric config the caller already has (name, description, judge
        prompt, evaluation params, evaluation type) plus one line of feedback,
        returns a revised judge prompt, evaluation parameters, and description.
        Persists nothing — the caller decides whether to apply the result.
      operationId: updateMetricConfig
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateMetricConfigBody'
      responses:
        '200':
          description: Revised metric configuration suggestion
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateMetricConfigResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: No permission to access the referenced specification or product
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Referenced specification or product not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: The metric generator returned no configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    UpdateMetricConfigBody:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
          example: Refusal Quality
          description: >-
            The metric's user-authored name — context for the revision, not
            returned in the response.
        description:
          type: string
          minLength: 1
          maxLength: 5000
          description: >-
            The metric's user-authored description — the criteria the judge
            prompt must evaluate.
        evaluationType:
          type: string
          enum:
            - PARTIAL_PROMPT
            - HUMAN_EVALUATION
          description: >-
            PARTIAL_PROMPT (binary LLM judge) or HUMAN_EVALUATION (0-100
            annotator guidelines).
        currentJudgePrompt:
          type: string
          minLength: 1
          maxLength: 20000
          description: >-
            The metric's current judge prompt — the starting point the revision
            builds on.
        currentEvaluationParams:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 64
          maxItems: 20
          description: >-
            The metric's current evaluation parameters, changed only if the
            feedback requires it. Always send them when the metric has any;
            omitting them can produce a revision whose declared parameters do
            not match its prompt.
        feedback:
          type: string
          minLength: 1
          maxLength: 2000
          example: it should not penalise a short answer
          description: >-
            Free-text instruction describing what to change about the current
            judge prompt.
        tags:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 64
          maxItems: 20
          description: >-
            The metric's user-provided tags — context for the revision, not
            returned in the response.
        productId:
          type: string
          minLength: 1
          example: prod_123
          description: Optional product ID for additional context
        specificationIds:
          type: array
          items:
            type: string
            minLength: 1
          description: At most one specification id, forwarded as optional context.
      required:
        - name
        - evaluationType
        - currentJudgePrompt
        - feedback
    UpdateMetricConfigResponse:
      type: object
      properties:
        judgePrompt:
          type: string
          description: The revised judge prompt, built on the current one.
        evaluationParams:
          type: array
          items:
            type: string
          description: The revised evaluation parameters.
        description:
          type: string
          nullable: true
          description: The revised metric description.
      required:
        - judgePrompt
        - evaluationParams
        - description
    Error:
      type: object
      properties:
        error:
          type: string
          example: Error type
        message:
          type: string
          example: Error message description
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authorization. Pass your API key in the Authorization header as
        a Bearer token. Both new (`gsk_*`) and legacy (`gsk-`) API keys are
        accepted, e.g. `Authorization: Bearer gsk_...` or `Authorization: Bearer
        gsk-...`.

````