Module: Phronomy::Agent::Concerns::Filterable::ClassMethods Private

Defined in:
lib/phronomy/agent/concerns/filterable.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Class-level DSL mixed into the including agent class.

Instance Method Summary collapse

Instance Method Details

#_class_input_filtersArray<Phronomy::Filter::Base>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:



60
61
62
# File 'lib/phronomy/agent/concerns/filterable.rb', line 60

def _class_input_filters
  @_class_input_filters || []
end

#_class_output_filtersArray<Phronomy::Filter::Base>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:



66
67
68
# File 'lib/phronomy/agent/concerns/filterable.rb', line 66

def _class_output_filters
  @_class_output_filters || []
end

#_class_tool_result_filtersArray<Phronomy::Filter::Base>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:



72
73
74
# File 'lib/phronomy/agent/concerns/filterable.rb', line 72

def _class_tool_result_filters
  @_class_tool_result_filters || []
end

#input_filter(filter) ⇒ void

This method returns an undefined value.

Registers a filter applied to every invocation's user input. Accepts either a Filter::Base instance or a subclass; when a class is given it is instantiated with +.new+.

Parameters:



31
32
33
34
# File 'lib/phronomy/agent/concerns/filterable.rb', line 31

def input_filter(filter)
  @_class_input_filters ||= []
  @_class_input_filters << _resolve_filter(filter)
end

#output_filter(filter) ⇒ void

This method returns an undefined value.

Registers a filter applied to every invocation's final LLM output. Accepts either a Filter::Base instance or a subclass; when a class is given it is instantiated with +.new+.

Parameters:



42
43
44
45
# File 'lib/phronomy/agent/concerns/filterable.rb', line 42

def output_filter(filter)
  @_class_output_filters ||= []
  @_class_output_filters << _resolve_filter(filter)
end

#tool_result_filter(filter) ⇒ void

This method returns an undefined value.

Registers a filter applied to every tool result for all tools. Accepts either a Filter::Base instance or a subclass; when a class is given it is instantiated with +.new+.

Parameters:



53
54
55
56
# File 'lib/phronomy/agent/concerns/filterable.rb', line 53

def tool_result_filter(filter)
  @_class_tool_result_filters ||= []
  @_class_tool_result_filters << _resolve_filter(filter)
end