Class: RubyLLM::Modes::Registration

Inherits:
Data
  • Object
show all
Defined in:
lib/ruby_llm/modes/registration.rb

Overview

One mode declaration of a router, resolved. klass is the agent class, name the registration name, description the routing description, and condition the if: lambda or nil.

Router#modes returns the registrations available for a call, and a classifier receives the same objects as modes:.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#condition ⇒ Object (readonly)

Returns the value of attribute condition

Returns:

  • (Object) —

    the current value of condition



11
12
13
# File 'lib/ruby_llm/modes/registration.rb', line 11

def condition
  @condition
end

#description ⇒ Object (readonly)

Returns the value of attribute description

Returns:

  • (Object) —

    the current value of description



11
12
13
# File 'lib/ruby_llm/modes/registration.rb', line 11

def description
  @description
end

#klass ⇒ Object (readonly)

Returns the value of attribute klass

Returns:

  • (Object) —

    the current value of klass



11
12
13
# File 'lib/ruby_llm/modes/registration.rb', line 11

def klass
  @klass
end

#name ⇒ Object (readonly)

Returns the value of attribute name

Returns:

  • (Object) —

    the current value of name



11
12
13
# File 'lib/ruby_llm/modes/registration.rb', line 11

def name
  @name
end

Instance Method Details

#available_on?(router) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/ruby_llm/modes/registration.rb', line 12

def available_on?(router)
  condition.nil? || !!router.instance_exec(&condition)
end