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 Workspace < Parse::Object
  agent_description "A group of users contributing to a Project"

  property :name, :string, description: "The workspace'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

Instance Method Summary collapse

Instance Method Details

#agent_descriptionString?

Instance method to access class-level agent description

Returns:



765
766
767
# File 'lib/parse/agent/metadata_dsl.rb', line 765

def agent_description
  self.class.agent_description
end

#agent_methodsHash<Symbol, Hash>

Instance method to access class-level agent methods

Returns:



786
787
788
# File 'lib/parse/agent/metadata_dsl.rb', line 786

def agent_methods
  self.class.agent_methods
end

#property_descriptionsHash<Symbol, String>

Instance method to access class-level property descriptions

Returns:



772
773
774
# File 'lib/parse/agent/metadata_dsl.rb', line 772

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:



779
780
781
# File 'lib/parse/agent/metadata_dsl.rb', line 779

def property_enum_descriptions
  self.class.property_enum_descriptions
end