Module: SmartPrompt

Defined in:
lib/smart_prompt.rb,
lib/smart_prompt/engine.rb,
lib/smart_prompt/worker.rb,
lib/smart_prompt/version.rb,
lib/smart_prompt/llm_adapter.rb,
lib/smart_prompt/conversation.rb,
lib/smart_prompt/prompt_template.rb

Defined Under Namespace

Classes: Conversation, Engine, Error, LLMAdapter, LlamacppAdapter, MockAdapter, OllamaAdapter, OpenAIAdapter, PromptTemplate, Worker, WorkerContext

Constant Summary collapse

VERSION =
"0.1.5"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#logger=(value) ⇒ Object (writeonly)

Sets the attribute logger

Parameters:

  • value

    the value to set the attribute logger to.



10
11
12
# File 'lib/smart_prompt.rb', line 10

def logger=(value)
  @logger = value
end

Class Method Details

.define_worker(name, &block) ⇒ Object



12
13
14
# File 'lib/smart_prompt.rb', line 12

def self.define_worker(name, &block)
  Worker.define(name, &block)
end

.loggerObject



21
22
23
24
25
# File 'lib/smart_prompt.rb', line 21

def self.logger
  @logger ||= Logger.new($stdout).tap do |log|
    log.progname = self.name
  end
end

.run_worker(name, config_file, params = {}) ⇒ Object



16
17
18
19
# File 'lib/smart_prompt.rb', line 16

def self.run_worker(name, config_file, params = {})
  worker = Worker.new(name, config_file)
  worker.execute(params)
end