name: Varbase AI Taxonomy Tagging
description: Enables AI-powered taxonomy tagging for content and grants Varbase editorial roles the required permissions to use AI tagging features provided by the Drupal CMS AI default recipe.
type: Varbase AI
install:
  - node
  - taxonomy
  - ai
  - ai_automators
input:
  content_type:
    data_type: string
    description: Content Type machine name to enable AI taxonomy tagging on.
    prompt:
      method: ask
      arguments:
        question: 'Content Type:'
    form:
      '#type': 'textfield'
      '#title': 'Content type machine name'
      '#description': 'Enter the machine name of the content type to enable AI taxonomy tagging on (e.g. blog, article, page).'
      '#required': false
      '#maxlength': 64
    default:
      source: value
      value: 'blog'
  field_name:
    data_type: string
    description: Taxonomy field machine name to use for AI tagging.
    prompt:
      method: ask
      arguments:
        question: 'Field name:'
    form:
      '#type': 'textfield'
      '#title': 'Taxonomy field machine name'
      '#description': 'Enter the machine name of the taxonomy reference field to populate with AI-generated tags (e.g. field_tags, field_category).'
      '#required': false
      '#maxlength': 64
    default:
      source: value
      value: 'field_tags'
  base_field:
    data_type: string
    description: The base content field machine name to use as source for AI tag generation.
    prompt:
      method: ask
      arguments:
        question: 'Base content field machine name (e.g. body, field_content):'
    form:
      '#type': 'textfield'
      '#title': 'Base content field machine name'
      '#description': 'Enter the machine name of the content field to use as input for AI tag generation (e.g. body, field_content).'
      '#required': false
      '#maxlength': 64
    default:
      source: value
      value: 'field_content'
config:
  strict: false
  actions:
    field.storage.node.ai_automator_status:
      createIfNotExists:
        langcode: en
        status: true
        id: node.ai_automator_status
        field_name: ai_automator_status
        entity_type: node
        type: list_string
    field.field.node.${content_type}.ai_automator_status:
      createIfNotExists:
        status: true
        id: node.${content_type}.ai_automator_status
        field_name: ai_automator_status
        entity_type: node
        bundle: ${content_type}
        label: 'AI Automator Status'
        description: ''
        required: false
        translatable: true
        default_value:
          -
            value: pending
        default_value_callback: ''
        settings: {  }
        field_type: list_string
    field.field.node.${content_type}.${field_name}:
      setEntityReferenceHandler:
        handler: 'default:taxonomy_term'
    core.entity_form_display.node.${content_type}.default:
      'entity_method:core.entity_form_display:hideComponent': ai_automator_status
    ai_automators.ai_automator.node.${content_type}.${field_name}.default:
      createIfNotExists:
        langcode: en
        status: true
        dependencies:
          config:
            - field.field.node.${content_type}.${field_name}
        id: node.${content_type}.${field_name}.default
        label: 'Tags Default'
        rule: llm_taxonomy
        input_mode: base
        weight: 100
        worker_type: direct
        entity_type: node
        bundle: ${content_type}
        field_name: ${field_name}
        edit_mode: false
        base_field: ${base_field}
        prompt: "Based on the context text choose up to {{ max_amount }} keyword tags from the tag context that fits the text.\r\n\r\nTag options:\r\n{{ value_options_comma }}\r\n\r\nContext:\r\n{{ context }}"
        token: ""
        plugin_config:
          automator_enabled: 1
          automator_rule: llm_taxonomy
          automator_mode: base
          automator_base_field: ${base_field}
          automator_prompt: "Based on the context text choose up to {{ max_amount }} keyword tags from the tag context that fits the text.\r\n\r\nTag options:\r\n{{ value_options_comma }}\r\n\r\nContext:\r\n{{ context }}"
          automator_token: ""
          automator_edit_mode: 0
          automator_label: 'Tags Default'
          automator_weight: '100'
          automator_worker_type: direct
          automator_ai_provider: default_json
          automator_clean_up: ''
          automator_search_similar_tags: 0
