Class: XAeonAgents::Agents::GitDiffInterpreterAgent
- Inherits:
-
ComposableAgents::Agent
- Object
- ComposableAgents::Agent
- XAeonAgents::Agents::GitDiffInterpreterAgent
- Includes:
- XAeonAgents::AgentDefaults
- Defined in:
- lib/x_aeon_agents/agents/git_diff_interpreter_agent.rb
Overview
Agent responsible for analyzing git differences with a given git ref base. The git ref base is given in the git_ref_base input artifact. For the staging area diff, use cached as the git_ref_base content.
Instance Method Summary collapse
-
#diff_interpreter_agent ⇒ Agent
Get a Diff Interpreter agent.
-
#initialize(**agent_params) ⇒ GitDiffInterpreterAgent
constructor
Constructor.
-
#input_artifacts_contracts ⇒ Hash{Symbol => Object}
Define input artifacts contracts.
-
#output_artifacts_contracts ⇒ Hash{Symbol => Object}
Define output artifacts contracts.
-
#run(git_ref_base:) ⇒ Hash{Symbol => Object}
Execute the agent to generate some output artifacts based on some input artifacts.
Methods included from XAeonAgents::AgentDefaults
#new_agent, prepended, singleton_session_id
Constructor Details
#initialize(**agent_params) ⇒ GitDiffInterpreterAgent
Constructor
29 30 31 |
# File 'lib/x_aeon_agents/agents/git_diff_interpreter_agent.rb', line 29 def initialize(**agent_params) super(name: 'Git Diff Interpreter', **agent_params) end |
Instance Method Details
#diff_interpreter_agent ⇒ Agent
Get a Diff Interpreter agent.
52 53 54 |
# File 'lib/x_aeon_agents/agents/git_diff_interpreter_agent.rb', line 52 def diff_interpreter_agent @diff_interpreter_agent ||= new_agent(DiffInterpreterAgent, **Config.['free_simple']) end |
#input_artifacts_contracts ⇒ Hash{Symbol => Object}
Define input artifacts contracts
12 13 14 |
# File 'lib/x_aeon_agents/agents/git_diff_interpreter_agent.rb', line 12 def input_artifacts_contracts { git_ref_base: 'Git reference used to diff with' } end |
#output_artifacts_contracts ⇒ Hash{Symbol => Object}
Define output artifacts contracts
19 20 21 22 23 24 |
# File 'lib/x_aeon_agents/agents/git_diff_interpreter_agent.rb', line 19 def output_artifacts_contracts { change_intent: 'Full description of the code changes, their meaning and intent', one_line_summary: '1-line summary of the code change intent' } end |
#run(git_ref_base:) ⇒ Hash{Symbol => Object}
Execute the agent to generate some output artifacts based on some input artifacts.
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/x_aeon_agents/agents/git_diff_interpreter_agent.rb', line 37 def run(git_ref_base:) step_agent( diff_interpreter_agent, files_diff: Helpers.artifact_files_diffs(git_ref_base == 'cached' ? :cached : git_ref_base) ) step_agent(new_agent(OneLineCodeDiffSummarizerAgent, **Config.['free_simple'])) { change_intent: @artifacts[:change_intent], one_line_summary: @artifacts[:one_line_summary] } end |