Module: SmartPrompt

Defined in:
lib/smart_prompt.rb,
lib/smart_prompt/engine.rb,
lib/smart_prompt/worker.rb,
lib/smart_prompt/message.rb,
lib/smart_prompt/session.rb,
lib/smart_prompt/version.rb,
lib/smart_prompt/lru_cache.rb,
lib/smart_prompt/db_adapter.rb,
lib/smart_prompt/api_handler.rb,
lib/smart_prompt/llm_adapter.rb,
lib/smart_prompt/stt_adapter.rb,
lib/smart_prompt/tts_adapter.rb,
lib/smart_prompt/conversation.rb,
lib/smart_prompt/token_counter.rb,
lib/smart_prompt/zhipu_adapter.rb,
lib/smart_prompt/openai_adapter.rb,
lib/smart_prompt/history_manager.rb,
lib/smart_prompt/hybrid_strategy.rb,
lib/smart_prompt/prompt_template.rb,
lib/smart_prompt/context_strategy.rb,
lib/smart_prompt/llamacpp_adapter.rb,
lib/smart_prompt/anthropic_adapter.rb,
lib/smart_prompt/persistence_layer.rb,
lib/smart_prompt/sensenova_adapter.rb,
lib/smart_prompt/compression_engine.rb,
lib/smart_prompt/multimodal_adapter.rb,
lib/smart_prompt/summary_based_strategy.rb,
lib/smart_prompt/sliding_window_strategy.rb,
lib/smart_prompt/image_generation_adapter.rb,
lib/smart_prompt/relevance_based_strategy.rb,
lib/smart_prompt/video_generation_adapter.rb

Defined Under Namespace

Modules: APIHandler, ContextStrategy Classes: AnthropicAdapter, AsyncWriter, CallWorkerError, CompressionEngine, ConfigurationError, Conversation, DBAdapter, Engine, Error, HistoryManager, HistoryManagerError, HybridStrategy, ImageGenerationAdapter, LLMAPIError, LLMAdapter, LRUCache, LlamacppAdapter, Message, MockAdapter, MultimodalAdapter, OpenAIAdapter, PersistenceLayer, PromptTemplate, RelevanceBasedStrategy, STTAdapter, SenseNovaAdapter, Session, SlidingWindowStrategy, SummaryBasedStrategy, TTSAdapter, TokenCounter, VideoGenerationAdapter, Worker, WorkerContext, ZhipuAIAdapter

Constant Summary collapse

VERSION =
"0.5.1"

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.



39
40
41
# File 'lib/smart_prompt.rb', line 39

def logger=(value)
  @logger = value
end

Class Method Details

.define_worker(name, &block) ⇒ Object



41
42
43
# File 'lib/smart_prompt.rb', line 41

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

.loggerObject



54
55
56
57
58
# File 'lib/smart_prompt.rb', line 54

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

.logger=(logger) ⇒ Object



50
51
52
# File 'lib/smart_prompt.rb', line 50

def self.logger=(logger)
  @logger = logger
end

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



45
46
47
48
# File 'lib/smart_prompt.rb', line 45

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