Create the tools for the Content Type Agent

Created on 12 February 2025, 3 months ago
Updated 2 May 2025, 13 days ago

Problem/Motivation

When moving away from code heavy solutions and the Content Type Agent would be the first one to test by putting all the context tools and the action tools into abstraction and setting up the different agents using actual GUI.

The following actions will be needed:
get_bundle_type - (to get bundle types for an entity type)
get_verbose_node_type_information - (to get node type information about all or one node type)
create_node_type - (to create a node type)
edit_node_type - (to edit a node type)
delete_node_type - (to delete a note type, will not be used by default)

Remaining tasks

Create the actions.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany marcus_johansson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @marcus_johansson
  • First commit to issue fork.
  • 🇮🇳India anjaliprasannan

    Here are the steps to implement that I understand from the requirement.

    1. Enhance ContentType Agent for Required Actions
    Implement All Required Actions:

    • Add getBundleTypes($entity_type_id) to retrieve bundle types for an entity type (currently supports node only, extensible for others).
    • Modify getVerboseNodeTypesAsString($dataName = '') to support fetching detailed information for all or a specific node type.
    • Retain and refine createNodeType() to create a new node type with structured inputs.
    • Retain and refine editNodeType() to update an existing node type’s settings.
    • Keep deleteNodeType() restrict, returning user instructions for manual deletion due to permission limitations.

    Update agentsCapabilities():

    • Define detailed schemas for all actions (get_bundle_type, get_verbose_node_type_information, create_node_type, edit_node_type, delete_node_type) with inputs, outputs, and descriptions to support GUI integration.
    • Add support for both free-text prompts and structured action inputs (e.g., { "action": "create_node_type", "data": { ... } }).
    • Update determineTypeOfTask() to handle structured action inputs alongside free-text prompts, mapping them to the appropriate task types (e.g., create_node_type, edit_node_type).
    • Enhance validation for edit_node_type and delete_node_type to check node type existence, suggesting similar node types if not found.

    Add Utility Methods:

    • Introduce getPreviewModeLabel($mode) to provide human-readable labels for preview mode in verbose output.
    • Ensure setOverrideValue() supports default field values (e.g., sticky, promote, status) for node types.

    Added Action Discovery:

    • Implement getAgentActions($agent_id) to return an agent’s action schemas (from agentsCapabilities()['actions']) for dynamic GUI form generation.
    • Supported Structured Action Requests:
    • Updated triggerAction($action_id, $parameters) to process structured parameters (e.g., { "action": "create_node_type", "data": { ... } }) by merging action and data into the agent’s data structure.

    @marcus_johansson Please confirm if I can proceed with these steps or you have a different approach?

  • 🇮🇳India Akhil Babu Chengannur

    Looking at the available tools, all tools mentioned in the issue summary are already there

    'List Bundles' tool already provides bundle types for an entity type.
    'Get Content Type Info' provides information about any node types.
    'Create Content Type' for Creating content types
    'Edit Content Type' for editing content types
    'Delete Content Type' for deleting content types.

  • 🇩🇪Germany marcus_johansson

    Sorry, this should already be closed as duplicate. The content type agent works in the new agent format.

Production build 0.71.5 2024