Class: Llm::Functions::RecordLgtm

Inherits:
Base
  • Object
show all
Defined in:
lib/llm/functions/record_lgtm.rb

Instance Method Summary collapse

Constructor Details

#initializeRecordLgtm

Returns a new instance of RecordLgtm.



8
9
10
# File 'lib/llm/functions/record_lgtm.rb', line 8

def initialize
  @lgtm = false
end

Instance Method Details

#definitionObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/llm/functions/record_lgtm.rb', line 21

def definition
  return @definition unless @definition.nil?

  @definition = {
    name: self.function_name,
    description: I18n.t("ghostest.functions.#{self.function_name}.description"),
    parameters: {
      type: :object,
      properties: {
        message: {
          type: :string,
          description: I18n.t("ghostest.functions.#{self.function_name}.parameters.message"),
        },
      },
      required: [:message],
    },
  }
  @definition
end

#execute_and_generate_message(args) ⇒ Object



41
42
43
44
45
# File 'lib/llm/functions/record_lgtm.rb', line 41

def execute_and_generate_message(args)
  @lgtm = true

  { message: args[:message] }
end

#function_nameObject



4
5
6
# File 'lib/llm/functions/record_lgtm.rb', line 4

def function_name
  :record_lgtm
end

#lgtm?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/llm/functions/record_lgtm.rb', line 17

def lgtm?
  !!@lgtm
end

#stop_llm_call?Boolean

Returns:

  • (Boolean)


12
13
14
15
# File 'lib/llm/functions/record_lgtm.rb', line 12

def stop_llm_call?
  # stop always
  true
end