Class: XAeonAgents::Agents::OneLineCodeDiffSummarizerAgent

Inherits:
ComposableAgents::AiAgents::Agent
  • Object
show all
Includes:
XAeonAgents::AgentDefaults
Defined in:
lib/x_aeon_agents/agents/one_line_code_diff_summarizer_agent.rb

Overview

Agent responsible for summarizing code change intent into a single line

Instance Method Summary collapse

Methods included from XAeonAgents::AgentDefaults

#new_agent, prepended, singleton_session_id

Constructor Details

#initialize(**agent_params) ⇒ OneLineCodeDiffSummarizerAgent

Constructor

Parameters:

  • agent_params (Hash{Symbol => Object})

    Extra agent parameters



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/x_aeon_agents/agents/one_line_code_diff_summarizer_agent.rb', line 24

def initialize(**agent_params)
  super(
    name: '1-line code diff summarizer',
    role: 'You are a 1-line code diff summarizer agent',
    objective: 'Produce a 1-line summary of a code change intent report.',
    constraints: <<~EO_CONSTRAINTS,
      - You are in read-only mode.
      - Do NOT modify or write any file.
      - You already have ALL the information required.
      - The user's intent is fully specified.
      - You MUST NOT ask follow-up questions.
    EO_CONSTRAINTS
    **agent_params
  )
  self.system_instructions = {
    ordered_list: [
      <<~EO_INSTRUCTIONS,
      <<~EO_INSTRUCTIONS
        Create an artifact named `#{artifact_ref(:one_line_summary)}` to provide a 1-line summary of the code change intent described in the artifact named `#{artifact_ref(:change_intent)}`

        - Summarize the change intent the same way you would write a git commit comment title.
        - Follow standard git commit title conventions using `feat`, `fix`, etc... with impacted component names.
      EO_INSTRUCTIONS
    ]
  }
end

Instance Method Details

#input_artifacts_contractsHash{Symbol => Object}

Define input artifacts contracts

Returns:

  • (Hash{Symbol => Object})

    Set of input artifacts description, per artifact name



10
11
12
# File 'lib/x_aeon_agents/agents/one_line_code_diff_summarizer_agent.rb', line 10

def input_artifacts_contracts
  super.merge(change_intent: 'Full description of the code changes, their meaning and intent')
end

#output_artifacts_contractsHash{Symbol => Object}

Define output artifacts contracts

Returns:

  • (Hash{Symbol => Object})

    Set of output artifacts description, per artifact name



17
18
19
# File 'lib/x_aeon_agents/agents/one_line_code_diff_summarizer_agent.rb', line 17

def output_artifacts_contracts
  super.merge(one_line_summary: '1-line summary of the code change intent')
end