Module: ActiveMatrix

Defined in:
lib/active_matrix.rb,
lib/active_matrix/api.rb,
lib/active_matrix/bot.rb,
lib/active_matrix/mxid.rb,
lib/active_matrix/room.rb,
lib/active_matrix/user.rb,
lib/active_matrix/client.rb,
lib/active_matrix/engine.rb,
lib/active_matrix/errors.rb,
lib/active_matrix/events.rb,
lib/active_matrix/memory.rb,
lib/active_matrix/logging.rb,
lib/active_matrix/railtie.rb,
lib/active_matrix/version.rb,
lib/active_matrix/response.rb,
lib/active_matrix/cacheable.rb,
lib/active_matrix/extensions.rb,
lib/active_matrix/uri_module.rb,
lib/active_matrix/client_pool.rb,
lib/active_matrix/memory/base.rb,
app/models/active_matrix/agent.rb,
lib/active_matrix/event_router.rb,
lib/active_matrix/agent_manager.rb,
lib/active_matrix/agent_registry.rb,
lib/active_matrix/state_event_cache.rb,
app/models/active_matrix/agent_store.rb,
lib/active_matrix/account_data_cache.rb,
app/models/active_matrix/chat_session.rb,
lib/active_matrix/memory/agent_memory.rb,
app/jobs/active_matrix/application_job.rb,
lib/active_matrix/memory/global_memory.rb,
app/models/active_matrix/knowledge_base.rb,
app/models/active_matrix/application_record.rb,
lib/active_matrix/memory/conversation_memory.rb,
lib/generators/active_matrix/bot/bot_generator.rb,
app/models/active_matrix/agent/jobs/memory_reaper.rb,
lib/active_matrix/protocols/cs/message_relationships.rb,
lib/generators/active_matrix/install/install_generator.rb

Defined Under Namespace

Modules: Bot, Cacheable, Errors, Extensions, Generators, Logging, Memory, Protocols, Response, Rooms, Uri Classes: AccountDataCache, Agent, AgentAlreadyRunningError, AgentManager, AgentRegistry, AgentStore, Api, ApplicationJob, ApplicationRecord, ChatSession, Client, ClientPool, Configuration, Engine, ErrorEvent, Event, EventHandlerArray, EventRouter, KnowledgeBase, MXID, MatrixEvent, Railtie, Room, StateEventCache, User

Constant Summary collapse

Loader =

Set up Zeitwerk loader

Zeitwerk::Loader.for_gem
MatrixError =

Make error classes available at the top level for backward compatibility

Errors::MatrixError
MatrixRequestError =
Errors::MatrixRequestError
MatrixNotAuthorizedError =
Errors::MatrixNotAuthorizedError
MatrixForbiddenError =
Errors::MatrixForbiddenError
MatrixNotFoundError =
Errors::MatrixNotFoundError
MatrixConflictError =
Errors::MatrixConflictError
MatrixTooManyRequestsError =
Errors::MatrixTooManyRequestsError
MatrixConnectionError =
Errors::MatrixConnectionError
MatrixTimeoutError =
Errors::MatrixTimeoutError
MatrixUnexpectedResponseError =
Errors::MatrixUnexpectedResponseError
VERSION =
'0.0.7'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject

Returns the value of attribute config.



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

def config
  @config
end

.loggerObject



54
55
56
57
58
59
60
61
# File 'lib/active_matrix.rb', line 54

def logger
  @logger ||= if defined?(::Rails) && ::Rails.respond_to?(:logger)
                ::Rails.logger
              else
                require 'logger'
                ::Logger.new($stdout)
              end
end

Class Method Details

.configure {|@config| ... } ⇒ Object

Yields:



17
18
19
20
21
# File 'lib/active_matrix.rb', line 17

def configure
  @config ||= Configuration.new
  yield @config if block_given?
  @config
end

.debug!Object



63
64
65
66
67
68
69
# File 'lib/active_matrix.rb', line 63

def debug!
  logger.level = if defined?(::Rails)
                   :debug
                 else
                   ::Logger::DEBUG
                 end
end

.global_logger?Boolean

Returns:

  • (Boolean)


71
72
73
# File 'lib/active_matrix.rb', line 71

def global_logger?
  instance_variable_defined?(:@logger)
end