Module: Parse::Agent::MetadataDSL

Included in:
Object
Defined in:
lib/parse/agent/metadata_dsl.rb

Overview

DSL module that adds agent metadata capabilities to Parse::Object models. Allows models to self-document with descriptions and expose safe methods to the Parse Agent for LLM interaction.

Examples:

Define a model with agent metadata

class Team < Parse::Object
  agent_description "A group of users contributing to a Project"

  property :name, :string, description: "The team's display name"
  property :member_count, :integer, description: "Number of active members"

  agent_method :active_projects, "Returns projects currently in progress"
  agent_method :member_names, "Returns array of member display names"

  def self.active_projects
    Project.query(status: "active")
  end

  def member_names
    members.map(&:display_name)
  end
end

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



30
31
32
# File 'lib/parse/agent/metadata_dsl.rb', line 30

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#agent_descriptionString?

Instance method to access class-level agent description

Returns:



707
708
709
# File 'lib/parse/agent/metadata_dsl.rb', line 707

def agent_description
  self.class.agent_description
end

#agent_methodsHash<Symbol, Hash>

Instance method to access class-level agent methods

Returns:



728
729
730
# File 'lib/parse/agent/metadata_dsl.rb', line 728

def agent_methods
  self.class.agent_methods
end

#property_descriptionsHash<Symbol, String>

Instance method to access class-level property descriptions

Returns:



714
715
716
# File 'lib/parse/agent/metadata_dsl.rb', line 714

def property_descriptions
  self.class.property_descriptions
end

#property_enum_descriptionsHash<Symbol, Hash{String => String}>

Instance method to access class-level per-value enum descriptions

Returns:



721
722
723
# File 'lib/parse/agent/metadata_dsl.rb', line 721

def property_enum_descriptions
  self.class.property_enum_descriptions
end