Class: XAeonAgents::Agents::ReviewResponderAgent

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

Overview

Agent responsible for generating a reply to a review comment

Instance Method Summary collapse

Methods included from XAeonAgents::AgentDefaults

#new_agent, prepended, singleton_session_id

Constructor Details

#initialize(**agent_params) ⇒ ReviewResponderAgent

Constructor

Parameters:

  • agent_params (Hash{Symbol => Object})

    Extra agent parameters



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/x_aeon_agents/agents/review_responder_agent.rb', line 43

def initialize(**agent_params)
  super(
    name: 'ReviewResponder',
    role: 'You are a review responder agent. Your role is to reply to feedback, ' \
      'taking into account the feedback itself, and the work that has been done because of this feedback.',
    objective: 'Generate a reply to a review comment',
    **agent_params
  )
  self.constraints = <<~EO_CONSTRAINTS
    - You are in read-only mode.
    - Do NOT modify or write any file.
    - The implementation work is already complete (captured in the artifacts).
    - ONLY focus on addressing the specific comment of the `#{artifact_ref(:open_comment_for_reply)}` artifact appropriately.
    - Do NOT answer or reply to any other comment.
    - You already have ALL the information required.
    - You MUST NOT ask follow-up questions.
    - You MUST NOT ask for user confirmation.
  EO_CONSTRAINTS
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
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/x_aeon_agents/agents/review_responder_agent.rb', line 10

def input_artifacts_contracts
  super.merge(
    {
      conversations: {
        description: 'All PR conversations and comments to be considered (context)',
        type: :json
      },
      open_comment_for_reply: {
        description: 'The exact comment to be replied to',
        type: :json
      },
      requirements: 'The requirements that have been implemented (or "No requirements")',
      plan: 'The implementation plan that was used to implement those requirements (or "No implementation plan")',
      files_diffs: 'The code changes from implement_requirements workflow (or "No changes")'
    }
  )
end

#output_artifacts_contractsHash{Symbol => Object}

Define output artifacts contracts

Returns:

  • (Hash{Symbol => Object})

    Set of output artifacts description, per artifact name



31
32
33
34
35
36
37
38
# File 'lib/x_aeon_agents/agents/review_responder_agent.rb', line 31

def output_artifacts_contracts
  super.merge(
    reply: {
      description: 'The exact reply text to post',
      type: :text
    }
  )
end