ai.settings:
  label: 'AI Settings'
  type: config_object
  mapping:
    prompt_logging:
      label: 'If the AI should log prompts'
      type: boolean
    prompt_logging_tags:
      label: 'Tags to log prompts with'
      type: string
    default_providers:
      label: 'Default providers'
      type: mapping
      mapping:
        chat:
          label: 'Default chat provider'
          type: ai.default_operation_provider
        chat_with_complex_json:
          label: 'Default chat with complex JSON provider'
          type: ai.default_operation_provider
        chat_with_image_vision:
          label: 'Default chat with image vision provider'
          type: ai.default_operation_provider
        chat_with_structured_response:
          label: 'Default chat with structured response provider'
          type: ai.default_operation_provider
        chat_with_tools:
          label: 'Default chat with tools provider'
          type: ai.default_operation_provider
        embeddings:
          label: 'Default embeddings provider'
          type: ai.default_operation_provider
        moderation:
          label: 'Default moderation provider'
          type: ai.default_operation_provider
        rerank:
          label: 'Default rerank provider'
          type: ai.default_operation_provider
        speech_to_text:
          label: 'Default speech to text provider'
          type: ai.default_operation_provider
        text_to_image:
          label: 'Default text to image provider'
          type: ai.default_operation_provider
        text_to_speech:
          label: 'Default text to speech provider'
          type: ai.default_operation_provider
    default_vdb_provider:
      label: 'Default Vector Database Provider'
      type: string
    request_timeout:
      label: 'HTTP request timeout in seconds'
      type: integer
      constraints:
        Range:
          min: 1
          max: 3600
    models:
      type: sequence
      label: The overriden/added models.
      required: false
      sequence:
        type: ignore
    allowed_hosts:
      type: sequence
      label: 'Allowed hosts for external AI requests'
      sequence:
        type: string
    allowed_hosts_rewrite_links:
      type: boolean
      label: 'If links to allowed hosts should be rewritten'

ai.default_operation_provider:
  type: mapping
  label: 'Default provider'
  mapping:
    provider_id:
      label: 'Provider ID'
      type: string
    model_id:
      label: 'Model ID'
      type: string

ai.ai_guardrail.*:
  type: config_entity
  label: Guardrail
  mapping:
    id:
      type: string
      label: ID
    label:
      type: label
      label: Label
    uuid:
      type: string
    description:
      type: string
    guardrail:
      type: string
      label: Guardrail plugin ID

ai.ai_guardrail_set.*:
  type: config_entity
  label: Guardrail set
  mapping:
    id:
      type: string
      label: ID
    label:
      type: label
      label: Label
    uuid:
      type: string
    description:
      type: string
    pre_generate_guardrails:
        type: mapping
        label: Pre-generate guardrails
        mapping:
          plugin_id:
            type: sequence
            sequence:
              type: string
    post_generate_guardrails:
        type: mapping
        label: Post-generate guardrails
        mapping:
          plugin_id:
            type: mapping
            mapping:
              plugin_id:
                type: string
