Class: OmniAgent::Generators::EvalGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/omni_agent/eval/eval_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_eval_fileObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/generators/omni_agent/eval/eval_generator.rb', line 7

def create_eval_file
  FileUtils.mkdir_p(evals_directory)

  create_file(eval_file_path, <<~RUBY)
    class #{eval_class_name} < OmniAgent::Eval
      agent #{class_name}

      eval_case "describe what #{class_name} should do" do
        input "Say hello"
        expect_output to_include: "hello"
      end
    end
  RUBY
end