Class: ActiveGenie::Comparator::Fight
- Inherits:
-
Debate
- Object
- BaseModule
- Debate
- ActiveGenie::Comparator::Fight
- Defined in:
- lib/active_genie/comparator/fight.rb
Overview
The Fight class are comparation specialized in a fight between two fighters, like martial arts, heroes, characters. The fight evaluation process simulate a fight using words, techniques, strategies, and reasoning.
Constant Summary collapse
- PROMPT =
File.read(File.join(__dir__, 'fight.prompt.md'))
- FUNCTION =
JSON.parse(File.read(File.join(__dir__, 'fight.json')), symbolize_names: true)
Instance Method Summary collapse
-
#call ⇒ ComparatorResponse
The evaluation result containing the winner and reasoning.
Methods inherited from Debate
Methods inherited from BaseModule
call, #config, #initialize, #module_config
Constructor Details
This class inherits a constructor from ActiveGenie::Comparator::Debate
Instance Method Details
#call ⇒ ComparatorResponse
Returns The evaluation result containing the winner and reasoning.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/active_genie/comparator/fight.rb', line 16 def call = [ { role: 'system', content: PROMPT }, { role: 'user', content: "player_a: #{@player_a}" }, { role: 'user', content: "player_b: #{@player_b}" }, { role: 'user', content: "criteria: #{@criteria}" } ] provider_response = ::ActiveGenie::Providers::UnifiedProvider.function_calling( , FUNCTION, config: ) response_formatted(provider_response) end |