Module: ActiveAI

Defined in:
lib/activeai.rb,
lib/activeai/version.rb

Defined Under Namespace

Classes: Behavior, Configuration, Controller, Error, NeuralNetwork, Router

Constant Summary collapse

VERSION =
"0.1.5"

Class Method Summary collapse

Class Method Details

.configObject



6
7
8
9
10
# File 'lib/activeai.rb', line 6

def self.config
  {
    gpt3_token: ENV['OPEN_AI_TOKEN']
  }
end

.route_examples_to_function_call_examples(examples) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/activeai.rb', line 12

def self.route_examples_to_function_call_examples(examples)
  examples.map do |example|
    function = example['Route'].gsub('/','.').gsub('#','.')
    function = "unmatched" if function == "None"
    
    {
      description: example['Match'],
      code: "#{function}(#{example['Params']&.strip})"
    }
  end
end