Class: Ollama::ToolIntent

Inherits:
Object
  • Object
show all
Defined in:
lib/ollama/tool_intent.rb

Overview

Tool intent extraction helper.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action, input = {}) ⇒ ToolIntent

Returns a new instance of ToolIntent.

Parameters:

  • action (String)
  • input (Hash) (defaults to: {})


10
11
12
13
# File 'lib/ollama/tool_intent.rb', line 10

def initialize(action, input = {})
  @action = action
  @input = input.is_a?(Hash) ? input : {}
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



6
7
8
# File 'lib/ollama/tool_intent.rb', line 6

def action
  @action
end

#inputObject (readonly)

Returns the value of attribute input.



6
7
8
# File 'lib/ollama/tool_intent.rb', line 6

def input
  @input
end

Instance Method Details

#finish?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/ollama/tool_intent.rb', line 15

def finish?
  @action == "finish"
end