Module: Smith::Tool::ChatExecutionContext

Class Method Summary collapse

Methods included from BoundedCompletionInstallation

#complete

Class Method Details

.install(chat) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/smith/tool/chat_execution_context.rb', line 12

def self.install(chat)
  return chat unless chat.respond_to?(:tools) && chat.tools.respond_to?(:values)
  unless chat.respond_to?(:execute_tool, true)
    raise Error, "unsupported RubyLLM chat execution interface: missing #execute_tool"
  end

  chat.extend(self) unless chat.singleton_class < self
  chat.__send__(:smith_tool_execution_batches)
  chat
end